Code Monkey home page Code Monkey logo

Comments (5)

jscottsmith avatar jscottsmith commented on May 29, 2024

@visualcookie did you look at the storybook? The API doesn't use a speed property but rather start and end offsets. Speed is controlled by increasing those offsets.

Elements moving at different "speeds":
https://react-scroll-parallax-next.surge.sh/?path=/story/parallax-vertical--linear-y-offsets

Source code:
https://github.com/jscottsmith/react-scroll-parallax/blob/master/stories/Parallax/1_ParallaxVertical.stories.js

Maybe this already exists but I haven't found any documentation to it, as when I implemented it, all elements had the same speed levels and would stop after say 20px of scroll.

Sounds like a cache issue, or related to your setup:
https://github.com/jscottsmith/react-scroll-parallax#troubleshooting

Link me your repo or site if you want better support. I can only guess otherwise.

from react-scroll-parallax.

visualcookie avatar visualcookie commented on May 29, 2024

Hey @jscottsmith. I've set-up a sandbox of my use-case right now. It's not quite accurate, but it shows how it's set-up on my website right now.

The issue I'm facing right now:

  • Lines not even moving (value changes when looking in DOM)
  • Content moving, but positions are getting weirdly misplaced, when playing around with the y values

from react-scroll-parallax.

jscottsmith avatar jscottsmith commented on May 29, 2024

@visualcookie I’ll need a link to the sandbox.

from react-scroll-parallax.

visualcookie avatar visualcookie commented on May 29, 2024

@jscottsmith Oops, sorry, forgot to paste the link.

https://codesandbox.io/s/40nq75p6xw

from react-scroll-parallax.

jscottsmith avatar jscottsmith commented on May 29, 2024

Your styling is causing the issues.

First thing, you won't be able to rotate the parent holding the parallax elements and get expected effects. If you need to rotate with transforms apply the styling to children.

Using absolute positioning can be tricky. I suggest positioning the parent absolutely and applying parallax effects to a relatively positioned child.

The effects you want are in one of the examples:
https://github.com/jscottsmith/react-scroll-parallax-examples
https://jscottsmith.github.io/react-scroll-parallax-examples/examples/parallax-example/

Specifically here which uses absolute positioning on parents and parallaxes children:

https://github.com/jscottsmith/react-scroll-parallax-examples/tree/master/examples/parallax-example/components/ShapeField

I'd suggest starting simple with just boxes that parallax then apply appropriate styles to get the desired look you want.

from react-scroll-parallax.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.