Vivus draw animation start on enter view port, reset when exit view port

Hi, anyone know how can I amend the code in the attached Vivus draw template so that when the animation enters the viewport it starts and when it exits, it resets?vivus template scroll (547.0 KB)

vivus template scroll (536.1 KB)