<div>
  <svg xmlns="http://www.w3.org/2000/svg" 
     width="80px" height="60px"
     viewBox="5 0 80 60">
    <path id="wave" 
        fill="none" 
        stroke="#262626" 
        stroke-width="4"
        stroke-linecap="round">
    </path>
  </svg>
</div>
html, body { 
  height: 100%;
  margin: 0;
  width: 100%;
}

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

div {
  align-items: center;
  border: 4px solid #262626;
  display: flex;
  height: 110px;
  margin: 0 auto;
  width: 110px;
}

svg { 
  margin: 0 auto; 
  overflow: hidden;
}

#wave {
  stroke-dasharray: 0 16 101 16;
  animation: moveTheWave 2400ms linear infinite;  
}

@keyframes moveTheWave {
  0% { 
    stroke-dashoffset: 0; 
    transform: translate3d(0, 0, 0);
  }
  100% { 
    stroke-dashoffset: -133;
    transform: translate3d(-90px, 0, 0);
  }
}
View Compiled
const path = document.querySelector('#wave');
const animation = document.querySelector('#moveTheWave');
const m = 0.512286623256592433;

function buildWave(w, h) {
  
  const a = h / 4;
  const y = h / 2;
  
  const pathData = [
    'M', w * 0, y + a / 2, 
    'c', 
      a * m, 0,
      -(1 - a) * m, -a, 
      a, -a,
    's', 
      -(1 - a) * m, a,
      a, a,
    's', 
      -(1 - a) * m, -a,
      a, -a,
    's', 
      -(1 - a) * m, a,
      a, a,
    's', 
      -(1 - a) * m, -a,
      a, -a,
    
    's', 
      -(1 - a) * m, a,
      a, a,
    's', 
      -(1 - a) * m, -a,
      a, -a,
    's', 
      -(1 - a) * m, a,
      a, a,
    's', 
      -(1 - a) * m, -a,
      a, -a,
    's', 
      -(1 - a) * m, a,
      a, a,
    's', 
      -(1 - a) * m, -a,
      a, -a,
    's', 
      -(1 - a) * m, a,
      a, a,
    's', 
      -(1 - a) * m, -a,
      a, -a,
    's', 
      -(1 - a) * m, a,
      a, a,
    's', 
      -(1 - a) * m, -a,
      a, -a
  ].join(' ');
  
  path.setAttribute('d', pathData);
}

buildWave(90, 60);
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.