diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 4070d32767..db9c727663 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -1,10 +1,12 @@ + JS Drum Kit + @@ -57,10 +59,67 @@ - + highlightBox(code); + }); + + + //window.addEventListener('keyup', function keyUp(ev) { + //let code = ev.keyCode; + + //removeHighlightBox(code); + // let soundSelector = `audio[data-key='${code}']`; + // let audioElement = document.querySelector(soundSelector); + // if (audioElement != undefined) audioElement.play(); + //}); + + + } + + function setupTransition(selector) { + let keyBoxes = document.querySelectorAll('.key'); + keyBoxes.forEach(keyBox => keyBox.addEventListener('transitionend', removeHighlightBox)); + } + + setupSound(); + setupTransition(); + - + + \ No newline at end of file