04반짝이는 텍스트
축하 제목 글자 주위에 작은 반짝임 3개를 배치해 각각 다른 시작 시점에 scale·opacity로 깜빡이게 합니다.
쓰임축하 메시지 타이틀, 프로모션 헤드라인
scaleopacity@keyframes twinkle

<main class="stage">
<div class="st-wrap is-demo">
<h2 class="st-title">축하합니다!</h2>
<span class="st-star st-star--1">✦</span>
<span class="st-star st-star--2">✦</span>
<span class="st-star st-star--3">✦</span>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
// ── 변수 3개 ──────────────────────────────────────────
$duration: 1.3s;
$easing: $ease-out;
$color: $subject-blue;
@include stage($stage-paper);
.st-wrap {
position: relative;
display: grid;
place-items: center;
padding: $sp-6;
}
.st-title {
margin: 0;
color: $subject-ink;
font: 800 30px/1 -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}
.st-star {
position: absolute;
color: $color;
font-size: 18px;
line-height: 1;
opacity: 0;
transform: scale(.2);
pointer-events: none;
}
.st-star--1 { top: -14px; left: -18px; color: $stage-orange; }
.st-star--2 { top: -20px; right: -14px; }
.st-star--3 { bottom: -16px; left: 40%; color: $stage-orange; }
@keyframes st-twinkle {
0%, 100% { opacity: 0; transform: scale(.2) rotate(0deg); }
50% { opacity: 1; transform: scale(1) rotate(70deg); }
}
.st-wrap.is-demo .st-star { animation: st-twinkle $duration $easing infinite; }
.st-star--2 { animation-delay: 260ms; }
.st-star--3 { animation-delay: 480ms; }
@media (prefers-reduced-motion: reduce) {
.st-wrap.is-demo .st-star { animation: none !important; opacity: 0 !important; }
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #ffffff;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.st-wrap {
position: relative;
display: grid;
place-items: center;
padding: 24px;
}
.st-title {
margin: 0;
color: #17141a;
font: 800 30px/1 -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}
.st-star {
position: absolute;
color: #2f6df6;
font-size: 18px;
line-height: 1;
opacity: 0;
transform: scale(0.2);
pointer-events: none;
}
.st-star--1 {
top: -14px;
left: -18px;
color: #ff4d1f;
}
.st-star--2 {
top: -20px;
right: -14px;
}
.st-star--3 {
bottom: -16px;
left: 40%;
color: #ff4d1f;
}
@keyframes st-twinkle {
0%, 100% {
opacity: 0;
transform: scale(0.2) rotate(0deg);
}
50% {
opacity: 1;
transform: scale(1) rotate(70deg);
}
}
.st-wrap.is-demo .st-star {
animation: st-twinkle 1.3s ease-out infinite;
}
.st-star--2 {
animation-delay: 260ms;
}
.st-star--3 {
animation-delay: 480ms;
}
@media (prefers-reduced-motion: reduce) {
.st-wrap.is-demo .st-star {
animation: none !important;
opacity: 0 !important;
}
}import { CSSProperties } from "react";
import styles from "./SparkleText.module.scss";
type Vars = CSSProperties & Record<string, string>;
export interface SparkleTextProps {
duration?: string;
easing?: string;
color?: string;
}
export default function SparkleText({
duration = "1.3s",
easing = "ease-out",
color = "#2f6df6",
}: SparkleTextProps) {
const style: Vars = { "--duration": duration, "--easing": easing, "--color": color };
return (
<div className={styles.wrap} style={style}>
<h2 className={styles.title}>축하합니다!</h2>
<span className={`${styles.star} ${styles.star1}`}>✦</span>
<span className={`${styles.star} ${styles.star2}`}>✦</span>
<span className={`${styles.star} ${styles.star3}`}>✦</span>
</div>
);
}04 반짝이는 텍스트 — 측정 누적면적 0.193% · 움직인 프레임 21/23GODRICH 원작 · zip 에 SCSS·React 포함 · 컨페티 효과 축하 애니메이션 CSS 9종
이 데모가 속한 글
컨페티 효과 축하 애니메이션 CSS 9종회원가입이나 결제가 끝난 순간 화면에 색종이 조각이 잠깐 터지는 컨페티 효과, 다들 한 번은 보셨을 겁니다. 버튼 클릭이나 체크 표시 하나로 이런 축하 반응을 켜는 CSS 아홉 가지를 한 줄 복붙으로 쓸 수 있게 모 이 글의 데모 전부 보기


