Tile work

This commit is contained in:
2024-04-25 23:09:24 +02:00
parent 890badac15
commit 1851cc4782
7 changed files with 172 additions and 133 deletions

View File

@ -0,0 +1,23 @@
<template>
<audio ref="bgm" id="bgm" src="@/assets/sound/bgm.mp3" loop autoplay></audio>
</template>
<script setup>
import { ref, onMounted } from 'vue'
const bgm = ref(null)
const bgmStart = () => bgm.value.play();
onMounted(() => {
// check if bgm is playing already and do nothing
if (bgm.value.paused) {
window.addEventListener('click', () => bgm.value.play())
window.addEventListener('keydown', () => bgm.value.play())
window.addEventListener('mousemove', () => bgm.value.play())
}
})
</script>