No.17 · Buttons
Chromatic Button
A terminal-style button that glitches on purpose: the label splits into red and cyan, slices jump sideways, a scanline sweeps down — then it settles.
The prompt
The design brief behind this component — reuse it to regenerate, remix, or explain it.
Build a terminal-style button that glitches once on hover. A black face with a faint green border, mono uppercase label with wide tracking, and a permanent fine scanline texture (repeating 1px lines at 3.5%). The label has two pseudo-element copies (content: attr(data-text)) in red (#ff2a6d) and cyan (#05d9e8), screen-blended: on hover or focus they appear 1.5px either side of the label, a steady chromatic split. On entering, the label plays a 420ms stepped glitch — horizontal slices of it (clip-path inset bands) jump left and right a few pixels for a few frames — while the red copy slips further and settles, and a soft green scanline band sweeps down the face once. The border brightens and a green glow appears while you stay; the glitch replays on each entry (two identical keyframes alternate). Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Hover or focus to trigger the glitch; press to click. Motion: Glitch 420ms stepped; split settles over 420ms; scanline sweep 700ms; border glow 200ms. Accessibility: The button's accessible name is its label (the visual copies are aria-hidden pseudo-elements). Reduced motion keeps the colour split but removes the glitch and sweep. Responsive behavior: Sized by its label; works at any width. Touch: Taps work normally; pointer-only effects are skipped on touch. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.
Notes
- Interaction
- Hover or focus to trigger the glitch; press to click.
- Motion
- Glitch 420ms stepped; split settles over 420ms; scanline sweep 700ms; border glow 200ms.
- Accessibility
- The button's accessible name is its label (the visual copies are aria-hidden pseudo-elements). Reduced motion keeps the colour split but removes the glitch and sweep.
- Responsive
- Sized by its label; works at any width.
- On touch
- Taps work normally; pointer-only effects are skipped on touch.