FLYPILOT Posted April 27, 2023 Share Posted April 27, 2023 I've this split text animations, and I've a background color on a <p> and would like to animate this with the split text animation. Is that even possible? See the Pen BaqQJZJ by jo-o-luiz-de-figueiredo-magalh-es (@jo-o-luiz-de-figueiredo-magalh-es) on CodePen Link to comment Share on other sites More sharing options...
Cassie Posted April 27, 2023 Share Posted April 27, 2023 Hey there! How are you aiming to animate it? Do you just want to change the background from blue to a different color? Link to comment Share on other sites More sharing options...
FLYPILOT Posted April 27, 2023 Author Share Posted April 27, 2023 Hey @Cassie thanks for reply to this. I want to change from transparent to blue, as the bg have the same time appearing than the text. Link to comment Share on other sites More sharing options...
GreenSock Posted April 27, 2023 Share Posted April 27, 2023 I'm having a hard time understanding exactly what you want, but the fundamental problem there was that the backgroundColor is on the parent element, not the things you were animating. If you're trying to animate the backgroundColor of each word, here's a quick demo: See the Pen oNawGbv by GreenSock (@GreenSock) on CodePen Hopefully that gets you going in the right direction. 👍 Link to comment Share on other sites More sharing options...
FLYPILOT Posted April 27, 2023 Author Share Posted April 27, 2023 Thanks @GreenSock this is a half solution that I got here as well. However this don't have the same look as on the pen I've shared. With this we have empty spaces between the words. I think, a lines and words solutions could work for me. animate each line and them animate the words for that line, is that even possible? Link to comment Share on other sites More sharing options...
GreenSock Posted April 28, 2023 Share Posted April 28, 2023 Here one way to do it: See the Pen QWZgVQG?editors=0010 by GreenSock (@GreenSock) on CodePen Link to comment Share on other sites More sharing options...
Solution FLYPILOT Posted April 28, 2023 Author Solution Share Posted April 28, 2023 Hey guys, thanks for the help. I've found the solution in my project and I wasn't able to apply to the pen. However here is the code for the solution: splitTextTimeline .from( mySplitText.lines, { delay: 0.5, backgroundColor: 'transparent', opacity: 0, stagger: 0.35, y: 10, autoAlpha: 0, } ) .from( mySplitText.words, { stagger: 0.15, duration: 0.4, y: 10, autoAlpha: 0, ease: "Power1.easeInOut", }, "<+=0.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