Jump to content
Search Community

Updating Timeline Defaults

creativeocean test
Moderator Tag

Recommended Posts

Often I use a single timeline for button animation, and play/reverse on enter/leave. I know it's possible to adjust the timeScale for play() and reverse(), but I'm wondering if there's a way to change the timeline's default easing. It'd be great to have an easeOut when playing forward, and an easeInOut when reversing. I guess one way to get this effect could be to tween the TL's progress with whatever ease is desired. But I'm curious to know, generally, if timeline defaults can be updated after the fact, similar to the timeScale method.

See the Pen YzVmNJy by creativeocean (@creativeocean) on CodePen

  • Like 1
Link to comment
Share on other sites

Using a different ease on reverse would cause the animation to jump if it didn't play all the way through. The only way to do this would be to use an ease of none for you timeline, and then tween your timeline's progress or time with the ease you want. 

 

Related thread...

 

  • Like 5
Link to comment
Share on other sites

@Cassie thanks for confirming my suspicion about tweening progress with different ease applied.

 

@OSUblake that's a great point. Tweening the progress, is definitely the right way to get what I was originally after. But the fact that changing defaults (not just ease) would potentially have a jarring, jumping effect, answers why it wouldn't be a useful feature to have. Thanks!

 

@elegantseagulls yoyoEase is an important prop to know about, even if it's not exactly applicable here. Until you mentioned it, I didn't know that yoyoEase:true flips the ease. I've always used it to define a completely different ease on reverse.

 

  • 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...