Skip to content

Add ?demo mode and recording script for marketing clips#4

Open
PaulHax wants to merge 1 commit into
mainfrom
demo-clip
Open

Add ?demo mode and recording script for marketing clips#4
PaulHax wants to merge 1 commit into
mainfrom
demo-clip

Conversation

@PaulHax
Copy link
Copy Markdown
Collaborator

@PaulHax PaulHax commented May 19, 2026

Summary

Adds an auto-piloted walkthrough activated by appending ?demo to the URL, plus a Playwright-based recording driver. Used to produce a ~22 s 4K demo clip stepping through scenario+baseline → values → side-by-side compare, with view-transition morphs between screens.

The mode is gated entirely on the ?demo query — zero impact on normal users visiting the site.

What's in the commit

  • static/demo.js (new, ~30 lines) — drives goToStep / setValue with timed waits, shows the title intro, signals completion.
  • static/demo.css (new, ~50 lines) — hides top nav / TOC / Back-Next; flat background; centered headers; bumps view-transition animation-duration to 1.4 s so the morph reads on video.
  • record_demo.py (new) — serves static/ on a local port, runs Playwright at logical 1280×600 with DPR=3 (true 4K bitmap), trims first 0.5 s with ffmpeg so the title is on frame 0.
  • static/index.html — gates demo.js import on ?demo; sets html.demo + flat background synchronously so the page never flashes the gradient.
  • static/guide.js — exposes window.__demo hook (gated on ?demo); adds 3↔5 to the `isMorph` list so Personal Values → Compare animates smoothly.
  • .gitignore — excludes `spark-demo-*.{mp4,webm}` outputs and `_video/` temp dir.
  • README.md — "Recording a demo clip" section.

Test plan

  • `python3 -m http.server -d static 8000` — normal mode still works at `localhost:8000`, no demo hooks visible.
  • `localhost:8000/?demo` — auto-walkthrough runs: title (~2.5 s) → Implicit Values → Personal Values → Compare. No TOC/nav/Back-Next visible.
  • `pip install playwright && playwright install chromium && python3 record_demo.py` — produces `spark-demo-4k.webm` with title on frame 0.
  • `ffmpeg` MP4/HD conversions from the README produce playable files.

Adds an auto-piloted walkthrough triggered by appending ?demo to the URL,
plus a Playwright-based recording driver. Used to produce a short demo
video showing scenario → values → side-by-side compare with view-transition
morphs between screens.

Implementation:
- guide.js exposes a window.__demo hook (gated on ?demo) and adds the
  3↔5 step pair to the morph list so the Personal Values → Compare jump
  animates smoothly.
- demo.js polls for the hook, scripts goToStep/setValue with timed waits,
  shows a title intro, and signals completion via body.dataset.demoDone.
- demo.css hides the top nav / TOC / Back-Next buttons, flattens the
  background gradient (compresses better), centers headers, and slows
  view-transition animations to 1.4s so the morph reads on video.
- index.html gates demo.js loading on ?demo and sets html.demo + the flat
  background synchronously so the page never flashes the gradient.
- record_demo.py serves static/ on a local port, drives Playwright at
  logical 1280×600 with DPR=3 (true 4K bitmap), waits for the demo to
  signal done, and trims the first 0.5s with ffmpeg so the title is on
  frame 0.

Outputs are gitignored.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant