Jump to content
Search Community

different ease on reverse()

tailbreezy test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

I am wondering how does one apply a different ease on reverse()?

I know of yoyoEase, but it is for yoyo. Anything similar for reverse as well?

 

Also how to speed up the tween on reverse will be my next issue. duration method does work, but it changes the initial tween duration, so I have to change it back again.

Link to comment
Share on other sites

  • Solution

What you're asking would actually cause logic issues - imagine you're halfway through a tween with a "power1.out" ease, for example, end then you reverse() and you want to switch to a "power3.in" (or whatever). So at a progress of 0.5, those two eases would render things in a COMPLETELY different place, thus you'd see the values suddenly jump. Not smooth at all. See what I mean? No bueno. 

 

That's why we can do it with a yoyoEase, because that just switches when the animation is at a progress of 0 or 1, thus no jumping. 

 

The same goes for duration - you've gotta think about how things are affected when animations are in-progress and you dynamically change a value like that. Remember that in GSAP, animations can be nested infinitely, and the playhead of the parent timeline scrubs across its children, etc. And a parent timeline's duration is dictated by its children and where they line up. And if you dynamically change a duration and smoothChildTiming is enabled, it must alter the startTime of that animation to ensure that playback is perfectly smooth.

 

I'm a little confused about what you're asking for here. Are you saying that you want the duration to AUTOMATICALLY change to something totally different when you reverse() and then automatically change to something else when you play forward? If so, no, you need to alter the duration yourself. I don't think it makes any sense to add a feature that somehow does that changing automatically. 

 

Perhaps it'd help if you provided a minimal demo that shows what you're wanting to do so that we can see the context and perhaps offer a better idea. 

 

Also remember that you can alter an animation's timeScale() if your goal is to speed it up or slow it down. 

  • Like 4
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...