Skip to content

Add the script that makes the README's sheets screenshot - #11

Merged
AndrianLeah merged 1 commit into
masterfrom
claude/screenshot-scripts
Dec 1, 2026
Merged

AndrianLeah merged 1 commit into
masterfrom
claude/screenshot-scripts

Conversation

@AndrianLeah

Copy link
Copy Markdown
Owner

The script behind PR #6 was never committed, so PR #10 had to rebuild docs/screenshots/sheets.webp from the old picture. This keeps that script in the repository, in scripts/screenshots/.

node scripts/screenshots/sheets.mjs
  • sheets.mjs builds the app, serves it with vite preview and opens it in headless Chrome as a 390 × 844 phone at 2x. An oscillator stands in for the microphone: it takes the tuner through E2, A2 and D3 (each confirmed) to a flat G3. The script then takes the list of tunings (dark) and Settings (light), sets them in phone frames and writes the WebP in place. It stops with an error if the three strings were not confirmed.
  • chrome.mjs starts headless Chrome and drives it through the DevTools Protocol with Node's own WebSocket, so there is no new dependency. It finds Chrome on Windows, macOS and Linux, or takes CHROME_PATH.
  • sheets.html is the composition (1100 × 920): the dark background under a 45 % veil of --bg-base, the screens at 0.9× in a 10 px bezel.
  • README.md there explains it, and a line under the README's screenshots points to it.

It needs Node 22 or later (for WebSocket) and Google Chrome. The app is driven through its own markup (the tuning pill, the gear's label, Start, the Light segment), so a change there means a change in the script.

Checks

  • Run twice from this branch: the output matched the picture on master within 0.3–0.6/255 on average, so sheets.webp is not changed here.
  • eslint . passes and Prettier is clean on the new files.
  • Nothing in src/ changes.

The script behind PR #6 was never committed, so PR #10 had to piece
docs/screenshots/sheets.webp together again from the old picture.
scripts/screenshots now keeps it:

- sheets.mjs builds the app, serves it with vite preview and takes the
  two screens in headless Chrome as a 390 x 844 phone at 2x, with an
  oscillator in place of the microphone (E2, A2 and D3 confirmed, G3
  flat), then sets them in phone frames and writes the WebP.
- chrome.mjs starts headless Chrome and drives it through the DevTools
  Protocol with Node's own WebSocket: no new dependency.
- sheets.html is the composition, 1100 x 920.

Run it with `node scripts/screenshots/sheets.mjs` (Node 22 or later,
Google Chrome or CHROME_PATH). It reproduces the picture on master
within 1/255 on average, so the image itself is unchanged.
@AndrianLeah
AndrianLeah merged commit 05898ee into master Dec 1, 2026
1 check passed
@AndrianLeah
AndrianLeah deleted the claude/screenshot-scripts branch December 1, 2026 19:43
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