Swipe-to-send payment and confirmation wave
I wanted to know if a semantic <dl> payment receipt and a vertical <input type="range"> could share one ElementGL WebGL 2 pass, gathering light under the thumb as you slide and firing a radial chromatic shockwave on release. Drag the slider past 92%, edit the fields, or tap Confirm.
Starting...
Show the code drawable receipt card, pre-commit glow and distortion wave shader, spring physics, geometry sync
- Live payment receipt and vertical range inside one canvas. Making
#pay-cardthe singledrawablechild keeps editable inputs, the semantic<dl>receipt, buttons and vertical<input type="range">in one WebGL texture upload. - Energy gather and radial chromatic shockwave shader. Combines a volumetric thumb glow column with an expanding
radialSin * exp(-dr^2)displacement wave and RGB channel dispersion along the crest. - 92% commit threshold and damped spring snapback. Shared state controller driving partial release snapback, confirmation wave progression and
prefers-reduced-motionsettling. - Hit-box sync with
updateElementGeometry(). Scales the card's offset matrix bygeometryUnit()and flipsdataset.hitTickso inputs, range dragging and buttons receive pointers cleanly. - Five-argument
drawElementImage()2D fallback. Draws the card at explicit CSS width and height with a radial glow and concentric confirmation ring when WebGL 2 isn't available.
How it works
This experiment pairs two interaction ideas from Elsewhere inside one live HTML-in-canvas surface: Yogi Suria's Swipe to Send (original post) and Jakub Antalik's Distortion Waves (original post). The whole mobile transfer card sits inside a single <canvas content="drawable" layoutsubtree> managed by one ElementGL WebGL 2 context from /lib/element-gl.js.
Inside #pay-card, the recipient and amount inputs update a semantic <dl class="receipt"> breakdown (subtotal, 1% network fee, settlement time and total), while a vertical <input id="pay-slider" type="range"> styled with writing-mode: vertical-lr; direction: rtl; touch-action: none sits in a tactile lane on the right. Every edit or thumb drag calls canvas.requestPaint(), and inside the paint handler stage.begin() sizes the backing store before stage.upload(cardEl) uploads the live DOM picture via gl.texElementSubImage2D().
As the thumb rises from 0% toward 92%, the fragment shader adds a volumetric glow column, a caustic ring around uThumbCss, subtle edge warming and a gentle inward UV pull that avoids shifting the thumb directly under your finger. Releasing below 92% hands the charge to a 240 Hz sub-stepped spring that snaps the thumb smoothly back to Draft. Crossing 92% and releasing, or tapping Confirm, locks the status badge to Sent and fires a radial shockwave from the trigger box. Along the expanding crest, radialSin * exp(-dr^2 / sigma^2) warps underlying receipt typography while splitting red, green and blue samples by up to ±3.4 px before a mint and gold shimmer settles across the Sent badge.
Because #pay-card sits inside a 12 px bleed margin so shockwaves and border glows don't clip at the card edges, syncGeometry() scales DOMMatrix().translate(padX, padY) by geometryUnit(), passes it to canvas.updateElementGeometry() and flips dataset.hitTick. Under prefers-reduced-motion: reduce (or the toggle above), springs settle immediately and the shockwave skips UV warp and RGB splitting for a calm border highlight. When WebGL 2 isn't present, the page drops to a 5-argument drawElementImage() 2D pass with radial glow and ring overlays, and context loss moves #pay-card directly into plain HTML.
Live checks
Each check builds an isolated fixture on testStage() without scrolling or focusing the card above. Press Run to execute them in this browser.
| Status | Check | Detail |
|---|
Findings
- Measured in headless Chrome 160 Canary (2026-11-27, 412 px viewport at DPR 2.625): all 5 live checks pass (gl error free wave draw, crest
|R - B|dispersion, 65% snapback vs 94% commit + wave,elementsFromPoint()across bleed padding, andstillDrawn()), with backing store at1.12 MP(924x1213) and9.0 MB. - Chrome 159 on Android touch feel along the vertical slider, hardware frame rates and
npm run check:jankstay not verified.