Drum sounds are played upon user interaction.
- Modify file structure so that it's a bit more organized
- Modify markup so that drum/key divs are buttons
-
Modify styles so that highlighted styles are applied to theFound out that I cannot trigger an "active" event:activepseudo-class instead of a 'playing' class - Enable clicking and tabbing/entering to play sounds as well
- Use
keypressinstead ofkeydown, making markup easier to understand and event listener less likely to fire when not needed - Remove 'playing' class on the audios'
endedevent instead of listening fortransitionendon some specific style change that may be prone to change
- Cannot trigger an element to be
activewith JS transitionendevent exists- Some ES6 syntax
- Reinforce some understanding about the differences in
keypressinstead ofkeydown:keypressdoesn't trigger for keys that don't produce a characterkeycodeandcoderespectively, the former is a numerical code (e.g. "70") and the latter is a readable one (e.g. "KeyF")