get viewport dimensions / detect if an element is in the viewport