No.14 · Buttons
Glass Slab Button
A button made like a thick glass tile: its bevel's bright line turns to face the pointer, a soft beam slides through the glass, and pressing sinks the slab.
The prompt
Written for the variant you picked above: Violet
Build a button that looks like a thick tile of dark glass (60px tall, 16px radius): a near-black face with a faint glow of the glow colour from the top, a top inner highlight, a dark inner shadow at the bottom and a coloured drop glow. The bevel is a 1.5px ring made with a pseudo-element masked to its border (content-box exclude); its fill is a conic gradient bright in the glow colour (whitening at the peak) over about 60°, transparent elsewhere, rotated by a registered --a angle that points at the pointer (atan2 from the button's centre, converted to conic's zero at top), transitioning over 380ms — so the lit edge swings round to face you, the way light catches the bevel of real glass. On hover a soft diagonal beam (blurred 105° band in the glow colour) appears inside the glass and slides with the pointer's x. The label has a faint glow. Pressing sinks the slab 1px with a deeper inset shadow. Glow colour is a prop. Selected variant — Violet: glow="#c25cff": neon violet bevel, beam and drop glow on a violet-black page (#07040e).
Notes
- Interaction
- Move across it and the lit edge turns to face the pointer while a beam slides through; press to sink it.
- Motion
- Rim angle 380ms (registered @property); beam 200–300ms; press 140ms.
- Accessibility
- A real button; keyboard focus lights the full rim and shows a ring in the glow colour. Reduced motion removes the transitions.
- Responsive
- Sized by its label; works at any width.
- On touch
- Taps work normally; pointer-only effects are skipped on touch.