Jump to content
Search Community

Change text color above the image during scroll

PiotrNowak.info test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hello i need help. I want create animate similar to that.

See the Pen MKqBjX by eighthday (@eighthday) on CodePen

But more element, please look image, this effect is.
Honeyview_effects.jpg.7b4f273c08990be1afb73f10d36c5147.jpg

I cen create slide element but how I cane create text effects, change the text quality above the image

this is my codepen

Thank you
Best regards Piotrek

See the Pen LYYLzbe by PiotrNowak_info (@PiotrNowak_info) on CodePen

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for the demo.

 

What you're trying to do is definitely not the easiest thing. With that being said, I would not recommend doing it the way you're trying to, calculating the offset of the text and updating your second version of the text. That is very performance intensive.

 

Instead, I would recommend trying  to setup your page to work more like this demo where both text versions are always in sync but the "mask" is the part that determines which is shown:

See the Pen yLBEybE?editors=1000 by GreenSock (@GreenSock) on CodePen

 

This approach may be difficult with how much movement you have in your demo though.

Link to comment
Share on other sites

  • 3 years later...

Hi,

 

Unfortunately as Zach stated before this is not the easiest thing to achieve using regular DOM elements and CSS. The best option I can think of is using SVG masking. Make the entire section an SVG tag and use a mask.

 

This example by @creativeocean could shed some light on how to achieve this:

See the Pen qBbBLyB by creativeocean (@creativeocean) on CodePen

 

Also you could explore the examples in this article:

https://bashooka.com/coding/css-svg-text-mask-examples/

 

Hopefully this helps.

Happy Tweening!

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...