Skip to content

feat(reveal): play a sound effect on card generation#77

Open
nazarli-shabnam wants to merge 1 commit into
Younesfdj:masterfrom
nazarli-shabnam:feat/reveal-sound-effect
Open

feat(reveal): play a sound effect on card generation#77
nazarli-shabnam wants to merge 1 commit into
Younesfdj:masterfrom
nazarli-shabnam:feat/reveal-sound-effect

Conversation

@nazarli-shabnam

Copy link
Copy Markdown

Summary

  • Plays 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) — reusing the same useReveal phase machine that already drives the confetti burst in ResultView.tsx.
  • Sounds are generated on the fly with the Web Audio API (lib/sound.ts) rather than bundling .mp3/.wav assets, avoiding licensing concerns and keeping the dependency-free style of the existing lib/confetti.ts.
  • Adds a mute/unmute toggle next to the GitHub star button in the result top bar, persisted to localStorage (gitfut:muted) using the same defensive try/catch pattern as the existing seenHome/WhatsNew storage reads.

Closes #10

Test plan

  • npx vitest run — full suite green (242 tests, including new tests/sound.test.ts)
  • npm run lint — no new warnings/errors
  • npm run build — production build succeeds
  • Manual: npm 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 in lib/reveal.ts (bronze/silver/gold → single chime on ignite; totw/toty/icon/founder → chime on ignite + arpeggio on burst)

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
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.

Add sound upon the generation of card

1 participant