Could someone explain what `index.js`[1] is doing? It looks like code to figure out whether someone is actually reading the article or not but I'm curious why the various timeouts and scroll listeners, and what they're doing exactly.
That's exactly what it's doing -- it's trying to figure out if your viewport is looking at the content 'above the fold', so that it can show the "splash iframe" [1] while you're looking at it, and stop JS-animating it when you're not.
[1] https://github.com/ncase/ballot/blob/gh-pages/js/index.js