<div class="box">
  <div class="container">
    <span class="dot"></span>
    <span class="dot"></span>
    <span class="dot"></span>
    <span class="dot"></span>
  </div>
</div>

body{
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  background: #c5cae9;
}

.container{
  height: 15px;
  width: 105px;
  display: flex;
  position: relative;
  .dot{
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: blue;
    animation: move 700ms linear 0ms infinite;
    margin-right: 30px;
    
    &:first-child{
      position: absolute;
      top:0;
      left:0;
      animation: grow 700ms linear 0ms infinite;
    }
    
    &:last-child{
      position: absolute;
      top: 0;
      right: 0;
      margin-right: 0;
      animation: grow 700ms linear 0s infinite reverse;
    }
  }
}

@keyframes grow {
  from {transform: scale(0,0); opacity: 0;}
  to {transform: scale(1,1); opacity: 1;}
}

@keyframes move {
  from {transform: translateX(0px)}
  to {transform: translateX(45px)}
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.