addEventListener
писать два события.click touch
.active{
animation-name: toggle;
animation-duration: 0.3s;
animation-timing-function: ease-in-out;
}
@keyframes toggle{
50% {transform: scale(0.7)}
100% {transform: scale(1)}
}
leftBtn.addEventListener('click', (evt) => {
leftBtn.classList.add('active')
setTimeout(()=>{
leftBtn.classList.remove('active')
}, 300)
})