Rolling number row
Four big serif figures that roll down into place digit by digit, each with a coloured dot and a plain label.
Part of the style
Rainbow Slot Ticker
6 parts that belong together, with their tokens, type and rules.
https://kitbash.me/components/rainbow-slot-ticker/odometer-stats/figma.html
Use the Figma MCP server (https://mcp.figma.com/mcp). Download https://kitbash.me/components/rainbow-slot-ticker/odometer-stats/figma.html and pass that whole HTML document to the html_to_figma tool, so the part "Rolling number row" lands as editable layers in my open Figma file. Fonts come from Google Fonts: if a face is missing in Figma, pick the closest one.
Code
<section class="odometer-stats" aria-labelledby="odometer-stats-title">
<h2 class="odometer-stats__title" id="odometer-stats-title">Since the first market day</h2>
<dl class="odometer-stats__row">
<div class="odometer-stats__item">
<dt class="odometer-stats__label">Jars labelled</dt>
<dd class="odometer-stats__figure">48210</dd>
</div>
<div class="odometer-stats__item">
<dt class="odometer-stats__label">Stalls opened</dt>
<dd class="odometer-stats__figure">137</dd>
</div>
<div class="odometer-stats__item">
<dt class="odometer-stats__label">Menus rewritten</dt>
<dd class="odometer-stats__figure">612</dd>
</div>
<div class="odometer-stats__item">
<dt class="odometer-stats__label">Lucky spins</dt>
<dd class="odometer-stats__figure">9</dd>
</div>
</dl>
</section>
<style>
.odometer-stats {
padding: var(--space-l) var(--edge) var(--section-space);
}
.odometer-stats__title {
margin: 0 0 var(--space-m);
color: var(--ink-soft);
font-size: var(--text-m);
font-weight: 400;
}
.odometer-stats__row {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: var(--gap);
margin: 0;
}
.odometer-stats__item {
display: flex;
flex-direction: column-reverse;
justify-content: flex-end;
gap: var(--space-s);
padding: var(--space-l) var(--space-m) var(--space-m);
border-radius: var(--radius-l);
background: var(--tray);
}
.odometer-stats__item:nth-child(6n + 1) { --word: var(--red); }
.odometer-stats__item:nth-child(6n + 2) { --word: var(--green); }
.odometer-stats__item:nth-child(6n + 3) { --word: var(--blue); }
.odometer-stats__item:nth-child(6n + 4) { --word: var(--amber); }
.odometer-stats__label {
display: flex;
align-items: center;
gap: var(--space-s);
}
.odometer-stats__label::before {
content: "";
width: 8px;
height: 8px;
border-radius: var(--radius-pill);
background: var(--word);
}
.odometer-stats__figure {
display: flex;
height: 1.15em;
margin: 0;
overflow: hidden;
font-family: var(--font-serif);
font-size: var(--display);
line-height: 1.15;
font-variant-numeric: tabular-nums;
}
.odometer-stats__column {
display: flex;
flex-direction: column;
transform: translateY(0);
transition: transform var(--settle) var(--ease-settle);
transition-delay: calc(var(--order, 0) * 120ms);
}
.odometer-stats.is-seen .odometer-stats__column {
transform: translateY(calc(var(--digit, 0) * -1.15em));
}
@media (max-width: 760px) {
.odometer-stats__row {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (prefers-reduced-motion: reduce) {
.odometer-stats__column {
transition: none;
}
}
</style>
<script>
(() => {
const seen = new IntersectionObserver((entries) => {
for (const entry of entries) {
if (!entry.isIntersecting) continue;
requestAnimationFrame(() => entry.target.classList.add('is-seen'));
seen.unobserve(entry.target);
}
}, { threshold: 0.2 });
for (const root of document.querySelectorAll('.odometer-stats')) {
for (const figure of root.querySelectorAll('.odometer-stats__figure')) {
const value = figure.textContent.trim();
figure.setAttribute('aria-label', value);
figure.textContent = '';
[...value].forEach((char, order) => {
const column = document.createElement('span');
column.className = 'odometer-stats__column';
column.setAttribute('aria-hidden', 'true');
column.style.setProperty('--order', order);
column.style.setProperty('--digit', /\d/.test(char) ? char : 0);
const steps = /\d/.test(char) ? '0123456789' : char;
for (const step of steps) {
const digit = document.createElement('span');
digit.textContent = step;
column.append(digit);
}
figure.append(column);
});
}
seen.observe(root);
}
})();
</script>