function removeTransition(e)
{
if(e.propertyName!=='transform')
return;
this.classList.remove('playing');
}
const keys=document.queryselectorAll('.key');
keys.forEach(key=>key.removeEventListener('transitioned',removeTransition));
window.addEventListener('keydown',removeTransition);
here is the function for removing transition where if the user will stop pressing the key or button on the keyboard will remove transition and box will become normal