diff --git a/astro/public/scripts/sound.js b/astro/public/scripts/sound.js index ca8b749..4746b7f 100644 --- a/astro/public/scripts/sound.js +++ b/astro/public/scripts/sound.js @@ -1,28 +1,39 @@ // Sound effects function PlaySound(soundobj) { - const thissound = document.getElementById(soundobj); - thissound.play(); - } - - function StopSound(soundobj) { - const thissound = document.getElementById(soundobj); - thissound.pause(); - thissound.currentTime = 0; - } - - const audio = new Audio("/assets/sounds/ui/zapsplat_multimedia_button_click_004_68776.mp3"); - const buttons = document.querySelectorAll("button"); - const links = document.querySelectorAll("a"); - - // biome-ignore lint/complexity/noForEach: - links.forEach(a => { - a.addEventListener("click", () => { - audio.play(); - }) - }) - - // biome-ignore lint/complexity/noForEach: - buttons.forEach(button => { - button.addEventListener("click", () => { - audio.play(); - });}) \ No newline at end of file + const thissound = document.getElementById(soundobj); + thissound.play(); +} + +function StopSound(soundobj) { + const thissound = document.getElementById(soundobj); + thissound.pause(); + thissound.currentTime = 0; +} + +const audio = new Audio( + "/assets/sounds/ui/zapsplat_multimedia_button_click_004_68776.mp3" +); +const buttons = document.querySelectorAll("button"); +const links = document.querySelectorAll("a"); +const image = document.querySelectorAll("img"); + +// biome-ignore lint/complexity/noForEach: +links.forEach((a) => { + a.addEventListener("click", () => { + audio.play(); + }); +}); + +// biome-ignore lint/complexity/noForEach: +buttons.forEach((button) => { + button.addEventListener("click", () => { + audio.play(); + }); +}); + +// biome-ignore lint/complexity/noForEach: +image.forEach((button) => { + button.addEventListener("click", () => { + audio.play(); + }); +});