Jump to content
GreenSock

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

SVG animation Safari

Recommended Posts

Hello

 

I'm faced with incorrect rendering of animated SVG clipPath in Safari. 
Seems like rectangle clipPath goes well, it affects only clipPath created by path. 
 
Any help will be very appreciated

See the Pen qbdyyR by Quadrosh (@Quadrosh) on CodePen

Link to comment
Share on other sites

Hello Poulsh and Welcome to the GreenSock Forum!

 

I'm not near my computer right now. But looking at your codepen it looks like a webkit bug, i notice you are animating the CSS top property. You should really be animating y instead! Animating top or left translate the element on a pixel level. Whereas animating x and y animate on a sub-pixel level making it buttery smooth.

 

For example, so this

.to("#GreetingCard", 1, {css:{top:-100}, ease:Power1.easeOut}, "greetingUP")

Would be this:

.to("#GreetingCard", 1, {css:{y:-100}, ease:Power1.easeOut}, "greetingUP")

You would need to change top to y (translateY)

 

Basically you would only use position top, right, bottom, and left when you set the initial position of your elements using position relative or absolute. And then you would use CSS transforms like x, y, and z when animating.

 

And keep in mind that SVG only supports animating using 2D transforms. Animating CSS transforms will always be more smoother than animating top and left, due to the sub-pixel rendering.

 

Also some additional information on what you mean by incorrect rendering ?

 

Thanks :)

  • Like 2
Link to comment
Share on other sites

Thank you, Jonathan

 I found the bug, it was the intersection of two objects. I corrected the code as you advised. 

Thanks for support.

Link to comment
Share on other sites

Hey, has the Codepen for this been deleted? Maybe it's a Codepen limitation / error, but given that this is a community centred around shared learning, it would be helpful if any Codepen's related to the thread were preserved, so that others can reference and learn from them. Thanks. :)

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