diff --git a/static/play.svg b/src/lib/icons/play.svg similarity index 100% rename from static/play.svg rename to src/lib/icons/play.svg diff --git a/static/stop.svg b/src/lib/icons/stop.svg similarity index 100% rename from static/stop.svg rename to src/lib/icons/stop.svg diff --git a/src/lib/voice.svelte b/src/lib/voice.svelte index d27182e..98efb4d 100644 --- a/src/lib/voice.svelte +++ b/src/lib/voice.svelte @@ -3,13 +3,15 @@ import * as Tone from 'tone'; import Volume from '$lib/volume.svelte'; import Frequency from '$lib/frequency.svelte'; + import play from '$lib/icons/play.svg'; + import stop from '$lib/icons/stop.svg'; export let volume = -100; export let frequency = 440; let osc: Tone.Oscillator | undefined = undefined; - $: status = osc?.state == 'started' ? '/stop.svg' : '/play.svg'; + $: icon = osc?.state == 'started' ? stop : play; onMount(() => { if (osc) return; @@ -22,7 +24,7 @@ const toggleOsc = () => { if (!osc) return; osc.state === 'started' ? osc.stop() : osc.start(); - status = osc.state === 'started' ? '/stop.svg' : '/play.svg'; + icon = osc.state === 'started' ? stop : play; }; @@ -30,7 +32,7 @@ {#if osc}

Voice

{#if osc.state === 'started'}