07없는 키가 화면에 그대로 노출
화면 카드에 welcome.title 원시 키가 노출되어 있다가, 폴백 문구가 아래에서 밀어 올라와 교체되고 다시 원시 키로 돌아오길 반복해 두 상태를 나란히 보여준다.
쓰임버튼 자리에 header.title 같은 영문이 그대로 보일 때, 폴백 언어 규칙을 정할 때
폴백 언어키 노출 검출@keyframes fb-in

<main class="stage is-demo">
<div class="win">
<header class="win__bar"><span class="win__dot"></span><span class="win__dot"></span><span class="win__dot"></span></header>
<div class="win__body">
<div class="slot">
<p class="slot__raw">welcome.title</p>
<p class="slot__fb">다시 오신 걸 환영합니다</p>
</div>
<span class="win__chip">폴백 적용</span>
</div>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
// ── 변수 3개 ──────────────────────────────────────────
$duration: $dur-loop; // 2s — 키 노출 ↔ 폴백 한 주기
$easing: $ease-out;
$color: $subject-cream; // 창 카드
@include stage($stage-orange);
.win {
width: min(330px, 92vw);
border-radius: $r-card;
background: $color;
box-shadow: $shadow-raised;
overflow: hidden;
}
.win__bar {
display: flex;
column-gap: $sp-1;
padding: $sp-2 $sp-3 0;
}
.win__dot {
width: 10px; height: 10px;
border-radius: 50%;
background: rgba($subject-ink, .18);
}
.win__body {
position: relative;
padding: $sp-3 $sp-4 $sp-5;
min-height: clamp(96px, 32vw, 150px);
display: grid;
place-items: center;
}
.slot {
position: relative;
width: 100%;
min-height: 64px;
}
.slot__raw, .slot__fb {
position: absolute;
inset: 0;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.slot__raw {
font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
font-size: clamp(13px, 3.4vw, 20px);
font-weight: 700;
color: $error;
border: 2px dashed rgba($error, .5);
border-radius: $r-control;
}
.slot__fb {
font-size: clamp(14px, 3.8vw, 22px);
font-weight: 800;
color: $subject-ink;
background: rgba($subject-blue, .14);
border-radius: $r-control;
transform: translateY(14px) scale(.94);
opacity: 0;
}
.win__chip {
position: absolute;
right: $sp-2;
bottom: $sp-2;
border-radius: $r-pill;
background: $subject-blue;
color: #fff;
font-size: clamp(9px, 2.2vw, 12px);
font-weight: 800;
padding: $sp-1 $sp-2;
opacity: 0;
}
// 원시 키가 빠지고, 그 자리에 폴백 문구가 뜬다 — 순서대로만 (겹침 없음)
.stage.is-demo .slot__raw { animation: raw-out $duration $easing infinite; }
.stage.is-demo .slot__fb { animation: fb-in $duration $ease-pop infinite; }
.stage.is-demo .win__chip { animation: chip-in $duration $ease-pop infinite; }
@keyframes raw-out {
0%, 20% { transform: translateY(0) scale(1); opacity: 1; }
28% { transform: translateY(-16px) scale(.94); opacity: 0; }
88% { transform: translateY(-16px) scale(.94); opacity: 0; }
96%, 100%{ transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes fb-in {
0%, 30% { transform: translateY(14px) scale(.9); opacity: 0; }
42% { transform: translateY(0) scale(1.04); opacity: 1; }
48%, 80% { transform: translateY(0) scale(1); opacity: 1; }
88%, 100%{ transform: translateY(14px) scale(.9); opacity: 0; }
}
@keyframes chip-in {
0%, 38% { transform: scale(0); opacity: 0; }
48% { transform: scale(1.18); opacity: 1; }
54%, 78% { transform: scale(1); opacity: 1; }
86%, 100%{ transform: scale(.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
.stage.is-demo .slot__raw,
.stage.is-demo .slot__fb,
.stage.is-demo .win__chip { animation: none; }
.slot__raw { transform: translateY(-16px); opacity: 0; }
.slot__fb { transform: translateY(0) scale(1); opacity: 1; }
.win__chip { opacity: 1; }
}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);
}
.win {
width: min(330px, 92vw);
border-radius: 16px;
background: #fff7e6;
box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
overflow: hidden;
}
.win__bar {
display: flex;
column-gap: 4px;
padding: 8px 12px 0;
}
.win__dot {
width: 10px;
height: 10px;
border-radius: 50%;
background: rgba(23, 20, 26, 0.18);
}
.win__body {
position: relative;
padding: 12px 16px 20px;
min-height: clamp(96px, 32vw, 150px);
display: grid;
place-items: center;
}
.slot {
position: relative;
width: 100%;
min-height: 64px;
}
.slot__raw, .slot__fb {
position: absolute;
inset: 0;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.slot__raw {
font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
font-size: clamp(13px, 3.4vw, 20px);
font-weight: 700;
color: #c2361a;
border: 2px dashed rgba(194, 54, 26, 0.5);
border-radius: 12px;
}
.slot__fb {
font-size: clamp(14px, 3.8vw, 22px);
font-weight: 800;
color: #17141a;
background: rgba(47, 109, 246, 0.14);
border-radius: 12px;
transform: translateY(14px) scale(0.94);
opacity: 0;
}
.win__chip {
position: absolute;
right: 8px;
bottom: 8px;
border-radius: 999px;
background: #2f6df6;
color: #fff;
font-size: clamp(9px, 2.2vw, 12px);
font-weight: 800;
padding: 4px 8px;
opacity: 0;
}
.stage.is-demo .slot__raw {
animation: raw-out 2s ease-out infinite;
}
.stage.is-demo .slot__fb {
animation: fb-in 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}
.stage.is-demo .win__chip {
animation: chip-in 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}
@keyframes raw-out {
0%, 20% {
transform: translateY(0) scale(1);
opacity: 1;
}
28% {
transform: translateY(-16px) scale(0.94);
opacity: 0;
}
88% {
transform: translateY(-16px) scale(0.94);
opacity: 0;
}
96%, 100% {
transform: translateY(0) scale(1);
opacity: 1;
}
}
@keyframes fb-in {
0%, 30% {
transform: translateY(14px) scale(0.9);
opacity: 0;
}
42% {
transform: translateY(0) scale(1.04);
opacity: 1;
}
48%, 80% {
transform: translateY(0) scale(1);
opacity: 1;
}
88%, 100% {
transform: translateY(14px) scale(0.9);
opacity: 0;
}
}
@keyframes chip-in {
0%, 38% {
transform: scale(0);
opacity: 0;
}
48% {
transform: scale(1.18);
opacity: 1;
}
54%, 78% {
transform: scale(1);
opacity: 1;
}
86%, 100% {
transform: scale(0.4);
opacity: 0;
}
}
@media (prefers-reduced-motion: reduce) {
.stage.is-demo .slot__raw,
.stage.is-demo .slot__fb,
.stage.is-demo .win__chip {
animation: none;
}
.slot__raw {
transform: translateY(-16px);
opacity: 0;
}
.slot__fb {
transform: translateY(0) scale(1);
opacity: 1;
}
.win__chip {
opacity: 1;
}
}import type { CSSProperties } from "react";
import styles from "./FallbackKeySwap.module.scss";
export type FallbackKeySwapProps = {
duration?: number;
easing?: string;
color?: string;
rawKey?: string;
fallback?: string;
chip?: string;
};
export default function FallbackKeySwap({
duration = 2000,
easing = "cubic-bezier(.2, 1.4, .4, 1)",
color = "#fff7e6",
rawKey = "welcome.title",
fallback = "다시 오신 걸 환영합니다",
chip = "폴백 적용",
}: FallbackKeySwapProps) {
const vars: CSSProperties = { "--duration": `${duration}ms`, "--easing": easing, "--color": color } as CSSProperties;
return (
<div className={styles.stage} style={vars} aria-label="폴백 처리 데모" role="img">
<div className={styles.win}>
<header className={styles.bar}>
<span className={styles.dot} />
<span className={styles.dot} />
<span className={styles.dot} />
</header>
<div className={styles.body}>
<div className={styles.slot}>
<p className={styles.raw}>{rawKey}</p>
<p className={styles.fb}>{fallback}</p>
</div>
<span className={styles.chip}>{chip}</span>
</div>
</div>
</div>
);
}07 없는 키가 화면에 그대로 노출 — 측정 누적면적 16.472% · 움직인 프레임 13/23GODRICH 원작 · zip 에 SCSS·React 포함 · 홈페이지 다국어 처리 검수 9가지 — 언어팩 키 누락·번역 누락 잡기
이 데모가 속한 글
홈페이지 다국어 처리 검수 9가지 — 언어팩 키 누락·번역 누락 잡기홈페이지 다국어 처리는 번역문을 언어팩 파일에 넣었다고 끝나지 않는다. 키가 한쪽에만 있으면 영어판 버튼이 빈 채로 남고, 자리표시자가 어긋나면 이름이 빠진 인사말이 나간다. 여기 아홉 가지 검사를 브라우저 콘솔에 이 글의 데모 전부 보기


