← lab

Liquid glass you can grab

A real HTML card that behaves like a slab of soft glass—working out of the box in WebGL2, and going full HTML-in-Canvas when the browser lets it.

ongoingstarted updated

Try it

Grab me.

Pull, twist, let go. Still HTML: a real link.

Every WebGL2 browser gets the normal liquid glass variant (the glass bends behind the card while the HTML follows smoothly on top). In Chrome 157 with the HTML-in-Canvas flag on, the text and input warp right inside the glass mesh too.

What it is made of

  1. Backdrop. A 2D canvas running a live shallow-water wave simulation with sunlit/moonlit caustics.
  2. The card. Ordinary HTML. With HTML-in-Canvas on, the browser hands WebGL a live texture snapshot of it; otherwise it rides cleanly on top.
  3. Mesh. A grid pushed around by a soft-body deformation field and damped spring wobble.
  4. Shader. Bends the caustic water through the mesh with Snell's-law bevel refraction, chromatic dispersion, and cursor-tracked light.
  5. Hit target. The real DOM card kept aligned with the glass so links, inputs, text selection, and the cursor still work.

Why

I first found out about HTML-in-Canvas on April 8, 2026. Not long after, creative developers started showing what they could do with it on X, and I enjoyed it so much that I wanted to chip in too.

I like liquid glass, and I was a fan of skeuomorphism back when it was a thing. Soft-body simulations look great and make a webpage feel genuinely playful. Glass can be thought of as a very dense liquid, so I decided to make a slab of it on my own site.

Two variants, one glass

The card above—and the home page at full size—is ordinary HTML. Text is selectable, links are real links, and inputs work like inputs. Depending on what your browser supports, it runs in one of two modes:

  • Normal liquid glass (WebGL2): Works out of the box without any browser flags. A Three.js soft-body mesh and fragment shader draw the refracting glass right behind the real DOM card, while the card follows along with the closest whole-card CSS transform. Grab it and the glass bends, stretches, and wobbles while the HTML rides smoothly on top.
  • HTML-in-Canvas (Chrome 157 behind a flag): With chrome://flags/#canvas-draw-element turned on, the browser hands WebGL a live snapshot texture of the DOM card itself. Now the text, links, and inputs aren’t just riding on top—they warp and bend inside the glass mesh too.

If reduced motion is on, WebGL2 isn’t available, or a device can’t hold a decent frame rate, it drops back to plain CSS glass. This article itself stays plain CSS because a card this tall is too heavy for the shader, which is why the live demo sits in its own smaller tray above. And there is a small goo checkbox in the corner (under the footer links on phones) whenever you want to switch it off.

How it got here

2026-10-27: car stereos, FFT, and CSS glass

It actually started with FFT. I saw electroluminescent car stereo displays from the mid-00s on X and remembered audio visualizers. It seemed straightforward enough, so I threw Grok 4.7 at the problem.

Next I made one that measured how chaotic your cursor movement was, and for good measure turned it into a full-screen ASCII and Braille field. The end result felt tacky. To salvage it I reached for liquid glass—just CSS backdrop-filter and gradients at that point. After prompting for a while I got close to the feel I wanted, even though it lacked polish. Shipping something is better than nothing, so I pushed it and set the idea aside for a bit (aka loss of motivation).

2026-11-02: molten candy and a dancing hamster

It’s surprisingly hard to describe how jelly glass should feel. I tried Rapier first, but a full rigid-body physics engine was overkill and way too heavy for one card. Then I threw Astra at it, though OpenAI models struggled more on the frontend feel than Anthropic’s. Switching to Argon got the real HTML-in-Canvas + Three.js version off the ground.

Early on the mesh was a grid of particles connected by springs, which bunched up into accordion pleats whenever you pulled a corner across it. Replacing the spring grid with a smooth deformation field—stretch near the cursor, delayed follow-through, and a damped spring wobble—finally gave it that dense molten-glass feel, paired with a shader doing real bevel refraction and frost over the live backdrop.

Four minutes after getting the candy stretch working, I put my dancing hamster GIF back on the home card. GIFs like that have become a rare find—I consider it a piece of internet archaeology.

The goo draws on an invisible viewport-sized canvas so you can stretch the card all the way to the screen edges. Turns out that invisible canvas was swallowing every click on the footer links underneath. Taking the canvas out of hit-testing fixed it while keeping the card itself grabbable.

2026-11-20: Chrome 157 and the birth of the lab

Oh boy. I opened my own site, saw it broken, and went into panic mode thinking I or my agents had wrecked something. Turns out building on top of experimental browser APIs is a risky hobby:

  • Chrome 157 started baking an element’s CSS transform into its canvas snapshot, shoving the card right off its slab.
  • A one-pixel rounding error on snapshot texture sizing made every upload fail and fall back to CSS.
  • A wall-clock watchdog gave up on tabs that opened in the background before drawing a single frame.
  • Stretch was measured as raw distance moved, which blew the glass out to white when dragged far.

Fable tracked all of that down, added the goo off-switch, gave the backdrop proper colour to bend, and built the WebGL2 overlay fallback so anyone can grab the glass without flipping experimental flags. It also wrote a whole book about what could have been a paragraph—but the lab was born here so I could show how the experiment works without expecting visitors to hunt through chrome://flags.

2026-11-27: ditching the ASCII equalizer

That original mouse-shake ASCII equalizer was still sitting behind everything, and I was never fully sold on it. Clear liquid glass is way more fun when there’s something genuinely optical moving underneath it, so Neon swapped it out for a live 2D shallow-water caustic pond. Move the mouse for a wake, click the water (or the hamster) for ripples, and watch the bevel bend the passing light.

Performance

My daily driver is a MacBook Neo. I develop on it on purpose—constrained hardware forces you to write efficient software, and AI helps a lot when optimizing hot paths.

On the Neo, the small home card holds 60 FPS (averaging 60.0 fps over ten seconds, slowest frame 17.6 ms). Running an entire long article through the shader drops to ~10.6 FPS, which is why long pages stay plain CSS and only small cards get the goo. I still think there’s performance left on the table, and I plan to come back and squeeze more out of it.

Who built it

Grok 4.7 kicked off the original visualizer, Astra got the jello candy physics roughly in the ballpark, Argon made it look good, Fable survived Chrome 157 and helped start the lab, and Neon swapped in the caustic pond and helped bring this post back to earth.