React-spring: Parallax Issues

Created on 1 Aug 2019  路  7Comments  路  Source: pmndrs/react-spring

Hi, I am struggling with this on a simple SPA that has different components for each level on the page.

I have set up each component in position on ParallaxLayers with the offset, but as soon as I enter the speed it pushes the components down and shows a gap between each component before it animates into place.

````
const IndexPage = () => (

{/* */}











````

Environment

  • react-spring v8.0.27
  • react v16.8.6
abandoned bug needs repro

Most helpful comment

I could solve this by setting the offset to .99 instead of 1 based on ddennis' comment. Yet, it's impossible to mantain responsiveness as page size won't be the same size as the components (offset) inside it. Produces a gap at the bottom of the page or it overlaps the components.

EDIT: to add responsiveness i used window.innerWidth < 960 ? 4 : (window.innerWidth > 1600 ? 2.2 : 3 ) on some offsets

All 7 comments

Using Gatsby? It happens to me too. Also, I want it to work using default window scrollbar, but setting scrolling={false} breaks parallax effect.

Please provide a sandbox or git repository. Thanks!

I could solve this by setting the offset to .99 instead of 1 based on ddennis' comment. Yet, it's impossible to mantain responsiveness as page size won't be the same size as the components (offset) inside it. Produces a gap at the bottom of the page or it overlaps the components.

EDIT: to add responsiveness i used window.innerWidth < 960 ? 4 : (window.innerWidth > 1600 ? 2.2 : 3 ) on some offsets

Hello, may I ask why this issue was closed?
I have also experienced this and have implemented a workaround which calculates Parallax.pages and ParallaxLayer.offset values based on the ParallaxLayer.factor I need which depends on a dynamic grid layout.
The ParallaxLayer factor value seems to never have worked for me, but I have not found a reason why. I am aware that the example on the React Spring website does work with the factor value somehow, but it also appears to be used only on the background element.

may I ask why this issue was closed?

It needs a repro and the author has not reciprocated. 馃憖

I tried directly with css position: absolute; bottom: 0px; to make some changes in responsive :/

The gap is caused by speed of each component, setting speed to 0 will fix your problem.
or you can change the height of your page by changing factor to (1+speed)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cmmartin picture cmmartin  路  3Comments

localjo picture localjo  路  3Comments

Daniel15 picture Daniel15  路  3Comments

mkhoussid picture mkhoussid  路  3Comments

jmcruzmanalo picture jmcruzmanalo  路  4Comments