Jump to content
Search Community

Animate a clip path on a pseudo element with scrolltrigger

Jloafs test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

  • Solution

Browsers won't allow JavaScript to access any pseudo elements. It's like they're ghosts :)

 

So you can simply use CSS variables to do something like that:

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

 

Also, be careful that you don't apply CSS transitions to the same elements you're animating with GSAP. It's terrible for performance, totally wasteful, and the CSS transitions will make the GSAP animations take longer because every time GSAP makes a change, the CSS transition interrupts and says "nope! I'm gonna drag that out for ___ seconds".

 

And you don't have to create a timeline if you're just gonna populate it with one tween. You can just use a tween instance to simplify things. 

 

I hope that helps. 

  • Like 2
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.
×
×
  • Create New...