Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
jp_uk81

MorphSVG .hover()

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

Thank you pointC,

I've improved the svg and the animation now it's smoother.

Now I'm trying to make the text follows the animation on hover the but I'm stuck here.

I'm pretty sure the way I set the elements of the button it's a bit messy but not sure how to improve it

Shall I animate the position of the text or there's a better way to approach this?

 

See the Pen pozeKMy by gianpiero-di-lullo (@gianpiero-di-lullo) on CodePen

 

Thank you!

Link to comment
Share on other sites

I think I'd probably put this on a timeline and play/reverse on hover. Maybe something like this:

 

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

 

Does that help? Happy tweening.

:)

 

  • Like 2
Link to comment
Share on other sites

Perfect! thank you!

Only thing is that the text is not aligned when the page is loading and then jumps into position

 

See the Pen pozeKMy by gianpiero-di-lullo (@gianpiero-di-lullo) on CodePen

 

 

Link to comment
Share on other sites

That's a bit of FOUC. You can set the .container (or whatever element you like) to an opacity: 0  and/or visibility: hidden in your CSS and then use GSAP to set it back to 1. Something like this:

TweenMax.set(".container", {autoAlpha:1})

Happy tweening.

:)

 

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