Scroll Animation for Floating Component
Hey everyone 👋
I came across a scroll animation effect and would love some feedback on optimization.
Behavior I want:
A floating component starts at the bottom-right corner.
As the user scrolls down, it moves upward, and when it reaches the middle of the viewport, it stays there while the page continues to scroll.
I’ve built a working solution in React (code below), but it doesn’t feel very optimized.
If you have a cleaner or more efficient approach, I’d love to hear your thoughts!
I’m also new to Discord, so please forgive me if I’m doing anything wrong 😊
0 Replies