argyleink / ScrollSnapExplainers

https://snap-gallery.netlify.app
94 stars 3 forks source link

paged snapping #24

Open argyleink opened 1 year ago

argyleink commented 1 year ago

in addition to snapping to the next item, it'd be nice to snap to the next page. the browser would determine which items are in view and ensure this function scrolls past them, bringing in a new set of items that were previously out of view. this is hard to do today because you have to measure the scrollport then each item, use an intersection observer to know which are in view, then scroll a measured amount to the next set and scroll them to the start of the viewport. could be a simple api from a dev pov, letting the browser do the hard work performantly.

argyleink commented 1 year ago

see https://github.com/w3c/csswg-drafts/issues/8098