58 Commits

Author SHA1 Message Date
jessikitty efadc85195 Free hunt: only spawn ghosts that have an uploaded video
Add `AND webm_path IS NOT NULL` to the /api/freehunt pool so free-hunt
mode only selects ghosts with real media (and their derived webp/image
fallbacks), never bare procedural-wisp ghosts.
2026-06-22 10:37:52 +10:00
jessikitty 653980a52e iOS WebP: render as tracked DOM img overlay instead of WebGL texture
iOS won't animate a WebP inside a WebGL texture in any form. Render the
iOS/WebKit fallback as a real DOM <img> (animates natively) and project an
invisible 3D anchor's screen position onto it each frame, so it still tracks
distance/size and bobs. Flat 2D rather than in-scene, but animated + transparent.
2026-06-22 09:59:35 +10:00
jessikitty 25832dd58f Keep WebP animating on iOS by attaching the source img to the DOM
iOS pauses animation on a detached <img>, so the CanvasTexture sampled a
frozen frame. Attach the img hidden off-screen (opacity 0.01) so WebKit
keeps advancing the WebP; remove it on clear.
2026-06-22 09:53:36 +10:00
jessikitty 4cf8ec07a4 Animate WebP fallback on iOS via per-frame CanvasTexture
Three.js doesn't advance an animated-image Texture on iOS, so the WebP
showed as a static frame. Draw the animating <img> into an offscreen
canvas each frame and sample it through a CanvasTexture, keeping the ghost
in 3D (bob/scale/lookAt) and animated, with transparency preserved.
2026-06-22 09:48:17 +10:00
jessikitty 793a17dbdf Route iOS/WebKit to transparent WebP instead of opaque VP9 WebM
WebKit (all iOS browsers + desktop Safari) plays VP9 WebM but renders its
alpha as opaque black. SUPPORTS_WEBM_ALPHA now excludes iOS/Safari so those
devices fall through to the animated WebP fallback, which IS transparent.
Desktop Chromium/Gecko keep the WebM path.
2026-06-19 22:38:53 +10:00
jessikitty 6f8b67b583 Fix VP9-alpha transparency: drop sRGB on video texture, premultipliedAlpha off
The WebM carries real alpha (alpha_mode=1) but rendered opaque because the
VideoTexture was forced to SRGBColorSpace and the material assumed
premultiplied alpha, crushing transparent regions to black. Removing the
colorspace override and setting premultipliedAlpha:false keys the black out.
2026-06-19 22:00:03 +10:00
jessikitty b2a863bd80 Fix preview: map admin raw-row *_path fields to /uploads URLs
The /api/admin/ghosts endpoint returns raw DB rows (webm_path,
webp_path, image_path as bare filenames), not the public API's
camelCase URL shape. buildGhost now reads those and prefixes /uploads/,
so WebM video renders in the preview instead of falling through to the
procedural wisp.
2026-06-19 21:49:58 +10:00
jessikitty 2d66d809d4 Add /preview route serving the ghost preview page 2026-06-19 15:26:14 +10:00
jessikitty e81f779ea5 Fix preview.html encoding (store raw HTML, not base64) 2026-06-19 15:22:33 +10:00
jessikitty a8552592c7 Add admin-gated ghost preview page (/preview)
Camera-background single-ghost preview reusing the hunt's render path
(WebM VP9+alpha VideoTexture -> WebP/GIF -> procedural wisp). Login gate
matches admin; ghost list via JWT-protected /api/admin/ghosts. Dropdown
to pick a ghost, sliders for distance/size, camera toggle.
2026-06-19 15:20:17 +10:00
jessikitty 458c66a2c0 Fix: decode base64-corrupted source files (html/css/js + backend) 2026-06-19 05:06:43 +00:00
jessikitty 327b37babb Fix: decode base64-corrupted admin html/css/js 2026-06-19 01:21:26 +00:00
jessikitty 3fa50c4c2f Admin UI: style video row thumbnails like image thumbnails
Add .thumb-cell video to the existing .thumb-cell img rule so WebM-only
ghost thumbnails render at the same 34px size.
2026-06-19 09:54:25 +10:00
jessikitty 8e8e259b4c Admin UI: video-aware preview + table thumbnails
- openGhost() previews stored media, preferring WebM video over still image
- showPreview/hidePreview swap between <img> and <video> elements
- Live local preview on file pick (handles mp4/webm)
- Ghost-table row thumbnail renders <video> when only a WebM exists
2026-06-19 09:52:24 +10:00
jessikitty 2fe4d67518 Admin UI: allow MP4/WebM in billboard upload + video preview element
- Widen file input accept to include .webm/.mp4
- Add a <video> preview element alongside the <img> preview
- Update label and help text to mention server-side MP4 conversion
2026-06-19 09:46:29 +10:00
jessikitty 0c5123e3a6 Admin: accept mp4/webm uploads and auto-convert mp4 to transparent webm+webp
- Allow .mp4/.webm in addition to image types; raise upload limit to 64MB
- MP4 uploads are luma-keyed to a VP9+alpha WebM plus an animated WebP
  fallback via lib/ghost-media.js; the raw MP4 is discarded
