remove transition with propertyName

PHOTO EMBED

Wed Apr 03 2024 23:48:09 GMT+0000 (Coordinated Universal Time)

Saved by @davidmchale #javascript #transitionend

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)
content_copyCOPY