scale to window resizing

created a function that allows the canvas to scale to the window resize