← all posts site ↗

chrome reflections, then i nuked the demo

got a bit obsessed with a fake chrome effect — reflecting your actual webcam feed inside website elements so they look like polished metal. the first pass was a canvas hack and it was everything wrong at once: flickery, inverted, using the back camera, and ghostly like a semi transparent overlay. rewrote it the standard way: one camera stream fanned out to masked video elements, composited by the gpu at full frame rate, zero javascript in the render loop.

the metal look came from treating the video like a material instead of a mirror. chrome reflections are smeared, contrast-crushed, and dark toward the bottom, so the feed got blur and a contrast boost until nothing was legible, a horizon gradient that goes bright at the top and black at the bottom, and a sheen that slides when you tilt. the masks were right the whole time — it read as video cut into shapes because there was nothing making it look like metal.

then everything on the dashboard looked down at once with the same error, and the pi's monitoring entry showed down even though the e-paper was refreshing fine. the pi was a tailnet auth thing — one sign in and the agent reconnected, with a note to disable key expiry so it never repeats. and the demo, looked at fresh, was still ugly compared to real chrome lookalikes: css masks can't bend pixels, so the people who do this properly use webgl environment maps.

said fuck it and nuked it. deleted the demo folder, killed the server process, removed the url handler, and the network went back to exactly what it should be. the outage failure mode died with it. better to kill it than to keep polishing something that reads as cheap.