03숫자가 거대한 카드
카드마다 박힌 초대형 숫자가 화면에 들어오면 0에서 실제 값까지 자릿수 그대로 굴러 올라간다.
쓰임통계 강조 카드, 실적 요약 섹션
@property 숫자 보간counter-resettabular-nums

<main class="stage">
<div class="card is-demo">
<span class="card__num" aria-hidden="true"></span>
<span class="card__sr">프로젝트 248개</span>
<span class="card__label">프로젝트</span>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
$duration: $dur-loop; // 0에서 목표까지 세는 시간
$easing: $ease-out;
$color: $subject-cream; // 숫자 색
@include stage($stage-orange);
// @property: 정수 커스텀 속성이라야 애니메이션 중간값도 정수로 보간된다
@property --num {
syntax: '<integer>';
initial-value: 0;
inherits: false;
}
.card {
text-align: center;
padding: $sp-6 $sp-8;
border-radius: $r-card;
background: rgba($subject-cream, .08);
border: 1px solid rgba($subject-cream, .18);
&__num {
--num: 0;
counter-reset: num var(--num);
display: block;
font-weight: 800;
font-size: clamp(40px, 13vw, 72px);
line-height: 1;
font-variant-numeric: tabular-nums;
color: $color;
&::before { content: counter(num); }
}
// counter() 생성 콘텐츠는 스크린 리더가 못 읽는다 — 실제 최종값을 시각적으로만 숨겨 따로 둔다
&__sr {
position: absolute;
width: 1px; height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
&__label {
display: block;
margin-top: $sp-2;
font-weight: 600;
font-size: clamp(12px, 3vw, 15px);
line-height: 1;
color: $subject-ink; // 주황 면 위 글자 — AA 4.5 (blog-design 글자 대비)
}
}
.card.is-demo .card__num {
animation: count-up $duration $easing infinite;
}
@keyframes count-up {
0% { --num: 0; }
65% { --num: 248; }
100% { --num: 248; }
}
@media (prefers-reduced-motion: reduce) {
.card.is-demo .card__num { animation: none; --num: 248; }
}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);
}
@property --num {
syntax: "<integer>";
initial-value: 0;
inherits: false;
}
.card {
text-align: center;
padding: 24px 32px;
border-radius: 16px;
background: rgba(255, 247, 230, 0.08);
border: 1px solid rgba(255, 247, 230, 0.18);
}
.card__num {
--num: 0;
counter-reset: num var(--num);
display: block;
font-weight: 800;
font-size: clamp(40px, 13vw, 72px);
line-height: 1;
font-variant-numeric: tabular-nums;
color: #fff7e6;
}
.card__num::before {
content: counter(num);
}
.card__sr {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.card__label {
display: block;
margin-top: 8px;
font-weight: 600;
font-size: clamp(12px, 3vw, 15px);
line-height: 1;
color: #17141a;
}
.card.is-demo .card__num {
animation: count-up 2s ease-out infinite;
}
@keyframes count-up {
0% {
--num: 0;
}
65% {
--num: 248;
}
100% {
--num: 248;
}
}
@media (prefers-reduced-motion: reduce) {
.card.is-demo .card__num {
animation: none;
--num: 248;
}
}import type { CSSProperties } from "react";
import styles from "./KineticCardGrid.module.scss";
export type KineticCardGridProps = {
value?: number;
label?: string;
/** 0에서 목표까지 세는 시간(기본 2000ms) */
duration?: number;
easing?: string;
color?: string;
};
type Vars = CSSProperties & { "--duration"?: string; "--easing"?: string; "--color"?: string; "--num-target"?: number };
export default function KineticCardGrid({
value = 248,
label = "Projects",
duration = 2000,
easing = "ease-out",
color = "#fff7e6",
}: KineticCardGridProps) {
const vars: Vars = { "--duration": `${duration}ms`, "--easing": easing, "--color": color, "--num-target": value };
return (
<div className={styles.stage} style={vars}>
<div className={styles.card}>
<span className={styles.num} aria-hidden="true" />
<span className={styles.sr}>{value} {label.toLowerCase()}</span>
<span className={styles.label}>{label}</span>
</div>
</div>
);
}03 숫자가 거대한 카드 — 측정 누적면적 9.127% · 움직인 프레임 16/23GODRICH 원작 · zip 에 SCSS·React 포함 · 키네틱 타이포그래피 랜딩페이지, 코드로 뜯어봤다
이 데모가 속한 글
키네틱 타이포그래피 랜딩페이지, 코드로 뜯어봤다키네틱 타이포그래피는 헤드라인 글자가 화면 폭에 맞춰 커지고, 단어가 순서대로 튀어 오르고, 숫자가 굴러가듯 올라가는 디자인 방식입니다. 요즘 랜딩페이지 첫 화면을 다 이렇게 만들길래, 실제로 코드까지 뜯어서 아홉 이 글의 데모 전부 보기


