1
0
forked from noxious/client

#209: Play sound when a button is pressed

This commit is contained in:
Dennis Postma 2024-11-02 13:51:07 +01:00
parent 43c0f0ab1e
commit a299d5dc55

View File

@ -37,4 +37,13 @@ watch(
gameStore.game.loadedAssets = []
}
)
// #209: Play sound when a button is pressed
addEventListener('click', (event) => {
if (event.target !instanceof HTMLButtonElement) {
return
}
const audio = new Audio('/assets/music/click-btn.mp3')
audio.play()
})
</script>