Jump to content
Search Community

Can I Morph this complicated SVG?

Shalaw Fatah test
Moderator Tag

Recommended Posts

Hey Shalaw and welcome.

 

The biggest issue is that you're not properly loading GSAP or MorphSVG in your CodePen. We recommend that you start CodePens by forking the GSAP Starter Pen so that you make sure that all GSAP plugins are loaded.

 

The second issue is that you're attempting to morph an SVG <rect> (.cls-1) which, as Craig (PointC) pointed out in your other thread related to morphing SVGs, won't work. MorphSVG works with SVG <path> elements. So you should convert that to paths as well:

MorphSVGPlugin.convertToPath("polygon, rect");

The third issue is that you're attempting to morph that into a <g> element (.cls-2), which won't work for the same reason. You should select an individual path instead.

 

In this case you likely want to loop through each path and create a tween that morphs that path into the other path that you want it to turn into. Optionally you could make these tweens part of a timeline so that you have control over all of them at the same time.

 

Does that make sense? We're happy to help if you have specific issues.

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