Jump to content

Search In
  • More options...
Find results that contain...
Find results in...
Stefano Monteiro

Percentage Based Position

Recommended Posts



Two issues I am facing here:


1 - Shouldn't the second tween start half way trough the first with '-=50%?

2 - Why is the inside of the A not animating? Also, anyway to make the animation start from the left bottom of the svg?


See the Pen WNRZmGO by stefanomonteiro (@stefanomonteiro) on CodePen

Link to comment
Share on other sites

Hey Stefano!

Sure thing - I can help with both of these - 

'-=50%' is saying offset by 50% of my own duration.

'<50%' is offset by 50% of the previous tweens duration

Check out this codepen - it'll help!

See the Pen PopXddg?editors=1000 by GreenSock (@GreenSock) on CodePen

In terms of the stroke animation - drawSVG draws out the stroke of SVG paths or shapes - you have a shape with a fill and a stroke around that fill. 

Pen forked to demonstrate

See the Pen bGWXPPr by GreenSock (@GreenSock) on CodePen

Hope this helps!

  • Like 4
Link to comment
Share on other sites

Thanks Cassie.


Silly mistake o the Position.


About the svg, the path d property has two lines. One being the inside of the A. The code is at the end (M59.46,121H43.85L59.46,98.51Z). Differently than I thought it is being drawn, but very quickly at the beginning. Is there any way to animate this line separately, even though is part of the same path?


See the Pen WNRZmGO by stefanomonteiro (@stefanomonteiro) on CodePen

Link to comment
Share on other sites

Note that %-based position parameter values were added in 3.7.0 but your Demo is using an older version so those won't work. 


As for separating that stroke out, sure. You can just use a different <path> for each stroke and then another one for the fill if you'd like: 

See the Pen bGRbbNO?editors=0010 by GreenSock (@GreenSock) on CodePen

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