Skip to content

Commit 845bb1a

Browse files
committed
add the key selector
1 parent b695459 commit 845bb1a

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

src/lib/KeySelector.svelte

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
let note = key;
66
let modifier = null;
77
8-
const notes = ["E", "F", "G", "A", "B", "C", "D"];
8+
const notes = ["C", "D", "E", "F", "G", "A", "B"];
99
1010
$: key = [note, modifier].join("");
1111
$: tonic.set(key);
@@ -17,7 +17,7 @@
1717

1818
<div class="flex items-center space-x-5">
1919
<div>
20-
<select name="note" bind:value={note} class="rounded-lg border-gray-300">
20+
<select name="note" bind:value={note} class=" border-gray-300">
2121
{#each notes as note}
2222
<option value={note}>{note}</option>
2323
{/each}
@@ -29,8 +29,7 @@
2929
bind:group={modifier}
3030
on:click={toggleEnabled}
3131
value="b"
32-
class="mr-1"
33-
/>
32+
class="mr-1" />
3433
<span class="text-2xl">♭</span>
3534
</div>
3635
<div class="flex items-center">
@@ -39,8 +38,7 @@
3938
bind:group={modifier}
4039
on:click={toggleEnabled}
4140
value="#"
42-
class="mr-1"
43-
/>
41+
class="mr-1" />
4442
<span>#</span>
4543
</div>
4644
</div>

src/routes/+page.svelte

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,26 @@
33
import frets from "../lib/frets";
44
import TuningSelector from "../lib/TuningSelector.svelte";
55
import FretBoard from "../lib/FretBoard.svelte";
6+
import KeySelector from "../lib/KeySelector.svelte";
67
78
let tuning = $state("Standard");
8-
let fretData = $derived(frets(tunings.get(tuning), 13));
9+
let fretData = $derived(frets(tunings.get(tuning), 16));
910
</script>
1011

1112
<svelte:head>
1213
<title>Hey there</title>
1314
<meta name="Description" content="Hey there guitar scale" />
1415
</svelte:head>
1516

16-
<div class="flex gap-5 *:p-5 border-b border-gray-200">
17+
<div class="flex *:p-5 *:border-r *:border-gray-200 border-b border-gray-200">
1718
<div>
1819
<TuningSelector bind:value={tuning} />
1920
</div>
21+
<div>
22+
<KeySelector key="C" />
23+
</div>
2024
</div>
2125

22-
<div class=" m-10 h-60 overflow-clip">
26+
<div class=" m-10 h-60">
2327
<FretBoard {fretData} />
2428
</div>

0 commit comments

Comments
 (0)