07Raw keys leaking to the screen
A screen card shows the raw key welcome.title, then a fallback phrase pushes up from below to replace it before the raw key returns, looping the two states side by side.
Best forWhen a button slot literally shows header.title, or when deciding the fallback-language rule
폴백 언어키 노출 검출@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">Welcome back</p>
</div>
<span class="win__chip">fallback shown</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 Raw keys leaking to the screen — Measured area 16.472% · moving frames 13/23Original by GODRICH · SCSS and React ship in the zip · i18n JSON Checks: 9 Ways to Catch Missing Keys
The post this demo lives in
i18n JSON Checks: 9 Ways to Catch Missing Keysi18n JSON files break quietly: a key missing from en.json leaves a button empty, and a stray {name} placeholder ships wi See all demos in this post
If you like this effect - similar demos
base08 Fallback side-by-side — two panes take the same radius value, the native result beside a border-radius approximationCSS corner-shape: 9 Corner Cutting Patterns
Landing sections01 Key-metric counter row9 Landing Page Sections That Build Trust
Dashboard UI03 Scroll that follows the cursorCommand Palette UI Design — 9 That Really Open