remove unused code, and set the default snapshot to '1', the whole window
.
Now use element.getBoundingClientRect() for layout. It should have better flexibility.