Siri glow capsule over a live clock

I wanted to know if an ElementGL shader can lay a glowing glass capsule across a live <time> clock so the digits under the band are magnified, bent and split into red, green and blue, while the voice button and prompt buttons stay clickable. Tap Start listening or a prompt.

idle · Siri
Local time · voice Idle

Friday 4 December

Tap a prompt, or start listening.

Starting the ElementGL capsule shader.

Show the code capsule SDF, per-channel refraction and hit sync
  1. A transparent card with a live clock. The <time>, the transcript <output> and every button sit inside the drawable canvas. The card is sized from JS, not with inset: 0.
  2. Glass band, dispersion and glow. A capsule signed distance field picks the band; inside it the texture is sampled three times at different magnifications, one per colour channel, and a hue ring glows round the rim.
  3. The band follows the clock. The capsule is placed from the <time> element's offsets in the card, so it stays on the digits at any width.
  4. Hit boxes after a WebGL draw. updateElementGeometry() scaled by geometryUnit(), cached on the canvas size, with an attribute toggle to clear the hit-test cache.

How it works

The idea comes from Andreas Storm's Siri Glow Reflection, where a glowing Siri pill sits over the lock screen clock and bends the numbers under it. Here the clock is a real <time> element that ticks once a second. Each tick changes the card, the canvas gets a paint event, and ElementGL copies the card into a texture with texElementSubImage2D().

The fragment shader works out the signed distance to a capsule laid over the digits. Outside the capsule it draws the card as it is, on a dark background lit by a coloured halo. Inside it treats the band as a glass rod: the texture is sampled closer to the centre line, so the digits look taller, and the red, green and blue channels each use a slightly different magnification, so the edges of every digit split into colour fringes. Near the rim the samples are pushed outwards, which bends the strokes the way thick glass does.

Start listening raises a pulse value that widens the halo, swells the capsule and drives a made-up voice level from a few sine waves. I didn't ask for the microphone. The prompt buttons change the transcript text and the four glow colours. All of it is uniforms on one quad, so the buttons are still the card's own buttons, and updateElementGeometry() keeps their hit boxes where they are drawn.

Live checks

These checks wait for a tap so the page keeps one WebGL context until then. Each one builds its own fixture on the test stage, reads it back once and retires it. The hit check also measures the card above and probes its buttons: it scrolls the demo into view, probes and scrolls back in the same task, so no frame is painted scrolled.

Findings