WindowscrollY
Window.scrollY is a read-only property of the window interface that returns the vertical scroll offset of the document in CSS pixels. It indicates how far the top edge of the viewport is from the top of the document.
In modern browsers, window.scrollY equals window.pageYOffset. It is supported by Firefox, Chrome, Edge, Safari, and most
Usage is straightforward: read the value from window.scrollY to determine the current vertical scroll position. Because
The value updates in response to user scrolling and can also change when scripts scroll the page