BLOBBO/demos/lane-h.html
type-two ae8a93c417 Lane H: ghost replay + title screen
Ghost (src/ghost/):
- format.ts: pure, headless-testable core — int16 (cm position / milli scale)
  quantization, base64 localStorage envelope (blobbo:ghost), linear sampling.
- recorder.ts: 15Hz fixed-step recorder, ~5min cap, saves quantized track on a
  new best (time <= best, matching game.ts's pre-emit best update).
- player.ts: translucent (~0.35) desaturated ghost + eyes, slight bob, replays
  in race time with interpolation; spawns on race:started, despawns on finish.
- install.ts: installGhost(world, blob) wiring both to the frozen race events.

Title (src/ui/title.ts): installTitle(world, {ready}) — CSS bubble-letter
BLOBBO wordmark with paint-drip accents, pitch, controls card, PLAY. Loading
blob-dot while a boot promise is pending. Emits ui:play exactly once inside the
user gesture (audio-unlock friendly), then fades and never returns. Shows saved
best time + "ghost ready".

Demo (demos/lane-h.html + src/demo/lane-h.ts): scripted 20s circle run — title
gates start, run 1 records, later runs replay the ghost on the same path.
Keys: G wipe ghost, R restart, P snapshot.

verify-drift.ts: numeric acceptance (esbuild+node) — max drift 0.0058m vs 0.5m
blob radius. Emits ui:play only; no edits outside owned paths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 11:47:34 +10:00

25 lines
1.0 KiB
HTML

<!doctype html>
<html lang="en">
<head><meta charset="utf-8" /><title>BLOBBO lane h demo — ghost + title</title>
<style>
html,body{margin:0;height:100%;overflow:hidden;background:#0a0c18;font-family:system-ui,sans-serif}
#app{width:100%;height:100%}
#legend{position:fixed;bottom:12px;right:12px;padding:9px 12px;border-radius:8px;
background:rgba(20,24,40,.72);color:#eaf2ff;font-size:12px;line-height:1.55;pointer-events:none;z-index:5}
#legend b{color:#ffd60a}
#legend .k{display:inline-block;min-width:14px;padding:1px 5px;margin-right:6px;border-radius:4px;
background:#354569;color:#fff;font-weight:600;text-align:center}
</style></head>
<body>
<div id="app"></div>
<div id="legend">
<b>Lane H — ghost + title</b><br>
Title → PLAY starts run 1 (records). Later runs replay the ghost.<br>
<span class="k">G</span>wipe saved ghost<br>
<span class="k">R</span>restart the run<br>
<span class="k">P</span>print state snapshot
</div>
<script type="module" src="/src/demo/lane-h.ts"></script>
</body>
</html>