Barrel roll counter

Every digit column is a drum of ten numerals. Underneath, each column is a grid of invisible slots, and the slot a numeral sits in is just its distance from the current digit. Each visible numeral is data-⚓️-fill on its slot with data-⚓️-transition="glide", so when the number changes the slots reflow instantly and the numerals glide, roll and fade into their new places, up and down or left and right. Add a digit and the whole row reflows: the commas, the numerals and the backing lens (anchored to the row) all glide to the new layout. The script only writes the number and each slot's offset.

Roll direction