Jump to content
Search Community

prrrcl

Members
  • Posts

    6
  • Joined

  • Last visited

Posts posted by prrrcl

  1. 5 minutes ago, ZachSaucier said:

    There are multiple ways to do this sort of thing. Not using a timeline is one way, but you may run into trouble if a user double clicks (in which case you would need to kill the previous animation). Having a timeline that has two parts to it and making use of .tweenTo() is another way  :) 

    I think i gonna die! haha

    I haven't got idea how can i use that. I only want to do something like: https://www.cahnwilson.com/ and their code its the same that i put in my repl.it ?

  2. 12 minutes ago, ZachSaucier said:

    Hey prrrcl,

     

    The main issue is that you're adding to the timeline every time. You should create the timeline animation when it is initialized and then toggle the playing and reversing on click. See the below thread for more info:

     

    I think ok, but if i want to do 2animations? i mean, open 1, close 2. There are 2 diferents animations for entry and exit. How can i do?

  3. Hi,

     

    I have some issue with Gsap and reactjs. I don't know how can i do two animations, first one, and then when it finished, start the second one.

     

    Im working with hooks and this is my code: 

    useEffect(() => {
        let newTimeLine = new TimelineMax()
        setAnimation(
          newTimeLine
          .staggerFrom(
            links.children,
            0.5, 
            { alpha: 0, y: -30 }
            , 0.08)
          .staggerTo(
            links.children,
            0.1,
            { alpha: 1, y: 0, ease: Power3.easeOut },
            0.1).reverse()
            )
      }, []);

    I want to have second animation: x: -10 to x:0 when y: 0.

     

    My english is so bad, sorry guys...

     

    Thanks a lot.

×
×
  • Create New...