← All experiments
Experiment
Glass Light Toggle
A light and dark switch with a glass knob, a light that orbits it and a pixel icon that re-forms as you drag.
This experiment needs WebGL2, which this browser does not have.
One fragment shader
The page, track, glass and light are signed-distance shapes resolved in a single WebGL2 pass, so the glow never has to line up with separate layers.
Glass that bends
The bevel pushes each ray inward and frosts it toward the rim. Sampling the icon three times adds the thin colour fringe.
A swarm you can scrub
Each moon pixel is paired with a sun pixel by angle and given its own delay, swirl and spring. Stop dragging halfway and the swarm holds mid-flight.
A real switch underneath
A native switch sits over the canvas for keyboard and screen readers. Reduced motion skips the springs and goes straight to the final state.