Quiero hacer un efecto de animación gradual usando el evento de desplazamiento de JavaScript. ¿Qué tengo que hacer?
El estilo actual está trabajando en componentes de estilo. por favor avise
const handleAnimation = ( ) => { const windowHeight = window.innerHeight; const scrollY = window.scrollY; const bannerTop = ref.current && ref.current.getBoundingClientRect().top; const bannerAbsolute = scrollY + bannerTop; return { windowHeight: windowHeight, scrollY: scrollY }; } useEffect(() => { window.addEventListener('scroll', handleAnimationScroll); return () => { window.removeEventListener('scroll', handleAnimationScroll); }; }, []); handleAnimationScroll();