Skip to content

Commit 80049bc

Browse files
committed
IDK what change but I ensure to commit
1 parent 91f0274 commit 80049bc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

01 - JavaScript Drum Kit/index-START.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@
5959

6060
<script>
6161

62+
63+
6264
function playSound(e){
65+
console.log(e);
6366
const audio = document.querySelector(`audio[data-key="${e.keyCode}"]`);
6467
const key = document.querySelector(`.key[data-key="${e.keyCode}"]`);
6568
if(!audio) return; //stop the function from running all together
@@ -76,8 +79,8 @@
7679

7780
const keys = document.querySelectorAll('.key');
7881
keys.forEach(key => key.addEventListener('transitionend',removeTransititon));
79-
window.addEventListener('keydown', playSound);
8082

83+
document.addEventListener('keydown', playSound);
8184
</script>
8285

8386

0 commit comments

Comments
 (0)