JSFiddle - React, Tailwind, and code Playground

by eget teteete

HTML

<div class="log">lor</div>

CSS

.log {
  width: 50px;
  height: 50px;
  margin: 0 auto;
  background-color: grey;
  text-align: center;
  animation: myMove 2s linear 0s 1 normal;
}

.rotate-scale-up {
  -webkit-animation: rotate-scale-up 0.65s linear both;
  animation: rotate-scale-up 0.65s linear both;
}

JavaScript

const losg = document.querySelector('.log');
losg.addEventListener('click', () => {
  losg.classList.add('rotate-scale-up');
  setTimeout(() => {
    losg.classList.remove('rotate-scale-up');
  }, 500)
})