How to achieve such SVG animation from vanilla JS & CSS?