- [FEATURE]: add
onProgress
prop toParallaxLayer
(#28) - [FEATURE]: add
StickyLayer
component (#29) - [FEATURE]: add
let:progress
directive toParallaxLayer
as an alternative to usingonProgress
prop (#29) - [FEATURE]: add
onScroll
prop toParallax
(#32) - [BREAKING CHANGE]: change the parameters passed to
onProgress
inParallax
-- it is now just the percent scrolled (represented as a float between0
and1
) to be in line with the other twoonProgress
props in the layer components. It is also now aspring
store, so it will update in-sync with the parallaxing layers. I removedsectionProgress
andsection
because they are mostly used as references forParallaxLayer
motion. And with the addition ofonProgress
for layers, I didn't see much of a use case for them because their values aren't really relevant to how a layer appears in the viewport (ie, if aParallaxLayer
is in the viewport for more than onesection
, the values become less helpful). If users want these values back, we could add them back with something like anonSectionProgress
prop. You can also get the current section usingonScroll
by doing something likeconst section = Math.floor(scrollTop / height) + 1
whereheight
issectionHeight
(defaultwindow.innerHeight
) multiplied bysections
. (#32)
- [BUGFIX]: correct type for
selector
inscrollTo
function
- [FEATURE]: add type declarations (#27)
- [FEATURE]: use
$$restProps
instead of having astyle
prop. Functionality shouldn't change for the user, but this allows other arbitrary props to be passed to the components as well. (#20) - [CHORE]: removed opinionated styles from
Parallax
. (#21) - [BUGFIX]: style fixes ($$restProps
style
was clobberingParallax
height). (#22) - [BUGFIX]: Revert
position: relative
change. We need to it make sureParallaxLayer
s obeyoverflow: hidden
. (#23)
- [FEATURE]: added
sectionHeight
prop toParallax
. The value still defaults towindow.innerHeight
(using Svelte'sbind:innerHeight
), but this should resolve #17. - [FEATURE]: added
onProgress
prop toParallax
. Takes a function that recieves a progress object:{ parallaxProgress: float, section: number, sectionProgress: float }
. The two<component>Progress
values are floats between0
and1
. Resolves #16.
- [BUGFIX]: removed
postinstall
script as it was borking actual component installation
- [DEPRECATED]:
onEnter
andonExit
are being replaced withthreshold
prop. This is mostly because the common convention seems to be thaton<VERB>
props usually take a function and standards are important. Also,threshold
will take numbers instead of booleans so the user has more control over when effects are active. To switch from old to new,onEnter=true
is nowthreshold={{ top: 0 }}
andonExit=true
isthreshold={{ bottom: 0 }}
. - add JSDoc comments to props because they are fancy.
- [BUGFIX]: move focus-options-polyfill from devDependencies to dependencies
- refactor a few small things for better organization
- Parallax: refactor scrollTop to be more DRY
- Parallax: refactor layers array to a set
- ParallaxLayers: now delete themselves from layers set on unmount. This also means ParallaxLayers can now be dynamically added and removed
- Parallax: moved layer.setHeight calls from setDimensions to their own reactive statement (so layer reactivity isn't dependent on resizing)
- Parallax: reduced setTimeout of resize callback to 0
- refactor: get rid of $ready flag and change innerHeight from a store to a regular prop and reorganize
- [BUGFIX]: add missing $ to ready flag in ParallaxLayer
- very small refactors, no functionality changed
REFACTOR:
- make Parallax and ParallaxLayer a little less tightly coupled
- ParallaxLayer registers itself with Parallax in onMount
- Parallax now calls all position and height update functions for each ParallaxLayer
- [BREAKING CHANGE]: remove horizontal prop from ParallaxLayer. I don't think it works well without additional parameters passed from the user and I want to keep the API minimal (atleast at first). Plus, I'd rather have fewer features at release than have something that doesn't work right and have to remove/change it after.
- [BREAKING CHANGE]: remove SimpleParallax from the package. If someone really wants that particular component you can always copy it from a previous version.
- [BUGFIX]: change 'keyup' to 'keydown' in abortEvents listener list in scrollTo. 'keyup' was interfering with the click listener to start the animation if it was started by pressing the enter key.
- reduce default duration of scrollTo
- [BUGFIX]: scroll animation is now cancellable when user scrolls or clicks
- add temporary fork of svelte-scrollto until PR is merged
- [DEPRECATED]: SimpleParallax is deprecated moving forward. I realized you can do the same effect easily with Parallax/ParallaxLayer so I'm adding it to the new Recipes section of the README. I'll keep the component in the package with a notice for awhile.
- add Recipes section to README
- Parallax: refactor intersecting calculations to just use scrollTop store
- ParallaxLayer: refactor out unneeded checks because of Parallax refactor
- [BUGFIX]: disabled works correctly now
- refactored a few more things in ParallaxLayer
- refactor: ParallaxLayer initialization
- add vendor prefixes for transform rules
- rename SimpleParallax class names to avoid clashing with Parallax/ParallaxLayer
- [BUGFIX]: SimpleParallax initial and disabled positions are now correct
- typo in README
- move focus-options-polyfill to devDependency
- refactor scrollTo to use svelte-scrollto
- [BREAKING CHANGE]: change the second parameter of scrollTo function from string to options object
- update README to reflect breaking change
- refactoring: change initialization of ParallaxLayer to depend on container being mounted
- feature: add onExit prop to Parallax
- [BUGFIX]: fix onEnter
- [BUGFIX]: correct initial position of ParallaxLayers
- [BUGFIX]: add correct Y-coordinate for ParallaxLayer when effect is disabled
- [BUGFIX]: add setTimeout to window resize listener
- add focus-options-polyfill for Safari ({ preventScroll: false })
- add CHANGELOG
- add basic demo to README
- remove unused utils
- initial commit