03스트리밍 커서 깜빡임
이미 답변 글자가 놓인 문장 끝에 짧은 세로 막대 커서가 붙어, opacity로 켜졌다 꺼지며 지금 이 자리에 글자가 이어서 나오고 있다는 걸 알려줍니다.
쓰임스트리밍 답변 끝 표시, 실시간 로그 출력줄
opacitysteps()530ms

<main class="stage">
<p class="cr-line is-demo">The border light rotates once around <span class="cr-tail">the card</span><span class="cr-caret"></span></p>
</main>@use "../../../../site/static/demo-tokens" as *;
// ── 변수 3개 ──────────────────────────────────────────
$duration: 530ms;
$easing: steps(1);
$color: $subject-cream;
@include stage($stage-orange);
.cr-line {
width: min(300px, 88vw);
margin: 0;
padding: $sp-4 $sp-5;
border-radius: $r-card;
box-sizing: border-box;
background: rgba(255, 255, 255, .12);
color: $subject-ink; // 주황 무대 위 글자 — AA 4.5 (blog-design 글자 대비)
font: 500 14px/1.5 -apple-system, "Segoe UI", sans-serif;
}
.cr-caret {
display: inline-block;
width: $sp-2;
height: 1em;
margin-left: $sp-1;
vertical-align: -0.2em;
background: $subject-ink; // 글자와 같은 색 (주황 무대 위 AA 4.5)
}
// 마지막으로 방금 도착한 단어 — 커서와 같은 박자로 깜빡여 "지금 여기"를 눈에 띄게 한다
.cr-tail { opacity: 1; }
// 실사용: 새 토큰이 도착하는 동안 항상 깜빡인다
@keyframes cr-blink {
0%, 49% { opacity: 1; }
50%, 100% { opacity: .25; }
}
.cr-line.is-demo .cr-caret,
.cr-line.is-demo .cr-tail {
animation: cr-blink $duration $easing infinite;
}
@media (prefers-reduced-motion: reduce) {
.cr-line.is-demo .cr-caret,
.cr-line.is-demo .cr-tail {
animation: none !important;
opacity: 1 !important;
}
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #ff4d1f;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.cr-line {
width: min(300px, 88vw);
margin: 0;
padding: 16px 20px;
border-radius: 16px;
box-sizing: border-box;
background: rgba(255, 255, 255, 0.12);
color: #17141a;
font: 500 14px/1.5 -apple-system, "Segoe UI", sans-serif;
}
.cr-caret {
display: inline-block;
width: 8px;
height: 1em;
margin-left: 4px;
vertical-align: -0.2em;
background: #17141a;
}
.cr-tail {
opacity: 1;
}
@keyframes cr-blink {
0%, 49% {
opacity: 1;
}
50%, 100% {
opacity: 0.25;
}
}
.cr-line.is-demo .cr-caret,
.cr-line.is-demo .cr-tail {
animation: cr-blink 530ms steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) {
.cr-line.is-demo .cr-caret,
.cr-line.is-demo .cr-tail {
animation: none !important;
opacity: 1 !important;
}
}import { CSSProperties } from "react";
import styles from "./StreamingCaret.module.scss";
type Vars = CSSProperties & {
"--duration"?: string;
"--easing"?: string;
"--color"?: string;
};
export interface StreamingCaretProps {
duration?: string;
easing?: string;
color?: string;
text?: string;
tail?: string;
}
export default function StreamingCaret({
duration = "530ms",
easing = "steps(1)",
color = "#fff7e6",
text = "The border light rotates once around ",
tail = "the card",
}: StreamingCaretProps) {
const style: Vars = {
"--duration": duration,
"--easing": easing,
"--color": color,
};
return (
<p className={styles.line} style={style}>
{text}
<span className={styles.tail}>{tail}</span>
<span className={styles.caret} />
</p>
);
}03 스트리밍 커서 깜빡임 — 측정 누적면적 0.272% · 움직인 프레임 7/23GODRICH 원작 · zip 에 SCSS·React 포함 · AI 채팅 CSS 로딩 애니메이션 9종
이 데모가 속한 글
AI 채팅 CSS 로딩 애니메이션 9종ChatGPT나 Claude 같은 AI 채팅창에서 답이 오기를 기다릴 때 뜨는 점 세 개, 깜빡이는 커서, 서서히 나타나는 글자는 전부 CSS 로딩 애니메이션입니다. div 하나로 끝나는 아홉 가지를 코드와 함께 모 이 글의 데모 전부 보기


