<div class="squircle"></div>
html,
body {
  height: 100%;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

.squircle {
  height: 3rem;
  width: 3rem;
  background-color: #525ddc;
}
anime({
  targets: '.squircle',
  
  /** Properties to animate */
  borderRadius: ['0%', '50%'],
  scale: 2,
  rotate: 360,

  /** Animation settings */
  loop: true,
  direction: 'alternate',
  duration: 2000,
  delay: 1000,
});
View Compiled

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