03가로 단계 채움
가로로 늘어선 단계 사이 연결선이 transform: scaleX(0)에서 scaleX(1)로 왼쪽부터 채워져, 지금까지 지나온 단계가 색으로 이어집니다.
쓰임회원가입 진행바, 설문조사 단계 표시
scaleXflex: 1 1 0600ms

<main class="stage">
<div class="ts03-steps is-demo">
<div class="ts03-step"><span class="ts03-circle">1</span><span class="ts03-label">가입</span></div>
<span class="ts03-bar"><span class="ts03-fill"></span></span>
<div class="ts03-step"><span class="ts03-circle">2</span><span class="ts03-label">프로필</span></div>
<span class="ts03-bar"><span class="ts03-fill"></span></span>
<div class="ts03-step"><span class="ts03-circle">3</span><span class="ts03-label">완료</span></div>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
// ── 변수 3개 ──────────────────────────────────────────
$duration: $dur-base;
$easing: $ease-out;
$color: $subject-ink; // 주황 무대 위 전경은 잉크 — 크림은 3.11:1
@include stage($stage-orange);
.ts03-steps {
display: flex;
align-items: flex-start;
width: min(320px, 88vw);
}
.ts03-step {
flex-grow: 0;
flex-shrink: 0;
flex-basis: auto;
display: flex;
flex-direction: column;
align-items: center;
gap: $sp-2;
color: $color;
font: 600 11px/1 -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}
.ts03-circle {
width: 32px;
height: 32px;
border-radius: 50%;
display: grid;
place-items: center;
background: rgba(255, 255, 255, .18);
color: $color;
font-weight: 700;
font-size: 13px;
line-height: 1;
font-family: inherit;
}
// 연결선: 왼쪽부터 채워진다 (transform-origin: left, scaleX)
.ts03-bar {
flex-grow: 1;
flex-shrink: 1;
flex-basis: 0;
height: 3px;
margin-top: 16px;
background: rgba(255, 255, 255, .22);
border-radius: $r-xs;
overflow: hidden;
display: block;
}
.ts03-fill {
display: block;
width: 100%;
height: 100%;
background: $color;
transform: scaleX(0);
transform-origin: left; // 규칙8: 연결선 왼쪽부터 채움
}
// 실제 사용 코드: 단계가 끝나면 JS 가 .is-done 을 붙이고 채워진다
.ts03-step.is-done .ts03-circle { background: $subject-cream; color: $subject-orange-deep; } // 채워진 원 안 숫자 — 크림 면 위 deep 5.04:1
.ts03-step.is-done + .ts03-bar .ts03-fill { transform: scaleX(1); }
// 데모 루프: 1 → 2 → 3 순서로 채워지는 걸 2초에 한 번
.ts03-steps.is-demo .ts03-step:nth-child(1) .ts03-circle { animation: ts03-done $duration $easing infinite; }
.ts03-steps.is-demo .ts03-bar:nth-child(2) .ts03-fill { animation: ts03-fill $duration $easing infinite; animation-delay: .3s; }
.ts03-steps.is-demo .ts03-step:nth-child(3) .ts03-circle { animation: ts03-done $duration $easing infinite; animation-delay: .9s; }
.ts03-steps.is-demo .ts03-bar:nth-child(4) .ts03-fill { animation: ts03-fill $duration $easing infinite; animation-delay: 1.2s; }
@keyframes ts03-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ts03-done { from { background: rgba(255, 255, 255, .18); } to { background: $subject-cream; } }
@media (prefers-reduced-motion: reduce) {
.ts03-fill, .ts03-steps.is-demo .ts03-fill { animation: none !important; transform: scaleX(1) !important; }
.ts03-steps.is-demo .ts03-circle { animation: none !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);
}
.ts03-steps {
display: flex;
align-items: flex-start;
width: min(320px, 88vw);
}
.ts03-step {
flex-grow: 0;
flex-shrink: 0;
flex-basis: auto;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
color: #17141a;
font: 600 11px/1 -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}
.ts03-circle {
width: 32px;
height: 32px;
border-radius: 50%;
display: grid;
place-items: center;
background: rgba(255, 255, 255, 0.18);
color: #17141a;
font-weight: 700;
font-size: 13px;
line-height: 1;
font-family: inherit;
}
.ts03-bar {
flex-grow: 1;
flex-shrink: 1;
flex-basis: 0;
height: 3px;
margin-top: 16px;
background: rgba(255, 255, 255, 0.22);
border-radius: 4px;
overflow: hidden;
display: block;
}
.ts03-fill {
display: block;
width: 100%;
height: 100%;
background: #17141a;
transform: scaleX(0);
transform-origin: left;
}
.ts03-step.is-done .ts03-circle {
background: #fff7e6;
color: #c93000;
}
.ts03-step.is-done + .ts03-bar .ts03-fill {
transform: scaleX(1);
}
.ts03-steps.is-demo .ts03-step:nth-child(1) .ts03-circle {
animation: ts03-done 300ms ease-out infinite;
}
.ts03-steps.is-demo .ts03-bar:nth-child(2) .ts03-fill {
animation: ts03-fill 300ms ease-out infinite;
animation-delay: 0.3s;
}
.ts03-steps.is-demo .ts03-step:nth-child(3) .ts03-circle {
animation: ts03-done 300ms ease-out infinite;
animation-delay: 0.9s;
}
.ts03-steps.is-demo .ts03-bar:nth-child(4) .ts03-fill {
animation: ts03-fill 300ms ease-out infinite;
animation-delay: 1.2s;
}
@keyframes ts03-fill {
from {
transform: scaleX(0);
}
to {
transform: scaleX(1);
}
}
@keyframes ts03-done {
from {
background: rgba(255, 255, 255, 0.18);
}
to {
background: #fff7e6;
}
}
@media (prefers-reduced-motion: reduce) {
.ts03-fill, .ts03-steps.is-demo .ts03-fill {
animation: none !important;
transform: scaleX(1) !important;
}
.ts03-steps.is-demo .ts03-circle {
animation: none !important;
}
}import { CSSProperties } from "react";
import styles from "./HorizontalStepsFill.module.scss";
type Vars = CSSProperties & {
"--duration"?: string;
"--easing"?: string;
"--color"?: string;
};
export interface HorizontalStepsFillProps {
duration?: string;
easing?: string;
color?: string;
labels?: string[];
doneCount?: number;
}
export default function HorizontalStepsFill({
duration = "600ms",
easing = "ease-out",
color = "#17141a",
labels = ["가입", "프로필", "완료"],
doneCount = 2,
}: HorizontalStepsFillProps) {
const style: Vars = { "--duration": duration, "--easing": easing, "--color": color };
return (
<div className={styles.steps} style={style}>
{labels.map((label, i) => (
<div key={label} style={{ display: "contents" }}>
<div className={styles.step}>
<span className={`${styles.circle} ${i < doneCount ? styles.done : ""}`}>{i + 1}</span>
<span>{label}</span>
</div>
{i < labels.length - 1 && (
<span className={styles.bar}>
<span className={`${styles.fill} ${i < doneCount - 1 ? styles.filled : ""}`} />
</span>
)}
</div>
))}
</div>
);
}03 가로 단계 채움 — 측정 누적면적 1.597% · 움직인 프레임 23/23GODRICH 원작 · zip 에 SCSS·React 포함 · 타임라인 CSS 애니메이션 9종 — 스테퍼까지 복붙
이 데모가 속한 글
타임라인 CSS 애니메이션 9종 — 스테퍼까지 복붙타임라인 CSS 애니메이션은 이벤트나 결제 같은 여러 단계를 선과 원으로 이어 순서대로 보여주는 장치입니다. AOS·GSAP 없이, JS 0줄로 아홉 가지를 모았고, 그중 셋은 스크롤 위치를 CSS가 직접 읽는 sc 이 글의 데모 전부 보기


