function removeTransition(e){ const keys = [...document.querySelectorAll('.key')]; keys.forEach((key) => key.addEventListener('transitionend', function(e){ // console.log(e.propertyName) e.propertyName === 'transform' ? key.classList.remove('playing') : null; })) } // use the load listener window.addEventListener('load', removeTransition)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter