README
htmlREADME
markdownHero Deck
A Babylon 9 stage that performs the Adom app catalog. It lives in Hydrogen Desktop's setup panel, where it has roughly ten minutes of guaranteed screen time while the workspace builds, and it spends that time making nineteen Adom apps look irresistible.
The page Overview (readme.html) runs the REAL component live, destruction gallery and all — if you are reading this markdown you are looking at the Files-tab fallback.
What it does
- One hero billboard holds the stage at a time: full-bleed 16:10 art on a slab with real thickness, floor reflection, a pool of the app's own accent colour, dust in the beam, and a hard key light crossing on a 13 second cycle.
- The camera sits LOW (IMAX seat), drifts on 35–90s periods, and pushes in over 26s, so the frame is never still but never fidgety.
- Two spotlight pools pan over the art itself (shader-side, multiplicative — they can only brighten, never destroy readability), one synced to the stage key light.
- ONE transition per deck, by design (interleaving them all read as sloppy). Default
exit is the trace-slice: a teal laser slices the hero along fresh random
PCB-trace paths (edge-to-edge walks, so they genuinely partition the image via
flood-fill), then each orphaned piece POURS AWAY left to right — a sand-front wipe
with the same points trickling out as falling debris particles, hourglass-style.
The stage goes completely clear (plus a 140ms beat) before the next hero enters.
New random cuts every run; boards with fewer than 4 pieces are re-rolled. Default entrance: rise. Embedders choose with
exit="burn|melt|laser|vortex|shatter|dissolve|circuit|traceslice|random"andentrance="rise|deal|glide|materialize|...|signature". - Wheel = Babylon-native zoom-to-cursor, pinch on touch, hold-drag = orbit. The underdamped spring (stiffness 400, damping 14) NEVER pauses: input fights it live, and the moment you let go it lands home through a few bounces in ~0.5s.
- The WebGL canvas is alpha-cleared: the host page's theme ground shows through and the component re-skins itself when the theme changes. Caption is DOM on a scrim.
- Deliberately NOT clickable: advertisement billboards inside HD, never links out of it. Drag scrubs, wheel zooms; nothing navigates away.
- Parks its render loop when off-screen. Measured cost while visible: ~0.43ms CPU/frame (~2.6% of one core at 60fps) on ADOMLAPPER.
Files
| Path | What |
|---|---|
stage.src.js |
The whole component (<hero-deck>), including the effect shaders |
apps.json |
The 19 apps: slug, name, pitch, accent colour |
heroes/*.webp |
Hero thumbnails, 640×400, strict 16:10, ~15KB each |
tools/build.mjs |
Bundles component + Babylon + inlined heroes into one IIFE |
tools/preview.src.html |
Standalone harness (size/theme switchers, ?fx= debug) |
skills/hero-deck/ |
The skill: how to embed this in your own app |
readme.html |
The page Overview — the live component, inline |
Canonical home
The shipping copy lives in the hydrogen-desktop repo at src/lib/herodeck/
(bundle at static/hero-deck.bundle.js, rebuilt by node tools/herodeck/build.mjs).
This page is the project home and mirror; keep the two in sync when editing.
Build
# Babylon is NOT a dependency of the host app; it resolves from a sibling checkout
BABYLON_MODULES=/path/to/node_modules-with-@babylonjs-core node tools/build.mjs
Output is a single self-contained hero-deck.bundle.js (~6.8MB: Babylon 9.5 + all
19 heroes as data URIs). Nothing is fetched at runtime.
Hard-won notes (do not relearn these)
- The hero art is unlit by design (
PBRMaterial.unlit/ custom shader). Scene lights on the art either black it out or blow it to white — proven repeatedly. - With
disableLighting, StandardMaterial draws from EMISSIVE, not diffuse. - The art plane needs ~20mm clearance off the slab: 1mm z-fights and loses.
- No GlowLayer: its fullscreen composite corrupts destination alpha, which turns transparent pixels opaque black on light themes.
ANIMATIONTYPE_FLOATis 0 — nevertype || ANIMATIONTYPE_VECTOR3.- Assigning
cam.targetruns ArcRotate'ssetTarget, which RECOMPUTES radius: write target first, radius last, or your radius write is clobbered. engine.getDeltaTime()only ticks inside Babylon's own render loop. The spring keeps its own clock.- Babylon's shader preprocessor SPLITS LINES ON
;even inside//comments, turning the comment tail into code ('the': undeclared identifier). No semicolons in GLSL comments, ever. - The trace-slice cuts obey real DRC, audited over 40 generated boards on hardware: zero intersections (true segment-clearance math, 13px gap — grid occupancy let diagonals cross cell corners), and never more than a 45-degree bend per joint (candidates are relative to the PREVIOUS segment, not the crossing axis).
- No
animation-fill-mode: bothon the caption: Chrome freezes CSS animations in background windows and the caption never appears.