I am currently utilizing css scroll snap for smooth scrolling through sections that are 100vh in height. The functionality of the scroll snap is quite impressive.
However, I need to find a way to determine the exact distance the user has scrolled down the page for various purposes.
I have attempted different methods such as:
let wrapper = document.getElementById('landing-page-wrapper');
console.log(wrapper.offsetTop);
console.log(window.scrollY);
In addition, I also experimented with window.scrollTop, wrapper.scrollTop, and other options but haven't found a satisfactory solution.
You can view a demonstration of what I am encountering on Codepen
If you have any insights or suggestions on how to track the scroll distance while using 100vh sections and css scroll-snap, please let me know.
Thanks in advance!