Staggered hero dashboard entry choreography
I wanted to know if one ElementGL WebGL 2 canvas could drive staggered entry and exit choreography across four live drawable HTML dashboard modules at once. Switch choreography styles, scrub the timeline slider or tap controls inside any settled module.
Starting canvas…
Show the code four drawable modules, stagger timing curves, choreography shader, hit-box sync and 2D fallback
- Four sibling
drawablemodules inside one canvas. Each dashboard section sits inside#ec-canvaswith an editable title<input>, region filter pills, KPI increment controls and interactive load bars. - Explicit
tMsstagger windows and 240 Hz spring settle. Computes per-module local progress, under-damped spring overshoot for Elastic wave and clean zero-residual settle at 100%. - Single padded-quad choreography shader. Evaluates Gaussian defocus blur, top-hinged 3D perspective unfold with cast hinge shadow, elastic wave warp and vertical velocity smear with RGB chromatic fringe without clipping at card borders.
- Hit-box lock with
geometryUnit()anddata-hit-tick. Marks pre-entry cardsinertoffstage and synchronises settled or mid-motion cards onto exact canvas coordinates. - Five-argument 2D and plain-HTML fallbacks. Draws staggered transforms and canvas blur via five-argument
drawElementImage()when WebGL 2 is absent, or moves all four cards into#plain-hoston context loss.
How it works
- One
ElementGLWebGL 2 context manages all fourdrawablesections inside#ec-canvas. Each card lays out atleft: 0; top: 0with an explicit responsive CSS size computed fromcanvas.clientWidthandcanvas.clientHeight. - When any child updates (typing in
#ec-title-input, switching a region pill, pressing+1k req/s, picking a chart bar or triggering+1 Spike), Chromium fires apaintevent on#ec-canvas. Only afterhasPaintedturns true andstage.begin()sizes the drawing buffer doesstage.upload()copy dirty module textures withgl.texElementSubImage2D()andUNPACK_PREMULTIPLY_ALPHA_WEBGL = true. - Each card draws over a
36 pxpadded quad in WebGL clip space so blur halos, 3D origami drop shadows, elastic overshoot bulges and directional smear wakes extend cleanly past each card's settled border. AtProgress 100%, the shader branches to a direct 1:1 texel passthrough with zero blur, scale1and opacity1. syncChoreoGeometry()scalesupdateElementGeometry()by a cachedgeometryUnit()factor, togglesdataset.hitTickwhen matrices change, setsinert = trueon unrevealed cards and tracks live card transforms so interactive buttons stay aligned atProgress 100%and mid-scrub.- Without WebGL 2
texElementSubImage2D(), a 2D context draws each visible card with 5-argumentdrawElementImage(), scale/translate transforms andctx.filterblur. On context loss or without the API, all four sections move into#plain-hostas a responsive CSS grid.
Live checks
Each check builds an isolated fixture inside the hidden test stage and retires its canvas when done. The dashboard above isn't touched.
| Result | Experiment | Detail |
|---|
Findings
Measured in headless Chrome 160.0.8188.0 canary on 2026-11-27 (412 px viewport at 2.625 DPR and 1024 px desktop): 6/6 live checks pass on one ElementGL WebGL 2 context (927x1282 px, 1.19 MP, 9.51 MB, 0 lost contexts, 0 open snapshots). Tap "Run these 6 checks" above to measure your browser.
- Not verified yet: real GPU frame rates, touch scrubbing and on-screen keyboard opening inside
#ec-title-inputon Chrome 159 for Android at 412 px wide, plus Playwright runs ofnpm run check:jank -- /entry-choreo/andnode tools/draw-size/audit.mjs /entry-choreo/. - Mipmapped
textureLod()removes blurred-text ringing: sampling a 12-tap disc at LOD 0 left faint duplicate echoes around thin white labels during Blur-scale rise and step bands in Directional smear. Generating mipmaps on upload and sampling 24 jittered Vogel taps (or 20 jittered smear taps) withtextureLod()produces smooth defocus blur and continuous velocity streaks while keeping settled text at LOD 0. - Why padded quads matter for choreography shaders: drawing each module into a tight quad clips Gaussian blur halos, upward elastic overshoot and vertical velocity smear tails along the card rectangle. Expanding each quad by 36 CSS pixels and mapping
cardUvback inside the fragment shader keeps edge feathering smooth while locking 1:1 at settle. - Why one reference width caches
geometryUnit(): because#ec-kpiand#ec-chartare narrower than#ec-headeron desktop, callinggeometryUnit()with different widths per card would invalidate its WeakMap cache every frame. Caching against#ec-headeronce per canvas buffer resize keeps hit-test calibration fast and exact across all four modules.