about summary refs log tree commit diff
path: root/website/sandbox/learnpianochords
AgeCommit message (Collapse)AuthorFilesLines
2020-04-19 Responsively size UIWilliam Carroll5-12/+84
TL;DR: scale down UI for non-mobile devices. I pulled the screen resolution for my phone, the Google Pixel 4, off of the internet. I created a device profile in Chrome to develop this application specifically for my phone. To my surprise, when I opened the app on my phone, many of elements that looked good in Google Chrome, looked askew on my phone. I needed to troubleshoot. Here's how I did that: I used Tailwind to responsively color the bg for each breakpoint to see if my device was sm, md, lg, xl (according to Tailwind's breakpoint terminology). After reading Tailwind's documentation and comparing their breakpoints with my Pixel 4's width (i.e. 1080px), I figured that my device would be lg. It's not; it's md, which I confirmed by using ngrok to load localhost:8000 on my phone and see that the background-color was "md:bg-green-600". I'm still unsure why my device is not lg, but knowing that my device was md was enough to fix many of the styling issues. My current theory is that while my screen's resolution is 1080 wide, the pixel density affects the media query for the breakpoint.
2020-04-19 Set the selectedChord to Nothing when setting a keyWilliam Carroll1-0/+1
This helps us avoid showing a chord from a key that the user did not whitelist.
2020-04-19 Prune {Select,Deselect}AllKeys actionsWilliam Carroll1-19/+0
Removing more unused code attempting to focus this app's scope.
2020-04-19 Highlight root note of each chordWilliam Carroll2-37/+70
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
2020-04-18 Remove horizontal paddingWilliam Carroll1-2/+2
Google Chrome's device preview doesn't resemble what I see when I use my phone to visit this page.
2020-04-18 Create Overview for Learn Piano ChordsWilliam Carroll2-2/+94
Since I've published this, I should include an Overview page to orient potential users. This Overview could be better -- as could many things with this app -- but it's a start, and I'm seeking small wins.
2020-04-18 Remove duplicate step from READMEWilliam Carroll1-2/+1
I mention setting tempo twice... whoops.
2020-04-18 Prefer "Tap" to "Press"William Carroll1-1/+1
I'm preferring the verb "tap" to "press".
2020-04-18 Debug unresponsive button press for selectKeyWilliam Carroll1-2/+2
Observed problem: Tapping "C major, A minor" key, which LPC sets by default, does not unset it. Bug: handleClick passed the relativeMinor Key but the default value in State.Model is the C Major key. We would toggled b/w [Cmajor] -> [Cmajor,Aminor], and because toggled checked if either Cmajor or Aminor was present, it was always true. Solution: Check relativeMajor to set toggled.
2020-04-18 Tidy appWilliam Carroll7-538/+498
Now that I have a deployed an MVP of my app, I am tidying things up to support the next phase of development. TL;DR: - Moved application Model-related code into State module - Moved each View into its own module - Deleted unused ChordInspector component - Deleted unused Msg's, {Increase,Decrease}Tempo - Deleted misc unused code
2020-04-18 Ignore Main.min.jsWilliam Carroll1-1/+1
The elm2nix expression builds my code as Main.min.js. As such, I changed my index.html to require Main.min.js instead of elm.js. When I run elm-live now, I make sure that I output Main.min.js as well. I need to gitignore this to exclude it from my repository though.
2020-04-18 Orient "Press to practice" buttonWilliam Carroll2-22/+58
Rotate the "Press to practice" copy to ensure that it is readable in landscape mode.
2020-04-18 "Chord Drill Sergeant" -> "Learn Piano Chords"William Carroll19-0/+2390
In the spirit of "keep it simple, stupid", I am naming this application as closely to the functionality as I can imagine.