Jump to content
Search Community

Need help with maintaining axis while rotating and changing scale

Delos test
Moderator Tag

Recommended Posts

Hello there!

Very new to Gsap. I have had some difficulty wrapping my head around how to maintain the circles position while rotating and scaling either up or down as seen in the codepen example. I've tried looking around the forum and google, yet no luck. Would love some assistance.

See the Pen pojGqPe by ronbabious (@ronbabious) on CodePen

Link to comment
Share on other sites

Hey Delos and welcome to the GreenSock forum!

 

The main issue here is that you're wanting the transform/svgOrigin of the elements to be in two different places at once: For the rotation you want it to be the center of the larger circle. For the scaling, you want it to be the center of each smaller circle. Unfortunately you can't have origins for specific properties like that.

 

There's a few different avenues that you can use to accomplish what you're trying to accomplish though:

  1. Animate a containing element for the movement and the individual circles for the scale. By applying each animation to different elements, you can have a different origin for each animation. 
  2. Use a different method of rotating the circles that doesn't rely on an origin. For example one that uses GSAP's MotionPathPlugin:

I used the first approach here:

See the Pen pojGBBp?editors=0010 by GreenSock (@GreenSock) on CodePen

 

For more information about timelines, see the timeline docs and the position parameter page

 

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