Notes • 3 min read
An infinite ruler
A small interaction study in modular arithmetic — a measuring tape that never runs out of road, and never lets you feel the seam.
Drag, or focus it and use the arrow keys.
Drag interactions feel good when they feel direct — the thing under your finger moves with your finger, not after it. A ruler that loops is a nice small test of that: it has to keep following the pointer 1:1 forever, in either direction, without ever admitting that it is quietly recycling the same hundred and one ticks behind the scenes.
The trick is keeping two numbers instead of one. A continuous position tracks the drag itself and is allowed to grow without limit — that is what the ruler physically moves by. A separate, normalized value wraps that position into 0 through 100 for display. Collapse the two into one number and the strip has to snap the moment it crosses the seam. Keep them apart and the seam never has to be visible, because the ruler is never actually reset, only re-read.
None of that machinery is meant to be noticed. The measure of a good one is that it disappears — you just feel a tape that goes on forever in both directions, which is the whole point of restraint applied to motion instead of layout.