Kinetic comic halftone UI

I wanted to know if plain semantic <nav> and <form> HTML can be turned on the GPU into rotated CMYK Ben-Day halftone print with cursor-lit dot radius, chromatic ink-outline offset, diagonal blade-wipe panel transitions and hit-stop shake while staying keyboard-accessible and respecting prefers-reduced-motion: reduce. Pick a print style, sweep across the panel to shift dot gain, or switch between 01 PROFILE and 02 LOADOUT.

JOKER-42 SYNC 84%
INK
STYLE
VOLT
Tactic
Ready: All-Out
starting...
Show the code CMYK Ben-Day shader, FBO blade-wipe capture, slanted geometry sync and 2D fallback
  1. Two semantic HTML panels inside one canvas. The profile <section> and loadout <form> live inside <canvas content="drawable" layoutsubtree>, with inert hiding whichever panel is off-stage.
  2. Rotated CMYK Ben-Day print shader. Separates un-premultiplied DOM texels into 15, 75, 0 and 45 degree dot screens over paper grain, offsets cyan and magenta edges for chromatic ink outlines and drives dot gain from the cursor spotlight.
  3. Outgoing FBO capture and 35 ms hit-stop wipe. Copies the outgoing panel into an off-screen framebuffer before switching, holds a 35 ms hit-stop impulse with damped shake (0 px under reduced motion) and slices across with a jagged blade boundary.
  4. Slanted hit-box calibration. Multiplies the rotated panel DOMMatrix by geometryUnit(), calls updateElementGeometry() on the active panel, moves the inactive panel off-stage and toggles dataset.hitTick.
  5. Five-argument 2D and plain-HTML fallbacks. Draws the tilted panel via 5-argument drawElementImage() without WebGL 2, or extracts both panels into plain HTML on context loss.

How it works

Both panels live inside one <canvas content="drawable" layoutsubtree> as ordinary drawable HTML: a <section> for the profile card and a <form> for the loadout controls, each carrying its own <nav> tab bar. Because ElementGL creates a single WebGL 2 context for the whole stage, the browser uploads the active panel's DOM pixels with gl.texElementSubImage2D() whenever a control updates or a paint event fires.

In the fragment shader, each sampled RGB texel is un-premultiplied and split into subtractive CMYK channels. Cyan prints on a 15 degree grid, magenta on 75 degrees, yellow on 0 degrees and black on 45 degrees over generated newsprint grain. Dense dark ink above 72% coverage fills solidly so small form labels stay legible even when you widen the dot pitch slider. Cyan and magenta sample slightly offset UVs around dark edges to add print misregistration halos without blurring the black plate.

When you switch tabs in <nav>, the page renders the outgoing panel's current texture into an off-screen RGBA8 framebuffer before swapping inert onto the outgoing panel and enabling the incoming one. Unless reduced motion is active, the next 35 ms holds an impact hit-stop with a damped directional shake before the diagonal jagged blade-wipe clears across to the live incoming texture. Under prefers-reduced-motion: reduce (or the toggle above), shake amplitude drops to 0 px and tabs swap in one frame.

WebGL texture uploads don't move Chromium's hit boxes by themselves. After each frame's transform is computed, comic.js multiplies the slanted panel DOMMatrix by geometryUnit() from /lib/surface.js, calls canvas.updateElementGeometry() on the active panel, pushes the inactive panel off-stage and toggles dataset.hitTick to clear the hit-test cache. If WebGL 2 isn't available, the stage drops to a 2D canvas drawing the tilted panel with five-argument drawElementImage(), or moves both panels into plain HTML on context loss.

Live checks

These checks run on isolated fixtures on the test stage without scrolling or moving focus on the demo above. Tap the button below to run them in this browser.

Findings