Add slow motion to the end

What the title says. I also changed the timing to use the `timeupdate` event instead of using setTimeouts and did some minor formatting (adding missing semicolons and such).