feat: add in-game sound effects and browser notifications (#27)
CI / Lint, Build & Test (pull_request) Failing after 5s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Failing after 4s

Adds Web Audio API sound effects and browser notifications for key game
events: achievement unlocked, quest completed, quest failed, boss
defeated, prestige, transcendence, and apotheosis. Both features are
toggled via profile settings, with notification permission requested
on first enable.
This commit is contained in:
2026-03-08 15:06:28 -07:00
committed by Naomi Carrigan
parent 746fd36fb5
commit 49bfc6a109
9 changed files with 409 additions and 2 deletions
@@ -38,10 +38,22 @@ interface ProfileSettings {
* Whether this player appears on the public leaderboards.
*/
showOnLeaderboards: boolean;
/**
* Whether in-game sound effects are enabled.
*/
enableSounds: boolean;
/**
* Whether browser system notifications are enabled.
*/
enableNotifications: boolean;
}
// eslint-disable-next-line @typescript-eslint/naming-convention -- intentional constant name
const DEFAULT_PROFILE_SETTINGS: ProfileSettings = {
enableNotifications: false,
enableSounds: false,
numberFormat: "suffix",
showAchievementsUnlocked: true,
showAdventurersRecruited: true,
@@ -20,6 +20,8 @@ describe("DEFAULT_PROFILE_SETTINGS", () => {
expect(DEFAULT_PROFILE_SETTINGS.showAdventurersRecruited).toBe(true);
expect(DEFAULT_PROFILE_SETTINGS.showAchievementsUnlocked).toBe(true);
expect(DEFAULT_PROFILE_SETTINGS.showOnLeaderboards).toBe(true);
expect(DEFAULT_PROFILE_SETTINGS.enableSounds).toBe(false);
expect(DEFAULT_PROFILE_SETTINGS.enableNotifications).toBe(false);
});
it("defaults numberFormat to suffix", () => {