- Pre-made .webm uploads are stored directly
- All prior media (image/webm/webp) is cleaned up on replace and on delete
- WebP doubles as the still thumbnail for converted ghosts
2026-06-18 14:27:50 +10:00
jessikitty dc5e032b3a Emit webm and webp URLs in public ghost objects
rowToGhost now returns webm/webp alongside image, so the client renderer can
select the VP9+alpha video billboard (with WebP/GIF fallback).
2026-06-18 14:22:50 +10:00
jessikitty 22983caa18 Add webm_path and webp_path columns to ghosts (idempotent migration)
ALTER TABLE guarded by a column-existence check so existing production
databases gain the columns without data loss.
2026-06-18 14:20:50 +10:00
jessikitty 9866e44445 Add server-side ghost media converter (mp4 -> transparent webm + webp)
Shells out to system ffmpeg with the same luma-key pipeline as ghostify.sh.
Produces a VP9+alpha WebM (browser-decoded primary) and an animated WebP
fallback. No new npm dependency; fails gracefully if ffmpeg is absent.
2026-06-18 14:18:50 +10:00
jessikitty ec4442d4ce Add WebM (VP9+alpha) VideoTexture ghost billboards with GIF/WebP fallback
- Detect VP9-alpha WebM support once at load; iOS Safari falls back to <img>
- addGhost prefers data.webm via THREE.VideoTexture (browser-decoded, no
  per-frame needsUpdate pump) when supported
- On video error, gracefully swap the billboard to the GIF/image texture
- Pause + release ghost <video> elements on capture and on hunt teardown to
  avoid leaking decoders
2026-06-18 13:15:54 +10:00
jessikitty 00cd1696c6 Add iOS motion-gate overlay styles 2026-06-18 08:41:39 +10:00
jessikitty ee3dace9b1 Add iOS Enable Motion overlay to hunt screen 2026-06-18 08:40:29 +10:00
jessikitty 0da74fb2dc Fix iOS gyro: explicit Enable Motion gate; spawn ghosts near center, reveal on spawn 2026-06-18 08:39:37 +10:00
jessikitty bf719a1dda Update setup docs for dotenv + default port 33033 2026-06-17 22:26:11 +10:00
jessikitty cc0803b09f Point nginx upstream at 127.0.0.1:33033 2026-06-17 22:25:17 +10:00
jessikitty ad5fd90b60 Default port 33033; note dotenv auto-loads .env 2026-06-17 22:24:59 +10:00
jessikitty bf7930fc20 Load .env in seed script (ADMIN_USER/PASS/UPLOAD_DIR) 2026-06-17 22:24:38 +10:00
jessikitty 2c71a6bd39 Load .env via dotenv; default port to 33033 2026-06-17 22:23:57 +10:00
jessikitty 010558d104 Add dotenv dependency 2026-06-17 22:23:39 +10:00
jessikitty af4fd70e39 Add About/Tribute page styles 2026-06-17 22:02:50 +10:00
jessikitty 3a9dff06fe Wire up About screen routing and button 2026-06-17 22:00:50 +10:00
jessikitty 60d5844894 Add About/Tribute info page (words-only homage explanation) 2026-06-17 21:58:19 +10:00
jessikitty 00441f5787 Add step-by-step setup guide to README 2026-06-17 16:41:48 +10:00
jessikitty 35a2777dcb Add admin console client logic 2026-06-17 16:40:06 +10:00
jessikitty e1f18303a6 Add game client logic (scan, AR hunt, roster) 2026-06-17 16:39:18 +10:00
jessikitty f3c450092a Add admin panel page 2026-06-17 16:38:05 +10:00
jessikitty 5dbbefc032 Add main game page (title, scan, AR hunt, roster) 2026-06-17 16:37:40 +10:00
jessikitty 13906e9bf2 Add admin panel CSS 2026-06-17 16:37:15 +10:00
jessikitty 261e8c1275 Add game CSS (title, scanner, AR HUD, roster) 2026-06-17 16:36:50 +10:00
jessikitty 0a0f04f72b Add shared CSS 2026-06-17 16:36:10 +10:00
jessikitty 5627c1f3bc Add nginx reverse-proxy example 2026-06-17 16:35:51 +10:00
jessikitty b21d10c0d8 Add ghosts seed data (111 ghosts with full stats) 2026-06-17 11:49:15 +10:00
jessikitty 6355b02782 Add abilities seed data (common + boss) 2026-06-17 11:47:18 +10:00
jessikitty 188242a23a Add sets seed data (boss-to-set references) 2026-06-17 11:46:48 +10:00
jessikitty dc408d0929 Add DB seed script with admin bootstrap 2026-06-17 11:46:13 +10:00
jessikitty a17504a16e Add xlsx -> JSON extractor 2026-06-17 11:45:47 +10:00
jessikitty a80b4e272e Add admin CRUD routes with image upload 2026-06-17 11:45:16 +10:00
jessikitty ed4e03712b Add public game API routes 2026-06-17 11:44:43 +10:00
jessikitty d2ce965c63 Add auth routes 2026-06-17 11:44:20 +10:00
jessikitty fd3c0f19fd Add JWT auth middleware 2026-06-17 11:44:08 +10:00