Jump to content
Search Community

Text Fill Up Gradient Animation

Gourav Mukhija test
Moderator Tag

Go to solution Solved by akapowl,

Recommended Posts

Hi Team,

Is there any greensock example where text gradient fill up animation happen from bottom to top ?

Example:
I am trying to build Text fill up animation where text is having some default color (e.g. Red color Text) and on button click gradient fillup animation start from bottom to top like water is filling from bottom to top (e.g. bottom to top text color change from blue to red)


CodePen: 
Reference Link: (something similar but default text color should be predefined and gradient color on fill up)

Thanks,

See the Pen PoXbbea by Gourav-Makhija (@Gourav-Makhija) on CodePen

Link to comment
Share on other sites

We love helping with GSAP-related questions, but unfortunately we just don't have the resources to provide free general consulting, logic troubleshooting, or "how do I recreate this cool effect I saw on another site?" tutorials. Of course anyone else is welcome to post an answer if they'd like - we just want to manage expectations.  

 

If you're looking for ScrollTrigger effects, I'd recommend looking at the demos at https://greensock.com/st-demos and https://codepen.io/collection/DkvGzg and https://codepen.io/collection/AEbkkJ - you may be able to use one of those as a jumping-off point. 

 

You are welcome to post in the "Jobs & Freelance" forum for paid consulting, or contact us directly. 

 

Otherwise, if you've got a GSAP-specific question just post that here along with a minimal demo and we'd be happy to take a look. 

 

This thread could provide some help as well:

 

Link to comment
Share on other sites

  • Solution

 

Hello @Gourav Mukhija

You've already got a basis for what you plan on doing with the codepen example you provided.

 

In the demo it is animating horizontally from left to right because you have set it up like that. I'm not sure I understand exactly what it is you want, but if you want it to animate vertically instead of horizontally, you can just tweak the values neccessary for it to work that way.

Those are e.g. the rotation of the gradient from 90deg to 0deg and in your CSS as well as the JS the values for background-size and/or position to be appropriately set for it to work vertically instead - the first parameter of those always refers to the horizontal axis and the second to the vertical axis.

 

https://developer.mozilla.org/en-US/docs/Web/CSS/background-size

https://developer.mozilla.org/en-US/docs/Web/CSS/background-position

https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient


I just tinkered about a bit and got it working like I imagine you'd want.
 

Hooking this up to ScrollTrigger the way you imagine, I'll leave up to you though. Good luck and happy tweening.

 

https://greensock.com/docs/v3/Plugins/ScrollTrigger


See the Pen PoXEgNz by akapowl (@akapowl) on CodePen

 

  • Like 3
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...