Variants
Sizes and states, all built from the same markup.
Usage
Paste the markup, include assets/css/tokens.css and assets/css/tailwind.css, then run the script from this page.
Accessibility
- Role and state. The wipe is a WAI-ARIA slider with aria-valuemin, aria-valuemax, aria-valuenow and a readable aria-valuetext ("62 percent restored"); disabled sets aria-disabled.
- Keyboard. Arrow keys move by 2, Shift+Arrow by 10, PageUp/PageDown by 10, Home and End jump to Before and After. The Before, Sweep and After buttons do the same without a pointer. Focus uses the --ring token.
- Reduced motion. With prefers-reduced-motion the seam jumps to its value with no sweep, sparks, camera push or bursts, and the before and after worlds still render as still frames.
- Touch and contrast. The track is 40px tall with pointer capture and touch-action none; dragging also works anywhere on the stage. UI colours come from the tokens (AA in light, dark and every preset); the WebGL scene is decorative and aria-hidden.