Share Posted September 8, 2020 I'm trying to make this codepen example into React. But unable to do it with new version of Gsap and also new to GreenSock's animation. Here is the current React example in sandbox: https://codesandbox.io/s/cool-forest-ddzft?file=/src/drag.js See the Pen 757300508dfb03b01b3e3fad237576b7 by Ilima (@Ilima) on CodePen Link to comment Share on other sites More sharing options...
Share Posted September 8, 2020 Hey Ilima. The stagger docs cover how to use GSAP 3 staggers though I don't understand why a stagger is required as the original demo has 0 duration between each animation which is the same thing as not having a stagger. cycle was replaced by gsap.utils.wrap, as covered in the GSAP 3 release notes though I don't understand why that original pen used cycle at all, they could just use a functional value for the rotation property. I think your issue is a React issue and I don't know enough about React to help. Maybe someone else will be able to help. 1 Link to comment Share on other sites More sharing options...
Author Share Posted September 12, 2020 On 9/8/2020 at 2:11 PM, ZachSaucier said: Hey Ilima. The stagger docs cover how to use GSAP 3 staggers though I don't understand why a stagger is required as the original demo has 0 duration between each animation which is the same thing as not having a stagger. cycle was replaced by gsap.utils.wrap, as covered in the GSAP 3 release notes though I don't understand why that original pen used cycle at all, they could just use a functional value for the rotation property. I think your issue is a React issue and I don't know enough about React to help. Maybe someone else will be able to help. Thank you so much! Solved my issue, also looks like I was just not using the state values. gsap.to(".dialGrip", 0.6, { rotation: function (i) { return i === 0 ? rotation * 2 : rotation * 3; }, stagger: 0, }); 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