Skip to content

Commit 672d637

Browse files
committed
improve styles and layout of chords
1 parent 53572ba commit 672d637

4 files changed

Lines changed: 19 additions & 11 deletions

File tree

src/frets/Chord.svelte

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
const chart = new SVGuitarChord(el);
5959
chart
6060
.configure({
61-
title: chordName,
6261
strings: tuning.length,
6362
frets: frets,
6463
position: chordData.position,
@@ -70,7 +69,7 @@
7069
fretSize: 1.1,
7170
fretColor: chordColor,
7271
color: chordColor,
73-
titleFontSize: 28,
72+
titleFontSize: 40,
7473
titleBottomMargin: 10,
7574
fretLabelFontSize: 20,
7675
tuning,
@@ -88,18 +87,27 @@
8887
});
8988
</script>
9089
91-
<button
92-
class="flex cursor-pointer w-full h-full"
93-
aria-label="Play {chordName} chord at position {position}"
94-
onclick={playChord}>
95-
<div
90+
<div
91+
class="flex flex-col justify-center items-center relative w-full h-full p-1">
92+
<a
9693
bind:clientWidth={width}
9794
bind:clientHeight={height}
9895
bind:this={el}
9996
data-chord={chordName}
97+
href="#"
98+
title="Chord diagram for {chordName}"
10099
class="w-full h-full flex">
100+
</a>
101+
<div class="flex w-full justify-center items-center py-2">
102+
<button
103+
class="flex justify-center items-center gap-1 w-full h-fit p-1 mx-5 text-xs cursor-pointer border border-gray-500 bg-gray-200 rounded-full hover:text-white hover:bg-green-600 hover:border-green-800"
104+
aria-label="Play {chordName} chord at position {position}"
105+
onclick={playChord}>
106+
<div class="font-medium">{chordName}</div>
107+
<span></span>
108+
</button>
101109
</div>
102-
</button>
110+
</div>
103111
104112
<style>
105113
:global(.barre-rectangle) {

src/lib/FretNote.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
}
4343
4444
.in-scale .fret-note-background {
45-
@apply fill-sky-600 stroke-0 stroke-sky-800 dark:fill-blue-900 dark:stroke-sky-800;
45+
@apply fill-blue-400 stroke-0 stroke-sky-800 dark:fill-blue-900 dark:stroke-sky-800;
4646
}
4747
4848
.in-scale .fret-note-text {

src/lib/ScaleChords.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
class="text-xs text-gray-500 grid grid-cols-4 md:grid-cols-7 gap-5 dark:text-gray-400">
2626
{#each chords as chord}
2727
<div
28-
class="bg-gray-100 py-5 transition-all dark:bg-blue-900/20 dark:border dark:border-blue-900/50 dark:hover:bg-blue-900/40 rounded">
28+
class="bg-gray-50 border border-transparent hover:bg-gray-100 hover:border-gray-200 transition-all dark:bg-blue-900/20 dark:border dark:border-blue-900/50 dark:hover:bg-blue-900/40 rounded">
2929
<Chord chordName={chord} />
3030
</div>
3131
{/each}

src/routes/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
</div>
128128
129129
{#if triads.length > 0}
130-
<div class="relative bg-gray-50 p-5 dark:bg-transparent dark:border-blue-900">
130+
<div class="relative px-5 dark:border-blue-900">
131131
<ScaleChords scale={scaleObj} />
132132
</div>
133133
{/if}

0 commit comments

Comments
 (0)