Feedback & States
Denied
Red no-entry disk head-shakes with decaying sine spring and lateral buzz; impact sparks radiate on first beat. Initial demo stops after first input; click or keyboard activation runs finite feedback.
cssmedium complexitymoderate motionclickmobile-ready
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
1
When to use it
Form rejection, access-denied gates, locked-action confirmations where a tactile "no" reinforces the message.
When not to
Calm or neutral feedback contexts. Avoid for users with vestibular sensitivity — the buzzing reads as harsh.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change shake amplitude from 13 degrees to 8, reduce buzz duration to 400ms (var dur = 400), and swap the red accent to orange (#f97316). 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
- shake angle (rot = s*13)
- buzz duration (var dur = 620)
- auto-demo interval (idle > 1900)
- spark opacity peak (0.85)
- red accent color (--red:#e2473d)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- IIFE wrapper
- prefers-reduced-motion early-return guard
- visibilitychange pause/resume
- aria-live polite status region
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
- demo-v1 preview lifecycle: initialize demoEnabled from window.__foreverPreview and stop attract work on the window forever:interactive event; retain manual feedback, settling, cleanup and explicit sessions
Known limitations
- CSS reduced-motion rule only applies to CSS animations; JS animation is guarded separately via matchMedia check
- Sparks are seizure-safe by design — do not increase sp peak opacity above ~0.9
- State remains local to each mounted instance; format/theme remount preserves takeover, not component values.
More Feedback & States components
- Success CheckMint-green ring sweeps closed and a checkmark draws in with a springy pop and expanding halo; initial replay stops after first input; click or Space runs…
- Error ShakeDark email input shakes horizontally with decaying-sine, border flushes red, X icon pops in with overshoot spring, validation message slides up.
- Toast StackDark notification toasts spring up from the bottom, drain a colored progress bar, then slide off right. Four types cycle: success, error, warning,…
- Hold to ConfirmPress-and-hold fills a tick-marked ring; full hold rotates center square 45° into a green check; early release flashes red cross (cancelled).
- Empty StateA Bauhaus open vessel sits empty while 26 mint motes drift in a slow orbital cloud above it; poking scatters them and they spring back to settle.
- Like BurstRose-and-verdigris enamel palette: a heart spring-pops with 96 dots and ring shards. First input stops the demo; later input toggles the liked state.