<div class="box" id="elem"></div>
.box{
  background-color: #ea0f9b;
  width: 80px;
  height: 80px;
  cursor: pointer;
}
        
          var cssSelector = anime({
  targets: '#elem',
  translateX: 200,
  rotate: '1turn',
  scale: 1/2,
  easing: 'easeInOutQuart',
  duration: 2000,
  direction: 'normal',
  loop: true
});
        
      

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/animejs/2.2.0/anime.min.js