Last 12 weeks ยท 0 commits
2 of 6 standards met
Repository: sveltejs/svelte-scroller. Description: A <Scroller> component for Svelte apps Stars: 369, Forks: 25. Primary language: Svelte. Languages: Svelte (59.4%), JavaScript (38.8%), HTML (1.8%). Homepage: https://svelte.dev/repl/76846b7ae27b3a21becb64ffd6e9d4a6 Open PRs: 5, open issues: 10. Last activity: 2y ago. Community health: 50%. Top contributors: Rich-Harris, ddnn55, jtrim-ons, mhkeller.
Swaps the current fixed/absolute swap with position sticky. This is more efficient because we only update the offset once (except on parallax mode). Moving the offset calculation outside of the intersection observer also has the benefit of positioning the background div on load rather than after the first scroll. There's one breaking change though. In the current code when you reach progress 1 the background div will go off the screen. In my experience this is confusing and position sticky approach where the background div stays fixed until you finish scrolling over the container is what most people actually want. Also, most scrollys i've seen tend to run a full height div on the background, where this point is moot. Thoughts welcome, of course! Closes https://github.com/sveltejs/svelte-scroller/issues/16. before top 0 and bottom 1 https://github.com/sveltejs/svelte-scroller/assets/1236790/16363fab-caf3-47d0-b911-af65a5788359 top 0.5 and bottom 1 https://github.com/sveltejs/svelte-scroller/assets/1236790/dcf030f3-da65-431d-99eb-d61fd75c7663 after top 0 and bottom 1 https://github.com/sveltejs/svelte-scroller/assets/1236790/c06423f1-4778-4078-95fa-bf3dec13e343 top 0.5 and bottom 1 https://github.com/sveltejs/svelte-scroller/assets/1236790/0aa32e24-556d-4318-81ff-3730e4fa8344 top 0 and bottom 1 with full screen background https://github.com/sveltejs/svelte-scroller/assets/1236790/e9148bb4-6615-46a0-8c69-cfc68318062b