Update index.html

Moving code out of the resize function and into a new namespace