One glass light and dark mode switch rendered live. Tap it, press Enter or Space, or grab the pearl and throw it. When the pearl hits the far wall, the new mode washes out from the impact across the toggle and the page. Requires WebGL 2.
Polishing the glass…
Glass Toggle is a free three.js toy by ZirkoMirko: a single light and dark mode switch made of glass, with an iridescent pearl in light mode and a glowing plasma core in dark mode. When the pearl hits the far wall, the new mode spreads from the impact across the toggle and the page. Everything is rendered live in the browser.