Use document.width/.height instead of getBoundingClientRect to get the size of document