NickNo Posted June 21, 2021 Share Posted June 21, 2021 Hi, I'm having a little trouble converting an old codepen over to gsap3 ... I thought I had it covered - but the transition has messed up - I have lost the skew and the back animation isn't right .... any suggestions? GSAP3 version See the Pen jOVoqKy by nickjacobsnz (@nickjacobsnz) on CodePen GSAP2 version See the Pen zYZXMJm by nickjacobsnz (@nickjacobsnz) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted June 21, 2021 Share Posted June 21, 2021 There is no "className" plugin baked into GSAP 3. We removed that for several reasons: It's almost always better to directly animate individual properties. It's MUCH faster (performance). Animating to/from a class requires literally comparing every...single...CSS property and isolating the ones that are different. We wanted to streamline things in GSAP 3 and shave off file size. For your demo, you can just animate the clipPath property since that's the only thing those className tweens were doing: See the Pen oNZOJaY?editors=0010 by GreenSock (@GreenSock) on CodePen I personally would structure things a bit differently so that it's all dynamic. That means if the user clicks multiple times quickly, it still works smoothly: See the Pen yLMrGQr?editors=0010 by GreenSock (@GreenSock) on CodePen 1 Link to comment Share on other sites More sharing options...
NickNo Posted June 21, 2021 Author Share Posted June 21, 2021 Hey that's great thanks Jack - thanks for the very helpful response! Link to comment Share on other sites More sharing options...
GreenSock Posted June 21, 2021 Share Posted June 21, 2021 No problem! Enjoy. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now