Jump to content
Search Community

How to achieve this text color replace animation.

JPM82 test
Moderator Tag

Recommended Posts

If you look at the example in the codepen, what I want to happen is the white text will turn black as the background moves to the right.  I want this to be a seamless transition.  I've seen this in other examples using svgs and masks, but I'm at a total loss as to how to achieve this.  I'd prefer to not use SVG's if possible, only because this is going to be the hero section of a page, and I'd like the content to be changed at anytime but still keep the effect in tact.  Is this possible?  Any help or assistance would be wonderful. Thank you! 

See the Pen qBVMmyE by Gemini7401 (@Gemini7401) on CodePen

Link to comment
Share on other sites

You can try using the css property mix blend mode for the text but you cannot apply transitions on it, but the hero section would need a background color of white, removing the z-index on the hero:before element would help. see below

 

See the Pen ZEaMVxy by Anurella (@Anurella) on CodePen

 

I think SVG masks would be great, you can use text in SVG. check out @PointC tutorial https://www.motiontricks.com/invert-svg-text-with-a-mask/

 

  • Like 5
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...