Directional whip-pan motion-blur cut

I wanted to know if one ElementGL canvas can whip-pan between two live HTML views with 16-tap directional blur, RGB fringe and a damped overshoot spring while keeping buttons and inputs clickable at rest. Tap a cut direction, swipe across the stage or scrub from 0% to 100%.

SCENE A · STORYBOARD CAM A · 24 FPS
01:04:12:08
Beat 01A · 35 mm
SCENE B · TIMELINE SEQ 04 · 4K
01:04:18:14
WHIP BLUR RGB FRINGE
STORYBOARD A TIMELINE B
WHOOSH -3DB ROOM TONE
3 tracks live · 48 kHz
starting...

Show the code Dual drawable views, directional blur shader, spring curve and fallbacks
  1. Two live scenes inside one drawable canvas. #wp-scene-a (warm Studio Storyboard) and #wp-scene-b (dark indigo Timeline Sequence) sit inside <canvas id="wp-canvas" content="drawable" layoutsubtree>.
  2. Bell-curve velocity, damped overshoot spring and hit-box sync. stepWhipCut(..., tMs) drives the overshoot landing, whipBellVelocity() peaks at 50%, and syncSceneGeometry() moves the settled view into place while parking the other view offstage with inert.
  3. 16-tap directional velocity blur and RGB fringe shader. WHIP_FRAG samples both textures across the moving shutter vector uPanDir with red and blue channel offsets proportional to velocity and Blur px.
  4. Premultiplied alpha uploads, 2D fallback and context recovery. Sets UNPACK_PREMULTIPLY_ALPHA_WEBGL = true on creation and restore, calls stage.begin() before stage.upload() inside paint, and falls back to 5-argument drawElementImage() or #plain-host.

How it works

Both views live inside one <canvas id="wp-canvas" content="drawable" layoutsubtree> managed by a single ElementGL WebGL 2 context from /lib/element-gl.js. On creation and inside onRestored, the page turns on gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true) so badges and input borders keep clean anti-aliased edges. Inside the paint handler, hasPainted unlocks uploads and stage.begin() sizes the backing buffer before stage.upload() updates whichever scene changed.

During a cut or manual scrub, stepWhipCut(anim, tMs, reducedMotion) drives progress across a 480 ms S-curve with a damped overshoot spring landing (about 2.6% past the stop before rebounding to rest). whipBellVelocity() follows a raised sine bell curve that starts at 0, peaks at 1.0 around 50%, and returns to 0 when settled. In WHIP_FRAG, once velocity times Blur px exceeds 0.15 px, the shader integrates 16 directional taps along uPanDir across both the trailing half of Scene A and the entering half of Scene B while splitting red and blue channels along the pan axis for a subtle velocity fringe. At 0% and 100% rest, it drops to a single direct texture fetch so controls and text stay razor-sharp.

At rest, syncSceneGeometry() calibrates CSS-to-canvas units with geometryUnit(), places the settled scene over the canvas via updateElementGeometry(), moves the hidden scene to OFFSTAGE with inert = true, and flips data-hit-tick to clear Chromium's hit-test cache. The stage disables native drag selection with user-select: none plus a selectstart guard while keeping user-select: text on both title inputs. Idle preview cuts pause on IntersectionObserver, document.hidden, any touch or scrub, and prefers-reduced-motion: reduce. When WebGL 2 isn't available or ?route=2d is set, a 5-argument drawElementImage() pass draws the moving frames; on webglcontextlost, ?route=plain or missing API support, both scenes move into #plain-host as plain HTML.

Live checks

These checks run on isolated fixtures inside testStage() and wait for a tap so opening the page doesn't allocate extra WebGL contexts or move focus.

StatusCheckDetail

Findings