_Greg _ Posted July 8, 2020 Posted July 8, 2020 Hi! How can i animate text from last character to first? I can't find any demo about it. Thank you! See the Pen pEKYVz by GreenSock (@GreenSock) on CodePen.
ZachSaucier Posted July 8, 2020 Posted July 8, 2020 Heye Nekiy2. First off, that demo is using an old version of GSAP. We highly recommend using GSAP 3. I updated the demos in the SplitText docs. As for your question, you can just reverse the arrays before using them as the target. JS has a handy .reverse() method for that. For example: mySplitText.split({type:"chars"}) mySplitText.chars.reverse(); splitTextTimeline.from(mySplitText.chars, {stagger: 0.1, ... }); 2 1
Carl Posted July 8, 2020 Posted July 8, 2020 Yeah, with GSAP 3 you have many more options for staggering. Check out this video on the stagger object which lets you stagger from "end" and "center" animation.from(split.chars, {opacity:0, y:50, ease:"back(4)", stagger:{ from:"end", each:0.05 }}) Demo here: See the Pen BajxopX by snorkltv (@snorkltv) on CodePen. 3 1
_Greg _ Posted July 8, 2020 Author Posted July 8, 2020 Thank you, @ZachSaucier thats exactly what i want Thank you, @Carl greate idea!
GreenSock Posted July 8, 2020 Posted July 8, 2020 Insider tip: If you want to go from the end, you can actually just use a NEGATIVE stagger value 4
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