<div class="loading">
  <span></span>
  <span></span>
  <span></span>
</div>
.loading {
  margin: 1rem 2rem;
  display: flex;
  justify-content: center;
  gap: 10px;
}

span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  animation-name: rotating;
  animation-duration: 2.5s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: forwards;
}

span:nth-child(1) {
  background-color: violet;
  animation-delay: 0.3s;
}
span:nth-child(2) {
  background-color: rgb(235, 86, 235);
  animation-delay: 0.6s;
}
span:nth-child(3) {
  background-color: rgb(201, 32, 201);
  animation-delay: 0.9s;
}

@keyframes rotating {
  20% {
    border-radius: 0px;
  }
  60% {
    border-radius: 20px;
    transform: rotateZ(720deg);
  }
  100% {
    border-radius: 50%;
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.