Get viewport dimensions, detect elements in the viewport