JamesGrubb Posted October 7, 2020 Share Posted October 7, 2020 Hello just wondering if its possible to tween the values of two arrays? See the Pen BazaQRw by limitedunlimited (@limitedunlimited) on CodePen Link to comment Share on other sites More sharing options...
mikel Posted October 7, 2020 Share Posted October 7, 2020 Hey @JamesGrubb, I am not sure what exactly you want to achieve. This is how you could use GSAP attr : See the Pen zYxgdRw by mikeK (@mikeK) on CodePen Happy tweening ... Mikel 1 Link to comment Share on other sites More sharing options...
JamesGrubb Posted October 7, 2020 Author Share Posted October 7, 2020 Thanks, Im using svg.js its allows you to write path data as an array as in my pen. I wondered if it was possible between the array values Link to comment Share on other sites More sharing options...
ZachSaucier Posted October 7, 2020 Share Posted October 7, 2020 GSAP has the endArray plugin built into that tweens between arrays but it's not built to support mixed data types like you have (strings and numbers). As such you would need to write your own logic for combining the arrays. Something like this: See the Pen zYBYwpg?editors=0010 by GreenSock (@GreenSock) on CodePen However it's much easier to just use GSAP's MorphSVG plugin or animate the attr like mikel said 1 Link to comment Share on other sites More sharing options...
JamesGrubb Posted October 7, 2020 Author Share Posted October 7, 2020 Yea , makes sense thank you. 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