Before reaching its offset.top, the layer will translate as if it was a normal element in the DOM. When it reaches offset.top, it will become "sticky" (actually position: fixed, because CSS hates fun) and will remain that way until the page is scrolled to offset.bottom.
This PR also implements accessing progress in ParallaxLayer using the let directive let:progress -- because I ended up adding that feature to StickyLayer and really liked it in this case (~inspired by~ stolen from #19. thanks @nathancahill! i most likely wouldn't have thought of this without your suggestion.)
I may also end up implementing the let directive for Parallax as well (and maybe get rid of sectionProgress), but I'm having trouble thinking of situations where it'd be useful now that each layer will have its own local progress.
There were also some chores: got rid of cypress snapshots plugin because I never used it and added prettier because I was just using the VS Code extension before and wanted the real thing.
This PR implements a
StickyLayer
component.Before reaching its
offset.top
, the layer will translate as if it was a normal element in the DOM. When it reachesoffset.top
, it will become "sticky" (actuallyposition: fixed
, because CSS hates fun) and will remain that way until the page is scrolled tooffset.bottom
.This PR also implements accessing
progress
inParallaxLayer
using thelet
directivelet:progress
-- because I ended up adding that feature toStickyLayer
and really liked it in this case (~inspired by~ stolen from #19. thanks @nathancahill! i most likely wouldn't have thought of this without your suggestion.)I may also end up implementing the
let
directive forParallax
as well (and maybe get rid ofsectionProgress
), but I'm having trouble thinking of situations where it'd be useful now that each layer will have its own localprogress
.There were also some chores: got rid of
cypress
snapshots plugin because I never used it and addedprettier
because I was just using the VS Code extension before and wanted the real thing.