feat(console): persistent music, per-theme tunes - #5
Merged
Conversation
Music state now survives navigation and console close: - persist `music`/`musicVolume` to localStorage, restore on load (falls back to first user gesture when autoplay is blocked) - closing the console no longer stops playback; `music stop` does Tunes extracted to assets/js/tunes.js, keyed by theme. Engine reads the active theme's tune and swaps live on `theme set`: - default (light/dark/auto): original C-major triangle, unchanged - dracula: A-minor square lead, slower — moody but chill - valentine: F-major sine lead — soft and sweet console.html concats tunes.js + console.js so window.TUNES exists before the engine reads it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RbMGFzZfHUfbhid95FjBKb
- add a distinct `paper` soundtrack (D-major folk, plagal turnaround) - extend dracula/valentine to 8-bar phrases that resolve to the tonic so the loop wraps seamlessly - fix music not playing: the load-time restore called on() with no user gesture, leaving resume() pending while `playing` stayed true, which wedged every later `music play`. Restore now arms a one-time gesture listener instead; on() clears any stale interval. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RbMGFzZfHUfbhid95FjBKb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Console soundtrack now persists across the site and has a tune per theme.
Persistence
music) andmusicVolumesaved tolocalStorage, restored on load.on()at load — which previously leftresume()pending whileplayingstayedtrue, wedging every latermusic play.music stopdoes.Per-theme tunes (
assets/js/tunes.js, new)theme set.default(light/dark/auto): original C-major, unchanged.dracula: A-minor, hollow square lead, slower — moody.valentine: F-major, soft sine lead — sweet.paper: D-major folk, triangle lead, plagal turnaround — cozy.console.htmlconcatstunes.js+console.jssowindow.TUNESexists before the engine reads it.Test
node assets/js/console.jsself-check passes.pnpm buildclean; bundle carries all tunes and is referenced in HTML.🤖 Generated with Claude Code
https://claude.ai/code/session_01RbMGFzZfHUfbhid95FjBKb