Digit Count
Rasuke has no Odometer / jQuery counter. Number ticks are a GSAP module, src/assets/js/digit-count.js, used by the stats / facts sections (for example number-1 on About and fact-1 on Home 3, fed by number1.json / fact1.json).
How it works
- The module finds
.digit-countelements and splits the target number into individual digits. - Each digit rolls from
digit − offsetup to the final digit (default offset 2 — e.g.84→8rolls 6→8,4rolls 2→4). - Columns alternate direction: the 1st rolls bottom→top, the 2nd top→bottom, and so on.
- The roll starts when the element enters the viewport (
IntersectionObserver), with duration / stagger read from the CSS tokens--motion-duration-digit-count(1800ms) and--motion-duration-digit-count-stagger(120ms) so SCSS and JS can never drift apart. - If
prefers-reduced-motion: reduceis on, the final number is written immediately with no animation.
Markup
<span class="digit-count">84</span>
Put the final value as the element's text (sections usually render it from their JSON data). That text is both the no-JS fallback and the value the module animates to.
Do not
- Do not add Odometer or jQuery just to drive counters.
- Do not style counters with leftover utility classes — use the section's BEM class and tokens.