This commit is contained in:
2025-05-14 13:37:59 +02:00
23 changed files with 2284 additions and 34 deletions

View File

@@ -1,9 +1,9 @@
<script lang="ts">
import { onMount } from "svelte";
import ezppLogo from "../../../../assets/logo.png";
import { osudirect } from "@/api/osudirect";
import { gameSounds, playAudio } from "@/utils";
import { BeatmapDecoder } from "osu-parsers";
import { onMount } from "svelte";
type logoProps = {
beatmapId: number;
@@ -18,6 +18,8 @@
let lastTimeout: number | undefined = undefined;
onMount(async () => {
gameSounds.preload();
const beatmapData = await osudirect.osu(beatmapId);
if (beatmapData) {
const decoder = new BeatmapDecoder();
@@ -69,16 +71,12 @@
// Wait for audio to be ready before starting playback and syncing
audio.addEventListener("canplay", async () => {
audio.addEventListener("play", syncHeartbeat);
audio.addEventListener("ended", async() => await audio.play());
audio.addEventListener("ended", async () => await audio.play());
await audio.play();
syncHeartbeat();
});
}
});
onMount(() => {
gameSounds.preload();
});
</script>
<div