Jump to content
Search Community

how can i autoRotate in motion path container without affecting inner images

shadysw test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

  • Solution

Hi @shadysw and welcome to the GreenSock forums!

 

Based on the setup you already have and the fact that the entire element (that contains the image and the dots) is the one being animated along that path, is not going to be possible, unless you start rotating the image to counter the effect of the path's rotation.

 

What you could do is get the dots in the target element and rotate them independently as you tween the progress of your timeline here:

function moveWheel(amount, i, index) {
  let progress = tl.progress()
  tl.progress(wrapProgress(snap(tl.progress() + amount)))
  let next = tracker.item
  tl.progress(progress)

  setClasses(items, next)

  gsap.to(tl, {
    progress: snap(tl.progress() + amount),
    modifiers: {
      progress: wrapProgress,
    },
  })
  // Create another tween to rotate the dots
}

That should be the simplest way to approach this IMHO.

 

Here is a fork of your codepen:

See the Pen JjwPGOq by GreenSock (@GreenSock) on CodePen

 

Hopefully this helps.

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