window.addEventListener('keydown', function(e) {
  let audio = document.querySelector(`audio[data-key='${e.keyCode}']`)
	let key = document.querySelector(`.key[data-key='${e.keyCode}']`)
	if (!audio) return
  audio.currentTime = 0
  audio.play()
  key.classList.add('playing')
})
window.addEventListener('keydown', function(e) {
  let audio = document.querySelector(`audio[data-key='${e.keyCode}']`)
	let key = document.querySelector(`.key[data-key='${e.keyCode}']`)
	if (!audio) return
  audio.currentTime = 0
  audio.play()
  key.classList.add('playing')
})

function removeTransition(e) {
  if (e.propertyName !== 'transform')
  this.classList.remove('playing')
}

let keys = document.querySelectorAll('.key')
keys.forEach(key => key.addEventListener('transitionend', removeTransition))
Add transitionend event to remove playing class
Add transitionend event to remove playing class
