Made canvas size in index.html dynamic, also added resize() to the event listener of resize events of window.