forever components

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 motionpointer

Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited

Live demo — the real component, running in a sandbox. One self-contained HTML file, zero dependencies. Open it on the canvas →
Worth keeping? Votes steer what gets built next — sign in to cast one, free to read

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 from 24 to 12 to halve ratchet steps, set ACC to '#8B0000' for burgundy engraving, and slow auto-ratchet interval to 300 frames. Theme: dark tokens live in :root, the light variant in :root[data-theme="light"]; ?theme=light or a {type:'forever:theme'} postMessage switches at runtime.

Safe to edit

  • tooth count (TEETH=24)
  • spring friction (0.22 lerp factor)
  • accent color (ACC='#1a1a2e')
  • 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)

Known limitations

  • Pointer drag threshold (14px) may fire multiple ratchets per swipe on high-DPI trackpads
  • Auto-ratchet changes direction randomly — remove auto block for production use
  • Background color hardcoded in CSS (#f4ede0) — must edit to change theme

dialwatchknobcanvasratchetmechanicalpointer

More Inputs & Switches components

  • Liquid ToggleSVG toggle with a goo filter — the knob slides with trailing liquid droplets; track color fades between off and on states.
  • Glow SliderSVG range slider with a plum-to-teal gradient fill, glowing knob, and a floating value bubble that tracks the handle; auto-oscillates when idle.
  • Spring StepperMint-themed +/- stepper with a number reel that springs and overshoots between digits 0–9; auto-cycles as a demo. Dark green palette.
  • Segmented ControlSlate-to-sage gradient pill slides between Day/Week/Month/Year segments with elastic spring stretch. Auto-cycles; click pauses briefly.
  • Checkbox MorphThree amber rounded checkboxes auto-cycle and respond to clicks; the box fills and a checkmark strokes in via animated dashoffset.
  • Star RatingFive gold stars auto-sweep ratings up and down; the active star pops with a scale bounce. Pointer sets the hover rating instantly.