Replies: 1 comment
-
Hello @jdion84 Try playing with Here is an example: const reference = useRef<HTMLDivElement>(null)
const { scrollYProgress } = useScroll({ target: reference, offset: ["1 0", "1.5 1"] })
<section className="" ref={ref} id="home">
<motion.div
ref={reference}
style={{
opacity: opacityProgess,
}}
>
CONTENT
</motion.div>
</section> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
im just trying to get some text to fade in and out based on the scroll position
i am using framer motion
here is my code:
i want it so when the scroll position is centered on the div (scrollYProgress == 0.5) then the opacity is 100%, and scrolling up or down from that point fades it out progressively based on scrollYProgress
the text is only fading out when scrolling top to bottom, not fading in & out as desired
Beta Was this translation helpful? Give feedback.
All reactions