JSFiddle - React, Tailwind, and code Playground

HTML

<div class="wrapper">
  <div class="gradient">
  </div>
  </div>

CSS

.wrapper {
  width:320px;
  overflow:hidden;
  position:relative;
  height:10px;
}

.gradient {
  height:10px;
  width:960px;
  position:absolute;
  top:0;
  left:0;
  background: linear-gradient(to left, #333, #eee 25%, #333 50%, #eee 75%, #333 100%);
  animation-name:animation;
  animation-duration:2.0s;
  animation-iteration-count: infinite;
  animation-timing-function:linear;
}

@keyframes animation {
    from {left:0px}
    to {left:-480px}
}