Jump to content
GreenSock

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

Simple square SVG mask centred

Recommended Posts

Hi everyone, can can someone please help.

 

I'm playing around with a SVG mask (first try with CSS too, so please bear with me). I have taken an existing round mask/animation previously shown on codepen and have chosen to make it square. But at the moment the animation seems to animate top left, I'd like this to start from the centre.

I have tried to playing around with the 'transformOrigin' but it doesn't seem to change, what am I doing wrong?

 

thanks in advanced.

See the Pen WNEqMZW by velvetsoup (@velvetsoup) on CodePen

Link to comment
Share on other sites

Use scale instead of tweening the attributes. You'll also want to set the width and height of the rectangle to 100 because the viewBox is 100 x 100.

 

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

 

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