electerious / basicScroll

Standalone parallax scrolling for mobile and desktop with CSS variables.
https://basicscroll.electerious.com
MIT License
3.63k stars 148 forks source link

Any documentation? #62

Closed chrisvidal closed 2 years ago

chrisvidal commented 2 years ago

Is there any documentation to understand the meaning of please :

from: 'top-middle',
to: 'bottom-middle',

and other options?

electerious commented 2 years ago

Yes, you can find it in the documentation.

chrisvidal commented 2 years ago

yes I saw that, but it does not explain the behavior of each of them.

electerious commented 2 years ago

<element>-<viewport>. middle-bottom in from specifies that the animation starts when the middle of the element reaches the bottom of the viewport.

It's the same for the other values. Here're a few examples:

bottom-bottom in from specifies that the animation starts when the bottom of the element reaches the bottom of the viewport. middle-top in from specifies that the animation starts when the middle of the element reaches the top of the viewport.

Hope that helps! :)

chrisvidal commented 2 years ago

got it, thanks a bunch!