feat(reveal): play a sound effect on card generation#77
Open
nazarli-shabnam wants to merge 1 commit into
Open
Conversation
Adds a short synthesized chime when a card's reveal reaches the ignite phase, and a brighter ascending arpeggio for rare tiers that reach burst (totw/toty/icon/founder) — mirroring the existing confetti trigger. Sounds are generated with the Web Audio API rather than bundled audio files, avoiding licensing/asset concerns. Adds a mute toggle next to the GitHub star button, persisted to localStorage. Closes Younesfdj#10
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.
Summary
ignitephase, and a brighter ascending arpeggio for rare tiers that reachburst(totw/toty/icon/founder) — reusing the sameuseRevealphase machine that already drives the confetti burst inResultView.tsx.lib/sound.ts) rather than bundling.mp3/.wavassets, avoiding licensing concerns and keeping the dependency-free style of the existinglib/confetti.ts.localStorage(gitfut:muted) using the same defensive try/catch pattern as the existingseenHome/WhatsNewstorage reads.Closes #10
Test plan
npx vitest run— full suite green (242 tests, including newtests/sound.test.ts)npm run lint— no new warnings/errorsnpm run build— production build succeedsnpm run dev, loaded a real profile page, confirmed the mute button renders and toggles state; confetti/sound trigger logic verified against the reveal phase sequence inlib/reveal.ts(bronze/silver/gold → single chime on ignite; totw/toty/icon/founder → chime on ignite + arpeggio on burst)