Jump to content
GreenSock

shelune

Synchronizing element and its path timing

Go to solution Solved by OSUblake,

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 trying to make a kinda widget that has the icon rolling from one side to the other, with an arc filling the same path. So I tried Bezier Easing plugin to make it similar to the css cubic-bezier but there's still discrepancy

 

I wonder if there's a way to track the path and make the icon move along with the progress?

See the Pen jAvZNJ by shelune (@shelune) on CodePen

Link to comment
Share on other sites

  • Solution

Bezier easing and a Bezier motion path are two totally different things. As it is, your ease value of [0,0,1,1] isn't doing anything. That's just a linear ease.

 

The problem is you're using CSS to do the job of the DrawSVGPlugin, which will calculate the correct length of the stroke. Also, your paths seem to be reversed so I flipped them using scaleX = -1.

See the Pen KrJaYp?editors=0010 by osublake (@osublake) on CodePen

  • Like 3
Link to comment
Share on other sites

Bezier easing and a Bezier motion path are two totally different things. As it is, your ease value of [0,0,1,1] isn't doing anything. That's just a linear ease.

 

The problem is you're using CSS to do the job of the DrawSVGPlugin, which will calculate the correct length of the stroke. Also, your paths seem to be reversed so I flipped them using scaleX = -1.

See the Pen KrJaYp?editors=0010 by osublake (@osublake) on CodePen

 

Thank you so much for saving me tons of time looking though the docs

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