Jump to content
GreenSock

Lillian.S

R.Sp anim

Moderator Tag
Go to solution Solved by GreenSock,

Recommended Posts

Hi Friends,

Trying to animate the clip path, not the div and containing elements, but don't know how to implement it to gsap.

It is animating the whole div atm.

 

any help would be appreciated.

Best,

Lillian

See the Pen RwYxxbX?editors=0010 by lillianli (@lillianli) on CodePen

Link to comment
Share on other sites

  • Solution

Hi @Lillian.S. GSAP can animate clipPath, but I don't think that's really what you want here because of the way you've got your CSS set up with the background-size set to cover and a set width/height. I suspect it'd be easier and more performant to wrap it in a container with a border-radius, animate the skewY of that, but counter-animate the skewY of the element in the opposite direction simultaneously. But you've gotta scale that inner <div> so that its edges extend far enough to cover the area you're exposing with the skew: 

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

 

I hope that gets you going in the right direction. Happy tweening!

  • Like 2
Link to comment
Share on other sites

It did a trick! Thank you very much. 🙂

  • Like 1
Link to comment
Share on other sites

On 3/12/2023 at 2:22 AM, GreenSock said:

Hi @Lillian.S. GSAP can animate clipPath, but I don't think that's really what you want here because of the way you've got your CSS set up with the background-size set to cover and a set width/height. I suspect it'd be easier and more performant to wrap it in a container with a border-radius, animate the skewY of that, but counter-animate the skewY of the element in the opposite direction simultaneously. But you've gotta scale that inner <div> so that its edges extend far enough to cover the area you're exposing with the skew: 

 

 

 

I hope that gets you going in the right direction. Happy tweening!
 

Thanks for helping me as well, you made my day :)

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