Honeycomb fisheye launcher
I wanted to know if 25 live HTML mini-controls can sit inside a watch-style hexagonal fisheye cloud on one ElementGL canvas, where dragging glides any cluster into the magnified centre and updateElementGeometry() keeps every scaled control clickable and typeable. Drag across the dark watch face, click any button or toggle, or double-tap an outer tile to centre it.
Show the code 25 drawable tiles, spherical fisheye math, squircle GLSL shader and hit-testing sync
- Twenty-five live tiles inside one drawable canvas. Each tile is a fixed
104 x 104drawablebox with real inputs, switches, counters, steppers and colour chips. - Hexagonal lattice and spherical fisheye projection. Maps axial
(q, r)offsets around(panX, panY)onto a spherical watch dome with smooth radial scale falloff. - Squircle mask and dome shading in GLSL. Clips each
texElementSubImage2D()texture with a superellipse SDF, supersamples tiny rim tiles, and shades the watch dome. - Hit-testing sync and
inertrim gating. ScalesupdateElementGeometry()bygeometryUnit()on tiles withscale >= 0.35, togglesdataset.hitTick, and setsinerton shrunken edge tiles. - Pointer drag, double-tap centring and reduced-motion snap. Pans with a gentle spring snap on release and skips spring motion when
prefers-reduced-motion: reduceis set.
How it works
All 25 tiles sit inside one <canvas content="drawable" layoutsubtree> managed by a single ElementGL WebGL 2 context from /lib/element-gl.js. Each tile is a 104 x 104 CSS pixel drawable container holding ordinary HTML controls: two editable text inputs, five +1 counters, five pill switches, six cluster tint chips, a live clock, two range sliders, three steppers and a home button. On load and whenever paint fires with changedElements, only changed tiles are uploaded with gl.texElementSubImage2D(), so panning across the watch face runs with zero texture re-uploads per frame.
Every tile has an axial coordinate (q, r) arranged as a 25-tile concentric rosette: one centre hub, six Ring 1 neighbours, twelve Ring 2 tiles and six Ring 3 outer tiles. Relative to the pan offset (panX, panY), radial distance d maps to spherical dome angle theta = (d / 2.90) * (pi / 2). Screen offset follows bezelR * sin(theta) and tile scale follows cos(theta), magnifying the centre tile to 1.0 and shrinking Ring 3 tiles to 0.14 around the circular watch bezel.
Because WebGL draws do not move DOM hit regions, the paint handler calls canvas.updateElementGeometry(tile, { canvasTransform }) for every tile, scaled by geometryUnit() from /lib/surface.js so high-DPI screens stay aligned. Tiles scaled below 0.35 get tile.inert = true so tiny 14 px rim icons never trap Tab focus or hijack clicks, while tiles that pan into the lens above 0.35 clear inert and flip tile.dataset.hitTick to invalidate Chromium's hit-test cache. When WebGL 2 texElementSubImage2D() isn't available, the page falls back to five-argument drawElementImage() in 2D; if HTML-in-canvas isn't enabled or the WebGL context is lost, the 25 tiles move into a plain HTML grid.
Live checks
These checks build isolated fixtures on testStage() and wait for a tap so the page opens with one GPU context and no layout shift.
| Status | Check | Result |
|---|
Findings
- Static checks passed on 2026-11-27 (
node --check public/honeycomb/honeycomb.js,node tools/gfx/check.mjswith 0 problems, andnode tools/writing/check.mjs --strict /honeycomb/). Live checks in headless Chromium 157 and Chrome 159 on Android are not verified yet. - Uploading only tiles listed in
paintEvent.changedElements(plus any dirty or not-yet-uploaded tiles) keeps pointer drags and spring settles at 0texElementSubImage2D()uploads per frame while still reflecting live text edits, button clicks and clock updates on the next paint. - Tracking a per-tile upload flag after
stage.upload(tile)returns avoids assuming a texture has pixels if Chromium fires an earlypaintbefore a child's paint record is cached. - Gating
tile.inert = scale < 0.35while keeping each tile'supdateElementGeometry()transform inside the canvas excludes tiny edge icons fromelementsFromPoint()andTaborder without letting Chromium skip rasterising off-rim tiles before they pan inward. - Capturing drags only after pointer movement passes 7 px (outside text inputs and range sliders) lets short taps reach buttons and switches inside magnified tiles while touch drags starting anywhere on the launcher pan smoothly.