Digital rain over a live HTML terminal

I wanted to see if one ElementGL canvas could cascade glowing green phosphor code rain straight over a live HTML terminal card without blocking edits or clicks. Type into the command line or press Decode signal, Trace route or Lock rain: the shader detects DOM glyph edges from texElementSubImage2D() and lights up the letters and borders where droplets collide.

TTY-04 // ZION MATRIX RELAY RX // STREAM
SIG//48.19 kHz :: CARRIER LOCK :: READY
CHANNEL
ZION-04 // 1999.03
PARITY
CRC-32 VALID (0 ERR)
ROUTE
10.42.0.1 -> 172.16.88.4
STREAM
PHOSPHOR RAIN LIVE

Starting canvas…

Show the code drawable terminal markup, Sobel edge catch shader, ElementGL upload and hit-box sync
  1. Live terminal inside one drawable canvas. #term-panel holds an editable command <input>, three quick-command buttons, a live <output> and four status rows inside one <canvas content="drawable" layoutsubtree>.
  2. Sobel edge detection and 5x7 phosphor rain shader. Samples uTex across a 3x3 luminance stencil, renders procedural 5x7 dot-matrix glyphs and flares DOM letter strokes and button rims when falling drop heads cross them.
  3. One ElementGL context with premultiplied uploads. Sets UNPACK_PREMULTIPLY_ALPHA_WEBGL = true on creation and restore, gates uploads on hasPainted and calls stage.begin() before stage.upload().
  4. Hit-box calibration with geometryUnit(). Keeps #term-panel clickable and editable through updateElementGeometry() and toggles dataset.hitTick to clear Chromium's hit-test cache.
  5. Five-argument 2D and plain-HTML fallbacks. Draws #term-panel with 5-argument drawElementImage() and green rain columns in 2D, or moves it into plain HTML if the context is lost.

How it works

The whole terminal card lives as ordinary HTML inside one <canvas content="drawable" layoutsubtree> driven by a single ElementGL WebGL 2 context from /lib/element-gl.js. There's zero CPU pixel readback during animation.

Live checks

Each check builds its own isolated fixture on testStage() and retires its canvas when finished. The visible terminal above isn't touched.

ResultExperimentDetail

Findings

Measured in headless Chrome 160.0.8188.0 canary on 2026-11-27 (412 px mobile emulation at 2.625 DPR, SwiftShader WebGL). Headless Chromium 157, npm run check:jank and Chrome 159 on Android stay not verified.