No.13 · Buttons
Ring Flood Button
A gradient loops slowly around the border; on hover the dark face draws in from every side and the gradient floods the whole button.
The prompt
Written for the variant you picked above: Night
Build a primary pill button whose border is a conic gradient (frost, lilac, amber, mint) turning slowly around it: register --angle with @property and animate it 0 → 360deg over 8s, linear, forever. The button's own background is the gradient; a ::before 'face' in the page colour sits inset by 1.5px, so only a ring shows. A blurred copy of the gradient under the button (::after, blur 14px, 35% opacity) gives a soft halo. On hover or focus the face's inset animates from 1.5px to 50% on every side (520ms ease-in-out) and fades at the end, so the face draws in toward the centre and the gradient floods the whole button; the label crosses from cream to ink as the gradient arrives, and the halo brightens. Leaving reverses it. Press scales to 0.97. Reduced motion stops the turning and replaces the flood with a crossfade. Selected variant — Night (night): Palette for this theme (Night): --rfb-face #121015; --rfb-ink #efe8dc; --rfb-ink-on #141216; --rfb-ring conic-gradient(from var(--rfb-a), #b9cce4, #c8b9ea, #f0b37a, #7fd1a8, #b9cce4). Treat these as the root colour tokens, one value per role, and name them to suit your code. Select it with the theme option set to "night". Keep every dimension, spacing value, state and motion from the brief unchanged, and keep text at 4.5:1 contrast or better on these surfaces. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. 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 flood the button with its border's gradient. Motion: Border gradient turns once every 8s; the flood is 520ms ease-in-out; label colour follows 160ms later. Accessibility: A real button whose label is its text; the label colour changes with the fill so contrast holds in both states. Focus does exactly what hover does and adds an outline. Reduced motion stops the loop. Responsive behavior: Intrinsic width from its label. 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 flood the button with its border's gradient.
- Motion
- Border gradient turns once every 8s; the flood is 520ms ease-in-out; label colour follows 160ms later.
- Accessibility
- A real button whose label is its text; the label colour changes with the fill so contrast holds in both states. Focus does exactly what hover does and adds an outline. Reduced motion stops the loop.
- Responsive
- Intrinsic width from its label.