Trying to make Webflow act like a CMS. How do you "popstate"?

http://cspace.io

I’m trying to use hashes and history.pushState and popstate to make this happen. If you dive into my JS, you can see me trying to make something work as a complete noob.

Can any front-end coders help me out please?