Javascript – Repeat animation from the beginning every time the element comes into view
I have created an animation that takes a couple of seconds to play. The animation should only run when the element is in view, so I've used whileInView. This works correctly, but when I scroll down (so the element is…