- 4.times do |ntime|
  %div
    %span
    %span
    %span
View Compiled
body {
  height: 100vh;
  background-color: midnightblue;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
}

*, *:before, *:after {
  box-sizing: border-box;
}

div {
  flex-shrink: 0;
  transform: rotate(45deg);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100px;
  height: 100px;
  margin: 10%;
  
  span {
    position: absolute;
    animation: 2000ms linear animation infinite;
    content: '';
    display: block;
    border-color: mediumspringgreen;
    border-style: solid;
    border-radius: 100%;
    &:nth-child(2) { animation-delay: -666ms; }
    &:nth-child(3) { animation-delay: -1333ms; }
  }

  &:nth-child(2) {
    span {
      animation-direction: reverse;
    }
  }
  &:nth-child(3) {
    span {
      &:nth-child(2) { animation-delay: -1000ms; }
      &:nth-child(3) { display: none; }
    }
  }
  &:nth-child(4) {
    span {
      animation-direction: reverse;
      &:nth-child(2) { animation-delay: -1000ms; }
      &:nth-child(3) { display: none; }
    }
  }
}

@keyframes animation {
  0%, 100% {
    top: 0;
    width: 10%;
    height: 10%;
    border-width: 6px;
  }
  
  0% {
   animation-timing-function: ease-out;
  }
  
  25% {
    width: 10%;
    height: 10%;
    border-width: 6px;
    animation-timing-function: linear;
  }
  
  50% {
    width: 10%;
    height: 10%;
    border-width: 2px;
    top: 100%;
    animation-timing-function: ease-in-out;
  }
  
  75% {
    width: 100%;
    height: 20%;
    border-width: 2px;
    animation-timing-function: ease;
  }
  
  100% {
    animation-timing-function: ease-out;
  }
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.