Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

@dioramajs/text/counter

Exports of @dioramajs/text/counter.

View as Markdown
On this page
import { blurOf, default, flips } from '@dioramajs/text/counter'

Functions

blurOfBlur of a drum that turns `speed` digits a frame: a fast one shows a sharp digit, not a streak.
flipsA flip card from digit `from` (-1 blank) to `to`, landing `time` seconds after it starts: the digits on its two faces and the angle of the falling flap at `t`, 0 at rest.
foldHow far a drum or card stands out of the page at `t`, 0 flat: it rises at the trigger and unrolls after it lands at `land`, flat before the text takes over, so the hand-off shows nothing.
format`value` written the way `w` is: its separators, grouping, decimals and leading zeros.
odometerThe odometer's value in units at `t` of `time` seconds: quartOut, then the last SETTLE units on a backOut whose slope matches it, so the drums slow down, overshoot and settle.
parseThe first number in `text`, read as written: `12,480`, `99.9`, `4,2` or `1.204.500` in German, `1 204 500`, `12,34,567`. A lone point or comma before exactly three digits groups them unless it is the decimal separator of `lang`. Undefined without digits or past 15 of them.
reelA slot reel from digit `from` to `to` landing `land` seconds after it starts: its position in digits at `t`, whole turns included. It spins up, runs, slows down and overshoots as it lands.
spanSeconds from the trigger until the number has landed and folded back into the text.
wheelsOdometer drums for `units` (the value in its smallest decimal): drum 0 turns with the value, each drum above turns only while the one below goes from 9 to 0. One more drum than `n`.

Constants

defaultA number counts up to its value when it comes into view, on real 3D mechanics: digits on odometer drums, on deep slot reels behind a window, or on flip cards. The drums and cards fold back into the text when they land: the DOM text never changes, and at rest it is the element.

Interfaces

WrittenA number as the text writes it: where it sits, its value, separators and grouping.