Skip to content

Commit

Permalink
fix: icons in $lib
Browse files Browse the repository at this point in the history
  • Loading branch information
fcastrovilli committed Mar 12, 2024
1 parent 2dd3486 commit 4a55498
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
File renamed without changes
File renamed without changes
8 changes: 5 additions & 3 deletions src/lib/voice.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -22,15 +24,15 @@
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;
};
</script>

<div class="card variant-ghost p-4 w-full flex flex-col h-full mx-auto justify-center items-center">
{#if osc}
<p>Voice</p>
<button on:click={toggleOsc} type="button" class="btn btn-icon variant-ghost uppercase">
<img src={status} alt="" />
<img src={icon} alt="" />
</button>

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

0 comments on commit 4a55498

Please sign in to comment.