Draw line animated : <p>I want to have a line in the center of the screen and animate it like a snake</p>

<p>This is step by step animation I want to make</p>

<p><a href="https://i.stack.imgur.com/1AmMH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1AmMH.png" alt="enter image description here"></a></p>

<p>How can I do this?</p>
