Inputs & Switches
Crown Dial
Cream drum dial with engraved tick bars scrolling as it rotates; a milled crown wheel ratchets on drag or click. Numeric readout below.
canvasmedium complexitymoderate motionpointermobile-ready
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
1
When to use it
Precision numeric inputs with a tactile, mechanical aesthetic. Retro instrument panels, settings UIs, watch-themed interfaces.
When not to
Touch-only mobile where drag conflicts with scroll. Fast data-entry forms where keyboard input is expected.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change TEETH=24 and the ratchet STEP together, adjust --cd-acc and --cd-bg for the cream watch palette, or tune spring interpolation .22. Auto-ratchets run only while demoEnabled; first input disables them permanently. Preserve pointer and arrow-key input plus the forever:theme message hook.
Safe to edit
- tooth count (TEETH=24)
- spring friction (0.22 lerp factor)
- accent and paper tokens (--cd-acc, --cd-bg)
- drum size (R*0.30)
- auto-ratchet interval (140+random*120)
- crown knurling count (KN=18)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- IIFE wrapper
- prefers-reduced-motion guard and static fallback
- visibilitychange stop/start
- DPR-aware canvas sizing
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
- demo-v1 preview lifecycle: initialize demoEnabled from window.__foreverPreview and stop attract work on the window forever:interactive event; retain manual feedback, settling, cleanup and explicit sessions
Known limitations
- Pointer drag threshold (14px) may fire multiple ratchets per swipe on high-DPI trackpads
- Ratchet state is local and resets on reload; pointer and arrow-key input remain active after takeover.
- State remains local to each mounted instance; format/theme remount preserves takeover, not component values.
More Inputs & Switches components
- Liquid ToggleSVG liquid toggle with a goo filter, trailing droplets and a native button. First deliberate input stops the idle demo; the chosen on/off state settles fully.
- Glow SliderSVG range slider with a muted plum-to-teal fill, glow and value bubble, driven by a native range input. First input stops demo oscillation; drag and…
- Spring StepperMint stepper with native minus/plus buttons and a number reel that settles with spring feedback. First deliberate input stops automatic steps; the chosen…
- Segmented ControlSlate-to-sage pill slides between four native segment buttons with elastic spring stretch. First input stops automatic cycling; committed selection remains.
- Checkbox MorphThree native amber checkbox buttons animate their check strokes and expose pressed state. First input stops the demo; checked values remain.
- Star RatingFive gold SVG star radio controls commit ratings on click or keyboard input and settle with a scale bounce. First input stops automatic sweeping.