Back to the library
Flap gate change, cascade
Variant: Cascade
The single-beat roll again, with each cell starting 60ms after the one to its left, so the new value sweeps across the code in reading order. Use it when the value is a string people read left to right and you want the change to point the eye at its start. Each roll still lasts about 190ms and the whole sweep is done within about 310ms, so the stagger shows direction without making the panel feel slow.
statussplit-flapstate-changestaggervalue-roll
The source
A complete HTML document. Paste it into an empty .html file and it plays — no stylesheet, script, font, or image to fetch.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Flap gate change — cascade</title>
<style>
:root {
/* Neutrals — fixed, never remixed. */
--ivory: #faf9f5;
--paper: #ffffff;
--oat: #e3dacc;
--slate: #141413;
/* Knobs — the remix API. A knob exists iff declared here and used below. */
--hue: 38.8;
--lift: 0;
--chroma: 1;
--round: 1; /* include ONLY if at least one border-radius is wrapped below */
--speed: 1;
/* Accents — derived from the knobs with the family's offsets baked in,
so one hue roll moves them together. Defaults reproduce the original hex
(#d97757 / #b85c3e / #788c5d / #b04a3f). */
--clay: oklch(calc(0.6724 + var(--lift)) calc(0.1308 * var(--chroma)) var(--hue));
--clay-d: oklch(calc(0.5797 + var(--lift)) calc(0.127 * var(--chroma)) var(--hue));
--olive: oklch(calc(0.6118 + var(--lift)) calc(0.0713 * var(--chroma)) calc(var(--hue) + 88.3));
--rust: oklch(calc(0.5408 + var(--lift)) calc(0.1357 * var(--chroma)) calc(var(--hue) - 10.3));
/* Clock — every duration in the document runs off --t. */
--cycle: 3.2s; /* the authored master loop */
--t: calc(var(--cycle) / var(--speed));
--ease-in-out: cubic-bezier(0.77, 0, 0.175, 1); /* include only if used */
--_cell: color-mix(in oklch, var(--slate) 88%, var(--paper));
--_seam: color-mix(in oklch, var(--slate) 70%, transparent);
--_stagger: calc(60ms / var(--speed));
}
* { box-sizing: border-box; }
body {
margin: 0;
min-height: 100vh;
display: grid;
place-items: center;
background: var(--ivory);
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.board {
width: min(420px, 92vw);
padding: clamp(14px, 4vw, 24px);
background: var(--slate);
border-radius: calc(14px * var(--round));
display: grid;
gap: clamp(8px, 2.4vw, 14px);
}
.label {
color: var(--oat);
font-size: clamp(12px, 3.2vw, 14px);
font-weight: 600;
letter-spacing: 0.22em;
text-transform: uppercase;
}
.cells {
display: flex;
justify-content: center;
gap: clamp(6px, 2vw, 10px);
}
.cell {
--_i: 0;
position: relative;
overflow: hidden;
width: 0.86em;
height: 1.2em;
font-size: clamp(44px, 15vw, 88px);
line-height: 1.2em;
background: var(--_cell);
border-radius: calc(8px * var(--round));
}
.cell:nth-child(2) { --_i: 1; }
.cell:nth-child(3) { --_i: 2; }
.cell::after {
content: "";
position: absolute;
left: 0;
right: 0;
top: 50%;
height: 1px;
background: var(--_seam);
}
/* Delay shifts the whole loop per cell, so the roll-back cascades left to
right too, and every cell keeps the same 3.2s period. */
.col {
display: flex;
flex-direction: column;
will-change: transform;
animation: roll var(--t) var(--ease-in-out) infinite both;
animation-delay: calc(var(--_i) * var(--_stagger));
}
.col b {
display: block;
height: 1.2em;
text-align: center;
font-weight: 700;
color: var(--ivory);
font-variant-numeric: tabular-nums;
}
.col b.new { color: var(--clay); }
@keyframes roll {
0%, 22% { transform: translateY(0); }
28%, 72% { transform: translateY(-33.3333%); }
78%, 100% { transform: translateY(-66.6667%); }
}
@keyframes roll-calm {
0%, 17% { transform: translateY(0); opacity: 1; }
24.9% { transform: translateY(0); opacity: 0.25; }
25% { transform: translateY(-33.3333%); opacity: 0.25; }
33%, 67% { transform: translateY(-33.3333%); opacity: 1; }
74.9% { transform: translateY(-33.3333%); opacity: 0.25; }
75% { transform: translateY(-66.6667%); opacity: 0.25; }
83%, 100% { transform: translateY(-66.6667%); opacity: 1; }
}
@media (max-width: 380px) {
.board { padding: 14px; gap: 8px; }
}
/* No travel: each value dims, swaps while dim, and brightens. Slowed 2x,
with the stagger doubled to match so the left-to-right order survives. */
@media (prefers-reduced-motion: reduce) {
.col {
animation: roll-calm calc(var(--t) * 2) ease infinite both;
animation-delay: calc(var(--_i) * var(--_stagger) * 2);
}
}
</style>
</head>
<body>
<div class="board" role="img" aria-label="Gate changes from B12 to D07">
<div class="label">Gate</div>
<div class="cells">
<span class="cell"><span class="col"><b>B</b><b class="new">D</b><b>B</b></span></span>
<span class="cell"><span class="col"><b>1</b><b class="new">0</b><b>1</b></span></span>
<span class="cell"><span class="col"><b>2</b><b class="new">7</b><b>2</b></span></span>
</div>
</div>
</body>
</html>
The variant family
Same idea, one axis moved. Compare them side by side before you commit.