Live numbers

Prices that keep changing, in columns that stay put.

Simulated live feed
Fictional assets, simulated prices and percentage changes
AssetSymbolPriceChange

Equal-width digits keep the columns steady.

Fictional assets and simulated data.

Key CSS & implementation tricks

.number { display: inline-flex; font-variant-numeric: tabular-nums lining-nums; }
[data-tabular=false] .number { font-variant-numeric: proportional-nums lining-nums; }
th:nth-child(n+3), td:nth-child(n+3) { text-align: right; }

[...value].forEach((char, index) => {
  // compare from the right so the decimal places line up
  const oldChar = previous[previous.length - value.length + index];
  if (motion && oldChar !== char && /\d/.test(char) && /\d/.test(oldChar)) {
    next.animate([{ transform: `translateY(${dir * 100}%)`, opacity: 0 }, { transform: 'none', opacity: 1 }], timing);
    old.animate([{ transform: 'none', opacity: 1 }, { transform: `translateY(${-dir * 100}%)`, opacity: 0 }], timing);
  }
});

.digit { display: inline-grid; position: relative; overflow: hidden; }
.digit > span { grid-area: 1 / 1; }   /* old and new share one cell */

// model.js: every 2–4 ticks, offset per row
export function tradeIndex(i, tick) {
  const every = 2 + (i * 5) % 3;
  return Math.floor((tick + i * 3) / every);
}
const k = tradeIndex(i, tick);    // unchanged k → identical price → no roll
const wobble = Math.sin(k * 1.37 + i) * .0009 + Math.sin(k * .53 + i * 2.1) * .0006;

function setNumber(cell, value, motion) {
  active.get(cell)?.();           // finish any roll still in flight
  …
}
const canAnimate = () => animateBox.checked && !reduced.matches && params.get('still') !== '1';
document.addEventListener('visibilitychange', () => { if (document.hidden) active.forEach(f => f()); schedule(); });