From e2c6ebd2159d9583a5d7bcd3cda7c039b4e66910 Mon Sep 17 00:00:00 2001 From: LC Carrier Date: Sun, 14 Jul 2019 10:17:42 -0400 Subject: [PATCH] updated html file with solution --- 01 - JavaScript Drum Kit/index-START.html | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 4070d32767..1b824ca99b 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -58,9 +58,27 @@ +function removeTransition(e) { + if (e.propertyName !== 'transform') return; // skip if it's not a transform + console.log(e.propertyName); + this.classList.remove('playing'); + } + +const keys = document.querySelectorAll('.key'); +keys.forEach(key => key.addEventListener('transitionend', removeTransition)); +window.addEventListener('keydown', playSound); +