JSFiddle - React, Tailwind, and code Playground

HTML

<div class="circle">Кликни на меня</div>

CSS

@keyframes circle-animate {
  0% {
    margin: 0;
  }
  
  50% {
    margin-left: 200px;
    margin-top: 0;
  }
  
  to {
    margin-left: 200px;
    margin-top: 50px;
  }
}

.circle {
  width: 90px;
  height: 90px;
  background-color: #fff;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 0 25px 3px #000;
}

.circle-animate {
  animation-name: circle-animate;
  animation-duration: 2s;
  animation-timing-function: ease;
  animation-fill-mode: forwards;
}

body {
  background-color: gray;
}

JavaScript

const circle = document.querySelector('.circle');
circle.addEventListener('click', function() {
    this.classList.toggle('circle-animate')
})