The Parallax Effect is an optical illusion that can give a website the appearance of 3D depth. Learn how to design a parallax website with React Spring in this 5 minute tutorial. https://fireship.io/pro

#webdev #js #learntocode

🔗 Resources

Source code https://github.com/fireship-io/skydiving-cat-parallax
React Spring Parallax https://react-spring.io/
Demo by isladjan https://codepen.io/isladjan/pen/abdyPBw
The boat Demo https://www.sbs.com.au/theboat/

🔥 Get More Content – Upgrade to PRO

Upgrade to Fireship PRO at https://fireship.io/pro
Use code lORhwXd2 for 25% off your first payment.

🎨 My Editor Settings

– Atom One Dark
– vscode-icons
– Fira Code Font

🔖 Topics Covered

– How parallax works
– Examples of parallax websites
– Scroll parallax implementation
– Webdev tips and tricks

source

47 Comments

  1. this is very cool but I ran into an issue

    I am using the useEffect hook to determine whether or not my app is scrolled all the way to the top…the navbar starts as transparent and changes to white if the user scrolls down

    unfortunately, the code inside my useEffect hook stopped working when I added code from this library

    anyone else run into something like this?

  2. Does anybody have insight as to the best method for mobile devices? I have always just used native CSS 'background-attachment: fixed' or 'transform: translateZ()' to create the parallax effect, but then I have to override those in media queries because they don't work right on mobile. I am new to things like React Spring or GSAP and not quite sure if these work the same way under the hood. Has anybody had success implementing the parallax effect on mobile? If so, what did you use?

  3. Anyone know why the background image might not be loading in?

    I'm using tailwind css so maybe i need to give the parallax layer a className instead of inline style?

    edit: fucking backticks

  4. wow!!! Thank you a lot!!! I never understood how to do parallex effects. That there is a React library for that is incredible. Now i can try to make my web page more interactive!

  5. So… what’s the k-weight of your production page? Animated cat gifs are fine in a Twitter post, but why teach kids bad habits of overloading UI with bloated media types? IMO videos like this aren’t helping the developer ecosystem, but hurting it. The last thing the internet needs is more clutter and more bloat. You also mentioned usability — what about handling scenarios for users who prefer reduced motion? Food for thought…

Leave A Reply

Please enter your comment!
Please enter your name here