-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/background music and sounds (#33)
Background music, click sound for buttons, error notification sound, sound for chat notifications and success notification are added --------- Co-authored-by: eisenmls <[email protected]>
- Loading branch information
1 parent
74a6065
commit 1da9e1d
Showing
13 changed files
with
106 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
<script setup lang="ts"> | ||
import clickSoundSource from '/src/assets/music/click_sound.mp3'; | ||
const clickSound = new Audio(clickSoundSource); | ||
function closeGame() { | ||
window.parent.postMessage('CLOSE ME'); | ||
} | ||
async function handleCloseGame() { | ||
await playClickSound(); | ||
setTimeout(() => { | ||
closeGame(); | ||
}, 500); | ||
} | ||
function playClickSound(){ | ||
clickSound.play(); | ||
} | ||
</script> | ||
|
||
<template> | ||
<main> | ||
<div class="text-center position-absolute top-50 start-50 translate-middle"> | ||
<h2>You finished the Game!</h2> | ||
<b-button variant="danger" id="close-button" v-on:click="closeGame"> Back to game </b-button> | ||
<b-button variant="danger" id="close-button" v-on:click="handleCloseGame"> Back to game </b-button> | ||
</div> | ||
</main> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters