Implement sound settings update and integrate sound context in sightings widget

This commit is contained in:
2025-09-30 15:32:00 +01:00
parent 2aeae761f8
commit 1b7b2eec37
6 changed files with 36 additions and 21 deletions

View File

@@ -1,3 +1,16 @@
import switchSound from "../assets/sounds/ui/switch.mp3";
import popup from "../assets/sounds/ui/popup_open.mp3";
import notification from "../assets/sounds/ui/notification.mp3";
export function getSoundFileName(name: string) {
const sounds: Record<string, string> = {
switch: switchSound,
popup: popup,
notification: notification,
};
return sounds[name] ?? null;
}
const randomChars = () => {
const uppercaseAsciiStart = 65;
const letterIndex = Math.floor(Math.random() * 26);