The Element.getBoundingClientRect() method returns a position relative to the viewport.
Element.getBoundingClientRect()
MDN Reference