Jump to content
Search Community

wayz

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by wayz

  1. I am currently working on replicating a page animation(

    See the Pen oNGEvmw by cameronknight (@cameronknight) on CodePen

    ) in React and have encountered challenges with implementing the scrollTrigger and gsap.to functionalities. Despite having successfully employed useLayoutEffect and a context wrapper in previous projects, I am puzzled as to why it is not functioning as expected in the current scenario.

    To provide you with more context, I have attached a screenshot of the page I am working on. The primary issue lies in the fact that neither the scrollTrigger nor gsap.to seem to be working as intended. I have thoroughly reviewed my code and cannot pinpoint the source of the problem.

    Here is a brief overview of my approach:

    1. I utilized useLayoutEffect to handle the animation logic.
    2. Created a context and wrapped scrollTrigger and gsap.to within it for seamless integration.

    Despite following a similar approach that has proven successful in the past, the animation fails to execute properly on the current page.Since only codepen links work  i've just copied my jsx code into codepen.

    Screenshot 2024-01-25 at 10.32.28 AM.png

    See the Pen KKEXZGB by rhaber (@rhaber) on CodePen

  2. So I have played the video using scrollTrigger but what i want to do next is after the video has stopped I want to scale the video on Scroll. What i end up doing is scaling and playing the video at the same time using a the initial scrolltrigger.

    const kill = gsap.context(() => {
    //for pinning
    gsap.to(SectionPlay, {
    scrollTrigger: {
    trigger: SectionPlay,
    onEnter: () => VideoPlay.play(),
    start: "top+=5 top",
    pin: true,
    markers: true,
    },
    })
    }, SectionPlay)
    return () => kill.revert();
×
×
  • Create New...