dawid660 Posted September 10, 2020 Share Posted September 10, 2020 It is possible to set a "mixin" to animation like this: const example = () => { return ( { fill: "609E78", duration: 1.58 }, { fill: "E69D00", duration: 0.41 }, { fill: "609E78", duration: 0.09 }, { fill: "609E78", duration: 0.5 }, { fill: "E69D00", duration: 0.41 }, { fill: "609E78", duration: 0.09 }, { fill: "609E78", duration: 6.91 }, ) } function implementationAnimation() { gsap.to([dot1_CODE], { keyframes: [ { fill: "609E78", opacity: 1, duration: 0.01, delay: 2 }, example() ], repeat: -1, }); I want to use "example" in some other place Link to comment Share on other sites More sharing options...
ZachSaucier Posted September 10, 2020 Share Posted September 10, 2020 Hey dawid660. Sure. I'd just use an array and the spread operator: See the Pen qBZoJry?editors=0010 by GreenSock (@GreenSock) on CodePen 2 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