Intersect Progress & Scroll Direction #2453
ermincelikovic
started this conversation in
3. Feature Ideas
Replies: 1 comment 4 replies
-
I don't think it's technically possible with the current implementation. x-intersect doesn't detect scrolling, it detects when a dom element enters or leave the viewport. This could be because of scrolling but, also, because a user clicked on an anchor link or because a different event (e.g. Adding removing content before the observed element) causes the element to be pushed in or out of the viewport. Under the hood, it uses the intersection observer API which doesn't have any concept of scrolling or direction. Do you have something in mind already? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
First of all, Alpine is just great and an absolute joy to use!
While Alpine is used a lot in web apps, my team and I use it heavily for building interactions on storytelling and e-commerce websites.
We managed to kick out the majority of the js library bloat we used before. One major library that is left is ScrollTrigger. ScrollTrigger is quite powerful, but the biggest use case is actually scroll progress and scroll direction - most of the times replaceable by snippets similar to this one.
I figured that adding scroll progress and direction would probably be of huge value for folks who are using intersect package.
Combining it with packages like motion would allow for creating Apple-like landing pages.
Beta Was this translation helpful? Give feedback.
All reactions