artstyle Posted September 11, 2020 Share Posted September 11, 2020 Hello. please look at the section it has a timeline like this let s2_tl = gsap.timeline ({ scrollTrigger: { trigger: ".s2", start: "top top", end: "bottom top", scrub: 1.5, pin: true, toggleActions: "play reverse play reverse", } }); s2_tl .to(".triangle",{rotate: 333}); but what if i want to add this effects on enter, how it should look like? i want to apply them onenter and remove onleave .s2 section .from(".section2-text2",{x: -500,opacity: 0,duration: 1.5,ease: "expo.inOut"}) .from(".section2-heading",{x:-300,opacity: 0,duration: 1.5,ease: "expo.inOut"},"<") .from(".s2-img1",{x:1000,opacity: 0,duration: 1,ease: "expo.inOut" },"<") .from(".s2-img2",{x:1000,opacity:0,duration: 1,ease: "expo.inOut" },"<") .from(".triangle",{opacity:0,duration:0.5,delay:0.5,ease: "expo.inOut" },"<"); See the Pen mdPLMLx by aptypkaa (@aptypkaa) on CodePen Link to comment Share on other sites More sharing options...
ZachSaucier Posted September 11, 2020 Share Posted September 11, 2020 Hey artstyle. It's not clear what you're wanting. Maybe you need a second ScrollTrigger? It would be very helpful if you made a minimal demo of your issue for us to take a look at: 1 Link to comment Share on other sites More sharing options...
artstyle Posted September 11, 2020 Author Share Posted September 11, 2020 updated Link to comment Share on other sites More sharing options...
ZachSaucier Posted September 11, 2020 Share Posted September 11, 2020 Are you just wanting to do this? See the Pen jOqxLpj?editors=0010 by GreenSock (@GreenSock) on CodePen 1 Link to comment Share on other sites More sharing options...
artstyle Posted September 11, 2020 Author Share Posted September 11, 2020 not exactly I want it to 1. start revealing animation immedeatly without start scrolling (i must change pause:true i guess) 2. on leave revealing animation must reverse playback Link to comment Share on other sites More sharing options...
artstyle Posted September 11, 2020 Author Share Posted September 11, 2020 i added onLeave: () => enterTL.reverse() and paused: false it works now but how do i make it play reverse onleaveback? i added nLeaveBack: () => enterTL.play(), it doesnt work Link to comment Share on other sites More sharing options...
artstyle Posted September 11, 2020 Author Share Posted September 11, 2020 i got it. it should be onEnterBack: () => enterTL.play(), thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now