js: add window resize handling