.box
.box
View Compiled
*
  box-sizing border-box

body
  display flex
  align-items center
  justify-content center
  gap 12.5vmin
  min-height 100vh
  
.box
  height 25vmin
  aspect-ratio 1 / 1
  background hsl(0, 90%, 75%)
  
  &:nth-of-type(2)
    background hsl(210, 90%, 75%)
    
 @keyframes spin
   to
     transform rotate(360deg)
View Compiled
import gsap from 'https://cdn.skypack.dev/gsap'

gsap.to('.box', {
  rotate: 360,
  delay: (index) => index,
  repeatDelay: 1,
  repeat: -1,
  ease: 'power1.inOut',
})
View Compiled
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.