Settle — earned digits
Variant: Earned digits
An approximate count that only shows the digits it has earned. It opens as 4,8 followed by placeholder dots — every slot fixed-width and already owned, so the magnitude is legible from the first frame and nothing reflows as precision arrives. Each scan batch moves the rail first; 288ms later the digits it paid for lock in left to right, in significance order, each rising through 2px of blur on a 260ms cubic ease-out while its dot leaves faster, so the digit fills a gap rather than replacing anything. The error bound confirms each tightening only after its digits have landed, and at the end the approximation sign and the bound give way to "Exact". The figure is right-aligned like a table column, so the vanished sign leaves no indent. It is the opposite of a number ticker: nothing rolls, because a digit that has not been earned should not be shown changing. Use it for sampled queries, progressive aggregates and any estimate that refines.
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>Settle — earned digits</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;
--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. */
--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)
);
--_muted: color-mix(in srgb, var(--slate) 52%, transparent);
--_ghost: color-mix(in srgb, var(--slate) 26%, transparent);
/* Clock — 7.2s: one registered number, --_now, runs 0→100 across it
(1 unit is 72ms). Three scan batches land at 18/42/64 and the digits
they pay for lock 4 units (288ms) after each; the error bound confirms
4 units after that — scan, digits, label: cause, then effect. */
--cycle: 7.2s;
--t: calc(var(--cycle) / var(--speed));
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
/* The rise a digit locks in from; reduced motion zeroes it. */
--_rise: 0.28em;
}
/* Without @property (Safari < 16.4, Firefox < 128) --_now cannot tween
and flips once at mid-loop: the card still reads, it just cuts. */
@property --_now {
syntax: '<number>';
inherits: true;
initial-value: 0;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
min-height: 100vh;
display: grid;
place-items: center;
background: var(--ivory);
font-family:
system-ui,
-apple-system,
'Segoe UI',
Roboto,
sans-serif;
color: var(--slate);
}
.card {
width: min(288px, calc(100vw - 40px));
padding: 16px 18px 15px;
display: grid;
gap: 10px;
border-radius: calc(12px * var(--round));
background: var(--paper);
border: 1px solid var(--oat);
animation:
tick var(--t) linear infinite,
frame var(--t) linear infinite;
}
.label {
font-size: 11px;
font-weight: 600;
letter-spacing: 0.14em;
text-transform: uppercase;
color: var(--_muted);
}
/* Fixed-width cells: a digit that has not been earned still owns its
slot, so the number's magnitude is legible from the first frame and
nothing reflows as precision arrives. Right-aligned, the way figures
sit in a table: when the ≈ goes, the space it leaves is outside the
number, not an indent inside it. */
.num {
display: flex;
justify-content: flex-end;
align-items: baseline;
font-size: clamp(30px, 10vw, 38px);
font-weight: 600;
letter-spacing: -0.02em;
line-height: 1.1;
font-variant-numeric: tabular-nums;
}
.approx {
width: 0.72em;
color: var(--_muted);
font-weight: 500;
opacity: calc(1 - clamp(0, (var(--_now) - 72) / 3, 1));
}
/* A separator is only as certain as the digit before it: inked at
26% (the placeholder's weight) until that digit lands. */
.sep {
color: var(--slate);
opacity: calc(0.26 + 0.74 * clamp(0, (var(--_now) - var(--_at)) / 2, 1));
}
.d {
position: relative;
display: inline-grid;
place-items: center;
width: 0.62em;
}
/* Each digit derives its own ease-out from the shared clock: q runs
1→0 over 3.6 units (260ms) after it is earned, and the rise is q³. */
.d b {
font-weight: inherit;
--_q: clamp(0, 1 - (var(--_now) - var(--_at)) / 3.6, 1);
opacity: calc(1 - var(--_q) * var(--_q));
filter: blur(calc(var(--_q) * 2px));
transform: translateY(calc(var(--_q) * var(--_q) * var(--_q) * var(--_rise)));
}
/* The placeholder leaves first and fast (108ms), so for a beat the
slot is empty — the digit replaces nothing, it fills a gap. */
.d::after {
content: '';
position: absolute;
left: 50%;
top: 58%;
width: 0.14em;
height: 0.14em;
margin: -0.07em 0 0 -0.07em;
border-radius: 50%;
background: var(--_ghost);
opacity: calc(1 - clamp(0, (var(--_now) - var(--_at) + 0.5) / 1.5, 1));
}
.err {
display: grid;
font-size: 12px;
font-variant-numeric: tabular-nums;
justify-items: end;
color: var(--_muted);
margin-top: -4px;
}
.err > span {
grid-area: 1 / 1;
opacity: calc(
clamp(0, (var(--_now) - var(--_a)) / 2, 1) *
(1 - clamp(0, (var(--_now) - var(--_b)) / 2, 1))
);
}
.err .done {
color: var(--clay-d);
font-weight: 600;
}
.scan {
display: grid;
gap: 6px;
border-top: 1px solid var(--oat);
padding-top: 10px;
font-size: 11px;
color: var(--_muted);
}
.rail {
height: 4px;
border-radius: 999px;
background: var(--oat);
overflow: hidden;
}
/* Three reported jumps, each a cubic ease-out over 320ms, summed. The
rail moves first; the digits it buys lock in 288ms later. */
.fill {
height: 100%;
background: var(--clay);
transform-origin: left center;
--_s1: clamp(0, 1 - (var(--_now) - 18) / 4.4, 1);
--_s2: clamp(0, 1 - (var(--_now) - 42) / 4.4, 1);
--_s3: clamp(0, 1 - (var(--_now) - 64) / 4.4, 1);
transform: scaleX(
calc(
0.06 + 0.21 * (1 - var(--_s1) * var(--_s1) * var(--_s1)) + 0.31 *
(1 - var(--_s2) * var(--_s2) * var(--_s2)) + 0.42 *
(1 - var(--_s3) * var(--_s3) * var(--_s3))
)
);
}
@keyframes tick {
from {
--_now: 0;
}
to {
--_now: 100;
}
}
/* --_now wraps inside the dark window, so every digit re-hides off screen. */
@keyframes frame {
0% {
opacity: 0;
animation-timing-function: var(--ease-out);
}
3%,
92% {
opacity: 1;
animation-timing-function: var(--ease-out);
}
97%,
100% {
opacity: 0;
}
}
@media (prefers-reduced-motion: reduce) {
/* Digits arrive by opacity alone — no rise, no blur — on a 1.6x clock. */
:root {
--_rise: 0em;
}
.d b {
filter: none;
}
.card {
animation-duration: calc(var(--t) * 1.6);
}
}
</style>
</head>
<body>
<div
class="card"
role="img"
aria-label="An approximate row count that shows only the digits it has earned: it starts as 4,8 followed by placeholder dots, and as three scan batches complete the remaining digits lock in left to right until the exact count 4,817,302 stands and the approximation sign disappears"
>
<span class="label">Rows matched</span>
<div class="num">
<span class="approx">≈</span>
<span class="d" style="--_at: -10"><b>4</b></span
><span class="sep" style="--_at: -10">,</span
><span class="d" style="--_at: -10"><b>8</b></span
><span class="d" style="--_at: 22"><b>1</b></span
><span class="d" style="--_at: 22.6"><b>7</b></span
><span class="sep" style="--_at: 22.6">,</span
><span class="d" style="--_at: 46"><b>3</b></span
><span class="d" style="--_at: 68"><b>0</b></span
><span class="d" style="--_at: 68.6"><b>2</b></span>
</div>
<div class="err">
<span style="--_a: -10; --_b: 26">± 60,000 at 95%</span>
<span style="--_a: 26; --_b: 50">± 600 at 95%</span>
<span style="--_a: 50; --_b: 72">± 40 at 95%</span>
<span class="done" style="--_a: 72; --_b: 999">Exact</span>
</div>
<div class="scan">
<span>Partitions scanned</span>
<div class="rail"><div class="fill"></div></div>
</div>
</div>
</body>
</html>
The variant family
Same idea, one axis moved. Compare them side by side before you commit.