Wave-staggered kinetic list
I wanted to know if one ElementGL WebGL 2 canvas could drive independent staggered harmonic springs across five live drawable HTML list rows, shearing each card and splitting R/B chroma trails as you filter, shuffle or flick-scroll. Filter the list, drag vertically to flick, or tap Pin and +1 on any settled row.
Starting canvas…
Show the code five drawable rows, 48 ms spring wave, skew + chroma shader, hit-box sync and 2D fallback
- Five live
drawablerow cards inside one canvas. Each row keeps its category badge, counter text,Pintoggle and+1button inside#ks-canvas. - Deterministic
tMsharmonic springs with48 msstagger.stepRowSprings(rows, tMs)runs 240 Hz symplectic substeps, holds pre-launch elastic tension during each row'si * 48 msdelay and settles cleanly to1:1. - Padded-quad velocity shear and R/B chroma split.
STAGGER_FRAGshears each row byuSkew, runs 16-tap mipmapped vertical directional blur and splits R/B channels proportional to velocity before snapping to direct texel copy at rest. - Hit-test sync across shuffled and filtered rows.
syncRowGeometry()scalesupdateElementGeometry()by cachedgeometryUnit(), togglesdata-hit-tickand setsinertplus an offstage matrix on filtered-out rows. - Five-argument 2D and plain-HTML fallbacks. Draws skewed rows with 5-argument
drawElementImage()when WebGL 2 is absent, and moves rows into#plain-hoston context loss or without the API.
How it works
- One
ElementGLWebGL 2 context manages all fivedrawablerows inside#ks-canvas. Each row lays out atleft: 0; top: 0with an explicit responsive width and height derived fromcanvas.clientWidth. - Inside
paint, oncehasPaintedis true andstage.begin()sizes the drawing buffer, dirty rows upload viagl.texElementSubImage2D()withUNPACK_PREMULTIPLY_ALPHA_WEBGL = trueand generate texture mipmaps so fast vertical blur stays free of text ringing. - When you click
Shuffle order, switch filter tabs, type in the filter box or flick-scroll the viewport, each row targets its new slot index with a48 msstagger offset per slot.stepRowSprings(rows, tMs)outputs per-rowposY,skewX,blurPxandchromaPxfrom velocity. - Each row renders on a quad padded by
48 pxhorizontally and36 pxvertically so sheared corners and R/B chromatic trails never clip at card edges. At rest, the shader takes a 1:1 passthrough branch. syncRowGeometry()writes calibratedupdateElementGeometry()transforms for every visible row, togglesdata-hit-tickto clear Chromium's hit-test cache, and marks filtered-out or offscreen rowsinertwith an offstage matrix.
Live checks
Each check builds an isolated fixture inside the hidden test stage and retires its canvas when done. The list above isn't touched.
| Result | Experiment | Detail |
|---|
Findings
Measured in headless Chrome 160.0.8188.0 canary on 2026-11-27 (412 px phone viewport at 2.625 DPR and 1024 px desktop): 6/6 live checks pass on one ElementGL WebGL 2 context (937x941 px, 0.88 MP, 7.05 MB, 0 lost contexts, 0 open snapshots, 0 unasked readbacks). Tap "Run these 6 checks" above to measure your browser.
- Not verified yet: real GPU frame rates, touch flick responsiveness and Android Chrome 159 behaviour at 412 px wide, plus Playwright runs of
npm run check:jank -- /kinetic-stagger/andnode tools/draw-size/audit.mjs /kinetic-stagger/. - 48 ms wave stagger keeps leading rows ahead while building elastic skew: at
t = 120 ms, row 0 (0 ms delay) sits0.0 pxfrom target while row 4 (192 ms delay) lags51.2 pxbehind with0.013pre-launch skew; byt = 230 ms, row 4 surges at0.162skew and10.0 pxchroma split before all five rows snap to1:1. - Velocity shear and R/B chroma split stay clean inside padded quads: padding each quad by
48 x 36 pxavoids clipping sheared card corners and R/B trails (meanDiff = 53.4,maxRB = 223,shearA = 238vs0outside the card at rest). - Hit testing survives shuffling and filtering: calling
updateElementGeometry()with cachedgeometryUnit(), togglingdata-hit-tickand marking filtered rowsinertwith an offstage matrix kept moved+1andPinclicks landing on the visible rows while skipping filtered rows. - Clearing temporary 2D fallback canvases immediately drops removed GPU bytes to zero: setting
cv2.width = 0; cv2.height = 0;alongsidewindow.__gfx?.retire?.(cv2)cleared668 KBof pending 2D fixture memory immediately after Check 5 finished.