Fix animation re-centering on window resize