background gradient, handles scroll and window resize events