about summary refs log tree commit diff
path: root/website/sandbox/learnpianochords/src/Practice.elm
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-04-18T23·21+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-04-18T23·21+0100
commit11b140b6ae9e65b26c33968596a30a0449ec1afa (patch)
tree6abe96713cd141bd4c92c3780aa327317a3b8b45 /website/sandbox/learnpianochords/src/Practice.elm
parentc6132ab1d6df6193d130d59fdaf9eef3e94d57b8 (diff)
Highlight root note of each chord
Refactor the Piano component to highlight the root note of each chord. If this
makes things too easy, I can support this as a preference.

Also:
- Reduced the number of keys that the piano displays and increased the key
  thickness to reclaim the space
- Preferred using Tailwind selectors instead of inline styling where applicable
- Call List.reverse on the keys to ensure that the top-most note is a lower note
  than the bottom-most note

TODO:
- Support showing only the name of the chord and not just the notes that
  comprise that chord
- Rewrite the function that generates the chords for a given range of notes
- Consider supporting a dark mode
Diffstat (limited to 'website/sandbox/learnpianochords/src/Practice.elm')
-rw-r--r--website/sandbox/learnpianochords/src/Practice.elm6
1 files changed, 3 insertions, 3 deletions
diff --git a/website/sandbox/learnpianochords/src/Practice.elm b/website/sandbox/learnpianochords/src/Practice.elm
index c0f5ffcfded0..86977859b85b 100644
--- a/website/sandbox/learnpianochords/src/Practice.elm
+++ b/website/sandbox/learnpianochords/src/Practice.elm
@@ -37,8 +37,8 @@ render model =
             , isVisible = model.isPaused
             }
         , Piano.render
-            { highlight = model.selectedChord |> Maybe.andThen Theory.notesForChord |> Maybe.withDefault []
-            , start = model.firstNote
-            , end = model.lastNote
+            { chord = model.selectedChord
+            , firstNote = model.firstNote
+            , lastNote = model.lastNote
             }
         ]