This is Apple's Liquid Glass - the lens material from iOS 26 - rebuilt as an actual piece of glass with Three.js: real refraction through real geometry, not a backdrop-filter blur with an SVG displacement map faking the bend.
Three.js does the heavy lifting, and the scene itself is tiny. A capsule extruded with a fat bevel, a physical material turned up to full transmission so the mesh renders whatever sits behind it, and a room environment map for the highlights. Transmission bends that light through an index of refraction on the way past, dispersion refracts each color channel at a slightly different one so the edges fringe into rainbow, and the lens drifts after the pointer with a small tilt that sweeps the highlight across it. No hand-written shader anywhere - it's all material settings.
The bevel is the entire effect. Light hits the flat front face straight on and passes through almost unbent - a flat slab shows you nothing but a faint offset. All the liquid lives in the curve at the edge, where the surface turns away and rays bend hard enough to smear, stretch and magnify the text behind it. Give that bevel too few segments and the whole thing dies on the spot.
One detail I almost missed: ExtrudeGeometry ships flat-shaded normals, every bevel segment its own facet. The pill caught light like a cut gemstone - hard sparkly bands marching around the edge instead of one smooth highlight. Deleting the normals, welding the mesh back together with mergeVertices and recomputing them takes three lines, and it goes from rhinestone to liquid.
The other thing worth knowing before you lift this: transmission refracts the scene render, not the page. The DOM behind the canvas is invisible to it, so a transparent canvas floating over real page content simply doesn't work. The gradient and the text you see bending are a textured plane inside the scene, sized from the camera frustum rather than in pixels so it survives any container width.
The demo also checks prefers-reduced-motion: if you've asked your OS for less movement, the loop never starts and you get a single static frame - still glass, still refracting, just holding still.