Add event handler for window.resize to autoscale