Jump to content
GreenSock

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

How can I draw an SVG from its starting point to its full version?

Go to solution Solved by PointC,

Recommended Posts

Hi @animationmagic :)

 

DrawSVG won't work on any of these elements because they are all filled paths.  DrawSVG only works on strokes. If you simply want the scale to start at the lower right of your leaf, you can change the transformOrigin like this.

 

See the Pen 6fedd968003847755d5385b3f99edeb0 by PointC (@PointC) on CodePen

 

Happy tweening and thanks for being a Club member. We really appreciate the support.

:)

 

  • Like 5
Link to comment
Share on other sites

Hi @PointC,

 

Thanks so much for your help. This is great!

 

I added it in, but it seems I am missing something since the right leaf comes in from way to the right side. Am I missing something on the transformOrigin?

 

See the Pen ZEXjRyJ by lisaschumann (@lisaschumann) on CodePen

 

Absolutely love GSAP!

 

Link to comment
Share on other sites

The right leaf needs to grow from the lower left so it would be:

transformOrigin: "0% 100%",
  // or this works too
transformOrigin: "left bottom",

Make sense?

:)

 

  • Like 2
Link to comment
Share on other sites

  • Solution

PS I should also mention, since this is an SVG, you can also use the very handy svgOrigin. So this would work too.

 

    .from("#leafs > *", {
      scale: 0,
      svgOrigin: "192 192",
      duration: 1.4,
      ease: "power1.inOut",
      stagger: 0.5
    });

Happy tweening.

:)

 

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