How it works

How it works

A drop of thick glass trails your cursor over an interface that the page paints into a texture (WebGL can’t refract the DOM, so the page draws its own). The drop is a signed distance field, so a single full-screen pass knows, for every pixel, how deep inside the glass it is and which way the edge faces. Those two numbers give a height profile and a surface normal. The normal gives one refracted ray per wavelength. The flat centre stays clear, the rim squeezes the page into a bright compressed band, and smooth-min lets the drop melt into the glass toolbar like mercury. The interface is painted scenery, so its buttons do nothing, but the tab bar and the Day / Week / Month / Year control answer a tap by sliding their selection.

Pipeline (per frame)

ON CHANGE ONLY  (load · resize · Background select)
  layout: landscape 1280×720 · tablet 820-wide stack · phone 390-wide column (fitted to the height)
  Canvas2D page    ─▶ uBg  SRGB8_ALPHA8  W×H (2560×1440) + mip chain, 8× anisotropic
  Canvas2D glyphs  ─▶ uFg  SRGB8_ALPHA8  atlas, NEAREST  (icons + labels that sit ON the glass:
                      one padded cell per toolbar shape, 720×440 at 2560×1440)
                      (the page canvas stays at W×H and is reused; it is reallocated only on resize)
  uBg mip 1 ─▶ Gauss H ─▶ tmp ─▶ Gauss V ─▶ uB1  RGBA16F  W/2×H/2  σ  3 CSS px ┐ frost pyramid,
  uB1       ─▶ Gauss H ─▶ tmp ─▶ Gauss V ─▶ uB2  RGBA16F  W/4×H/4  σ  8 CSS px ├ linear light,
  uB2       ─▶ Gauss H ─▶ tmp ─▶ Gauss V ─▶ uB3  RGBA16F  W/8×H/8  σ 22 CSS px ┘ tmp freed per level
  whole repaint ≈ 1.4–2.1 ms main thread (3–10 ms the first time a scene is drawn)

EVERY FRAME
  JS   pointer ─▶ springs, sub-stepped at ≥ 240 Hz (dt-based):
         head ω15 ζ.8 (≈105 ms behind) · stretch ω21 ζ.38 (wobbles) · grow · press
         tail ×3 ω(24/19/15)·0.18^viscosity ζ(0.9 + 1.5·viscosity) + cohesion limit
         2 selection pills ω17 ζ.72
       ─▶ uniforms in place: 1 uneven capsule, 3 tapered tail links + their joint k,
          3 rounded rects, 2 pills, 4 bounding boxes, 3 glyph cells (0.05 ms)
  GPU  ONE full-screen pass ─▶ canvas  (no render targets, no simulation)
         outside all 4 boxes ─▶ page texel + dither                     (most pixels stop here)
         d, ∇d, bezel = smin( smin(capsule, link_i; k_i), min(toolbar shapes); k_merge )
         d > reach  ─▶ page texel + dither
         outside    ─▶ page × key shadow (SDF at p + offset) × ambient halo
         inside     ─▶ x = s/bezel ─▶ h(x), h′(x) ≤ 8, + 4 % dome ─▶ normal n
                    ─▶ 7 × refract(−z, n, 1/η(λ)) ─▶ textureGrad(uBg) │ uB1..uB3 (frost)
                    ─▶ vibrancy · tint (mixed in sRGB) · toolbar legibility
                    ─▶ Schlick F − F₀ → uB3 just outside the rim (light: darker, saturated, + sky)
                    ─▶ key highlight + counter, minus their flat-face value (a shade on light pages)
                    ─▶ hairline / lit edge ─▶ 1 px analytic AA ─▶ selection pills ─▶ uFg atlas cell
                    ─▶ sRGB + dither

The ideas that matter

Parameters

Presets

Performance & compatibility

References & credits