Made demo pages automatically resize the canvas when the window size changes

I exposed the engine variable in `demo()` on each of the pages and added a function along with an event listener to call `engine.prepareBackground()` upon a resize event.

```javascript
function resize() {
  engine.prepareBackground(20, window.innerWidth, window.innerHeight);
}
```