05스플릿 플랩 보드
공항 전광판처럼 글자판이 위아래로 빠르게 넘어가다가 정답 글자에서 멈춥니다.
쓰임숫자 카운터·가격 표시, 레트로 느낌의 타이틀
rotateXsteps()perspective

<main class="stage">
<div class="sf-board is-demo" aria-hidden="true">
<span class="sf-char">S</span>
<span class="sf-char">A</span>
<span class="sf-char">L</span>
<span class="sf-char">E</span>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
// ── 변수 3개 ──────────────────────────────────────────
$duration: $dur-loop;
$easing: $ease-out;
$color: $subject-cream;
@include stage($stage-ink);
.sf-board {
display: flex;
gap: $sp-2;
perspective: 600px;
}
.sf-char {
display: inline-block;
width: clamp(32px, 9vw, 48px);
padding: $sp-2 0;
border-radius: $r-sm;
background: rgba(255, 255, 255, .08);
color: $color;
font: 800 clamp(20px, 6vw, 28px)/1 -apple-system, "Segoe UI", sans-serif;
text-align: center;
transform-origin: center;
transform: rotateX(90deg);
opacity: 0;
filter: blur(3px);
}
// 데모 루프: 글자판이 위에서 아래로 뒤집히며 나타났다가 짧게 위로 되감겨 다시 뒤집힌다 (steps 로 기계적인 느낌)
// 한 겹: blur→focus — 판이 모서리로 서는 중간 지점(edge-on, rotateX 근처)에서 살짝 흐려졌다가 착지하며
// 초점이 맞는다(실제 플랩보드의 모션 블러를 흉내). steps() 타이밍은 기계적 느낌이라 건드리지 않는다.
@keyframes sf-flip {
0% { transform: rotateX(90deg); opacity: 0; filter: blur(3px); }
15% { filter: blur(4px); }
30% { transform: rotateX(0deg); opacity: 1; filter: blur(0); }
90% { transform: rotateX(0deg); opacity: 1; filter: blur(0); }
95% { filter: blur(4px); }
100% { transform: rotateX(90deg); opacity: 0; filter: blur(3px); }
}
.sf-board.is-demo .sf-char { animation: sf-flip $duration steps(3, end) infinite; }
.sf-board.is-demo .sf-char:nth-child(1) { animation-delay: 0ms; }
.sf-board.is-demo .sf-char:nth-child(2) { animation-delay: 120ms; }
.sf-board.is-demo .sf-char:nth-child(3) { animation-delay: 240ms; }
.sf-board.is-demo .sf-char:nth-child(4) { animation-delay: 360ms; }
@media (prefers-reduced-motion: reduce) {
.sf-char,
.sf-board.is-demo .sf-char {
animation: none !important;
opacity: 1 !important;
transform: none !important;
filter: none !important;
}
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #17141a;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.sf-board {
display: flex;
gap: 8px;
perspective: 600px;
}
.sf-char {
display: inline-block;
width: clamp(32px, 9vw, 48px);
padding: 8px 0;
border-radius: 8px;
background: rgba(255, 255, 255, 0.08);
color: #fff7e6;
font: 800 clamp(20px, 6vw, 28px)/1 -apple-system, "Segoe UI", sans-serif;
text-align: center;
transform-origin: center;
transform: rotateX(90deg);
opacity: 0;
filter: blur(3px);
}
@keyframes sf-flip {
0% {
transform: rotateX(90deg);
opacity: 0;
filter: blur(3px);
}
15% {
filter: blur(4px);
}
30% {
transform: rotateX(0deg);
opacity: 1;
filter: blur(0);
}
90% {
transform: rotateX(0deg);
opacity: 1;
filter: blur(0);
}
95% {
filter: blur(4px);
}
100% {
transform: rotateX(90deg);
opacity: 0;
filter: blur(3px);
}
}
.sf-board.is-demo .sf-char {
animation: sf-flip 2s steps(3, end) infinite;
}
.sf-board.is-demo .sf-char:nth-child(1) {
animation-delay: 0ms;
}
.sf-board.is-demo .sf-char:nth-child(2) {
animation-delay: 120ms;
}
.sf-board.is-demo .sf-char:nth-child(3) {
animation-delay: 240ms;
}
.sf-board.is-demo .sf-char:nth-child(4) {
animation-delay: 360ms;
}
@media (prefers-reduced-motion: reduce) {
.sf-char,
.sf-board.is-demo .sf-char {
animation: none !important;
opacity: 1 !important;
transform: none !important;
filter: none !important;
}
}import { CSSProperties, useEffect, useRef, useState } from "react";
import styles from "./SplitFlapBoard.module.scss";
export interface SplitFlapBoardProps {
text?: string;
duration?: string;
stagger?: string;
}
// 실사용: 뷰포트에 들어오면 글자판이 위에서 아래로 한 번씩 시차를 두고 뒤집히며 자리 잡는다.
export default function SplitFlapBoard({
text = "SALE",
duration = "500ms",
stagger = "120ms",
}: SplitFlapBoardProps) {
const ref = useRef<HTMLDivElement>(null);
const [inView, setInView] = useState(false);
useEffect(() => {
const el = ref.current;
if (!el) return;
const io = new IntersectionObserver((entries) => {
entries.forEach((e) => { if (e.isIntersecting) { setInView(true); io.unobserve(e.target); } });
}, { threshold: 0.3 });
io.observe(el);
return () => io.disconnect();
}, []);
const style = { "--duration": duration } as CSSProperties;
return (
<div className={styles.board} style={style} ref={ref}>
{text.split("").map((ch, i) => (
<span
key={i}
className={`${styles.char} ${inView ? styles.in : ""}`}
style={{ transitionDelay: inView ? `calc(${stagger} * ${i})` : undefined }}
>
{ch}
</span>
))}
</div>
);
}05 스플릿 플랩 보드 — 측정 누적면적 5.078% · 움직인 프레임 11/23GODRICH 원작 · zip 에 SCSS·React 포함 · CSS 텍스트 애니메이션 9종 — 등장·강조 모음
이 데모가 속한 글
CSS 텍스트 애니메이션 9종 — 등장·강조 모음CSS 텍스트 애니메이션은 제목이나 문장이 화면에 나타나거나 강조될 때 함께 움직이는 효과로, 코드를 몰라도 파일을 그대로 붙이면 바로 쓸 수 있습니다. 제목 하나로 눈길 끄는 그 짧은 순간을 만드는 아홉 가지 방법 이 글의 데모 전부 보기


