<svg xmlns="http://www.w3.org/2000/svg" 
     width="200" height="100" 
     viewBox="0 0 200 100" style="background-color: #ccc">
    <line x1="0" y1="100" x2="200" y2="0" style="stroke:#fff;stroke-width:5" />
    <line x1="0" y1="100" x2="200" y2="0" class="line" id="targetLine" />
</svg>
.line {
  stroke-dasharray: 100;
  stroke-width: 5;
  stroke: red;
  animation: key-line-red 1s linear 0s infinite;
}
let offset = 0
const millisecond = 10
const line = document.querySelector("#targetLine")
setInterval(() => {
  offset += 1
  line.style['stroke-dashoffset'] = offset
}, millisecond)

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.