diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 08889f8..c49c468 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -126,11 +126,20 @@ source.pause(); } - $effect(() => { - if (source) { - source.volume = volume; + function changeVolume(change: number) { + if (volume + change > 1) { + volume = 1; + } + else if (volume + change < 0) { + volume = 0; + } + else { + volume = toFixedNumber(volume + change, 2, 10) ; + } + + if (currentSong.source) { + currentSong.source.volume = volume; } - }); function progressPercent() { return progress / duration * 100 || 0; @@ -175,6 +184,8 @@
Volume: {volume}
{displayTime(progress)}/{displayTime(duration)}
{progressPercent().toFixed(2)}%
+ + {#if isPaused} {:else}