Jump to content
GreenSock

Triable

How can i make the circle loop nicely?

Recommended Posts

I'm making an animation that pulses and has a circle that grow. I got the pulse and growing, but I can't seem to make it loop nicely. Anyone got any ideas?

I have a reference video, but it is to big to upload unfortunately.

 

Thanks in advance

 

Edit: codepen is changed to the finished animation

See the Pen VwLEobq by Triable (@Triable) on CodePen

Edited by Triable
codepen has changed
Link to comment
Share on other sites

Hey Triable, welcome to the GreenSock forums!

 

A video would be incredibly helpful. Maybe you could host it on YouTube unlisted and share the link with us? It's not clear what you want to happen, especially with the red ring.

  • Like 1
Link to comment
Share on other sites

Great idea!

 

here is the link: 

 

 

Link to comment
Share on other sites

Doing rings like that is actually not a very trivial thing in the DOM. Since outside clip paths don't exist with DOM elements, to do that with DOM elements properly you should use a clever clip path trick. That's what I used in this pen. However, animating clip paths is not very performant. Other hacky ways may exist depending on your exact use case.

 

I'd recommend doing this in Canvas. With Canvas it's much more trivial to create rings using the arc command. It's probably best to make a more abstract ring object whose values you can then animate. 

  • Like 1
Link to comment
Share on other sites

If you want to make it work with SVG you could do something like this:

 

See the Pen XWbyrOv by PointC (@PointC) on CodePen

 

Hopefully that helps. Happy tweening.

:)

 

  • Like 5
Link to comment
Share on other sites

13 minutes ago, PointC said:

If you want to make it work with SVG you could do something like this

Doh, I forgot about strokes :) Good work.

  • Haha 1
Link to comment
Share on other sites

 

just a variation of the concept of @PointC: with 'special ease'

 

See the Pen bGdQNrV by mikeK (@mikeK) on CodePen

 

Happy tweening ...

Mikel

 

  • Like 1
Link to comment
Share on other sites

Thank you all for your help! I was able to get exaclty what I wanted. Thanks again for your help!

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