A bill-pay dashboard that arrives as emerald pixels
I wanted to know if one ElementGL fragment shader can make a live <form> and bill-pay <table> arrive cell by cell as coarse glowing emerald blocks that cascade down the card and sharpen into crisp text, with every pay button clickable even while it's still pixels. It rests mid-sweep. Type a prompt, tap a preset, or drag Sweep.
Starting the ElementGL pixel shader...
Show the code cell delays, block sizes and hit sync
- One drawable card. The prompt
<form>, preset buttons, the<table>of bills and the<output>total are ordinary elements inside the canvas, sized from JS with--card-wand--card-h. - Cell-by-cell arrival. Each 24 px cell gets a diagonal delay plus jitter. Its local time picks a block size (24, 12, 6, 3, then sharp) and fades the emerald tint out.
- The sweep and the pay flash. A prompt rebuilds the rows, then the progress uniform runs from 0 to 1. Paying a bill re-pixelates just that row.
- Hit boxes. The card is measured from the canvas box, and
updateElementGeometry()is called withgeometryUnit()only when the size changes.
How it works
The idea comes from Anagram's Incard App Builder, where a prompt produces a dashboard that shows up as big green pixels before it settles. That version is a picture. Here the dashboard is a live <article> inside one <canvas layoutsubtree>, uploaded to a texture with texElementSubImage2D() on each paint event, and the pixels come from the fragment shader that draws it.
The shader splits the card into 24 px cells. Each cell's delay is 0.2x + 0.8y plus up to 0.15 of hash jitter, so the wave runs down and slightly across, and cells near each other arrive out of step. The cell's local time chooses a block size: a 24 px block whose emerald brightness is the average of nine texture taps, then 12, 6 and 3 px blocks in the card's own colours tinted green, then the sharp texture with the tint fading out. Nothing is read back. The DOM never changes during the sweep, so after the first upload the animation is only a uniform per frame.
The page loads with the sweep held at 55%, so the top of the card is sharp and the lower rows are still blocks. The pay buttons down there work anyway: hit testing comes from the element's layout and updateElementGeometry(), not from what the shader drew. Paying a bill updates the <output>, and a second rectangle uniform makes that one row fall back to blocks and re-arrive.
Live checks
These wait for a tap, because they make WebGL contexts and read pixels. Each pixel check runs on its own fixture on the test stage and retires the canvas afterwards. The hit check reads the visible card's geometry and scrolls it into view for one task to call elementsFromPoint(), then puts the scroll back before anything is painted.
Findings
- Measured in Chrome Canary
161.0.8200.0on 2026-12-04 at412x915(DPR2.625, SwiftShader WebGL): all 7 live checks passed with zero JS errors, zero lost contexts, zero open snapshots and no horizontal overflow, on a924x1271canvas (1.17 MP,9.0 MB). - At the 0.55 rest the top bar of a fixture matched the finished frame pixel for pixel, while the lower bar turned into emerald blocks (green lead
73,rgb(95,204,156)againstrgb(232,245,238)when sharp). Two rest frames matched in 15 of 15 pixels. - The card measured
484/484px against its canvas and Pay all sat-0.3px from its drawn position. With the stage scrolled into view,elementsFromPoint()hit all 10 controls at their drawn centres, and a mouse click on the fourth Pay button, still under the blocks, paid it (total£349.94to£314.95). - At phone size Pay all sits below the first screen, where
elementsFromPoint()can't see it. The hit check scrolls the canvas into view and back within one task, so nothing is painted scrolled, and it hit both Pay all (-0.3px) and the last row's Pay button inside the pixel band (-0.4px). Physical Android touch andnpm run check:jankare not verified.