jscottsmith / react-scroll-parallax

🔮 React hooks and components to create parallax scroll effects for banners, images or any other DOM elements.
https://react-scroll-parallax.damnthat.tv/
MIT License
2.9k stars 158 forks source link

Improve parallax performance #78

Closed davwheat closed 4 years ago

davwheat commented 4 years ago

Feature Request

Parallax performance is very poor on low-end devices and phones. This article lays out some great parallax performance tips which could be implemented into this package.

Proposed Changes

https://medium.com/@dhg/parallax-done-right-82ced812e61c

jscottsmith commented 4 years ago

@davwheat Thanks, appreciate the article.

Most of what is mentioned in this article has already been considered and implemented in this package:

Anyway, feel free to look at the source and PR with improvements.

Also, I don't recommend using parallax on mobile devices (see the PSA at the bottom). I think it mostly annoys users. I suggest disabling them. Some more info about optimizations are here:

https://github.com/jscottsmith/react-scroll-parallax#optimizations-to-reduce-jank

davwheat commented 4 years ago

Sorry I only checked the source for one thing and saw that wasn't implemented but wouldn't make a big difference anyway.

I'll take a look at the jank reducing section but I have a feeling it could be to do with the fact I'm also transitioning blur and gray-scale at the same time.

jscottsmith commented 4 years ago

Oof ya, those are expensive effects. I'd avoid it.