Skip to content

No.64 · Controls

Preset Keys

The station buttons on an old radio, as a radio group: press one and it latches down with a solid clack, the one that was down springs back up, and the needle sweeps across the lit dial to the station — the glow dimming while it travels and coming up warm once it's tuned.

The prompt

Written for the variant you picked above: Walnut

Build a radiogroup styled as a vintage radio's latching preset keys. Cabinet: a themed frame with a speaker grille (dot pattern), a dial behind glass, a lit display window and a well of keys. Dial: an FM scale 88–108 with half-MHz ticks, major ticks and numbers every 2MHz, small station marks with names, and a red needle positioned by the selected frequency; the needle slides with a 760ms ease that overshoots slightly (cubic-bezier(.45,0,.2,1.18)). A warm radial glow lights the scale from below; while the needle travels it dims to 35% (fast) and comes back (500ms) once tuned. Glass reflection over the top. The window shows the station name (or "· · ·" while tuning, aria-live polite) and the frequency in glowing mono digits. Keys: real buttons, role="radio" with aria-checked, roving tabindex, arrows/Home/End select and focus. Each cap has a front face, a 10px depth edge and a cast shadow; the checked key is latched down (translateY 8px, depth and shadow collapse, slightly darker, number turns red) and pressing goes down fast (90ms ease-in); a key released by another springs back up with overshoot (340ms cubic-bezier(.3,1.7,.5,1)). Reduced motion: no transitions. Selected variant — Walnut: theme="walnut": a walnut frame (layered fine stripes over a warm gradient), ivory key caps and an amber display window, on #e6dccb; five Muscat stations, Hala FM 102.7 selected.

Notes

Interaction
Click a key, or Tab to the group and use the arrow keys.
Motion
Latch 90ms down, 340ms spring up; needle 760ms with a slight overshoot; glow dims while tuning.
Accessibility
A labelled radiogroup with radio buttons, roving focus and arrow keys; station changes are announced politely in the display window.
Responsive
The cabinet is at most 560px wide and the keys share the width evenly down to phone sizes.
On touch
Tap a key; the pressed state shows under the finger.

Featured

301 components