Jump to content
Search Community

onRepeat Callback

WilliamBay test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I'm working on a custom Throbber for an upcoming client site.

The idea is that the bird and the bear in the logo will blink their eyes every time the throbber does a full rotation.

 

I've been looking through docs and other code, and can't seem to find the correct setting which will correctly call the eyesTL when the throbTL repeats.

 

Any thoughts?

See the Pen OOoqXm?editors=0010 by bahia0019 (@bahia0019) on CodePen

Link to comment
Share on other sites

@WilliamBay btw you don't need callback in this particular situation, you can use a master timeline and labels to keep things simple. Also, you might be able to use custom ease to achieve same affect as throbber.

 

Plus, you can set transformOrigin only once and setting it to '50% 50%' works instead of using absolute values. Finally, I don't know if it was intentional use or not, but when you use fromTo tween, you are animating particular property from certain value passed in first parenthesis to a certain value passed in second parenthesis. So in this situation you don't need fromTo tween. Neither do you need yoyo property, instead of jumping to start position while repeating yoyo animates it in reverse.

 

See the Pen MOxKjQ?editors=0010 by Sahil89 (@Sahil89) on CodePen

 

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