Jump to content
Search Community

fullscreen image scrolling to reveal text / page immediately below

modernanim

Go to solution Solved by Rodrigo,

Recommended Posts

Posted (edited)

I came across this website that has a lovely homepage text 'reveal': https://vervaunt.com

Essentially I'd like to try and recreate a similar thing, where a homepage fullscreen 'hero' reveals a 'content' area below that appears to be fixed under the 'hero' until the 'hero' has scrolled out of the way...

Is tis even possible with GSAP? The code pen above is as far as I got!

Any help much appreciated!

All the best

Matt

Mica_Screenshot 2025-03-05 at 02.44.02.jpeg

See the Pen emYWzpo by dezbat (@dezbat) on CodePen.

Edited by modernanim
typo!
Posted

Hi @modernanim welcome to the forum!

 

Yep this is certainly possible with GSAP, but the trick is create the animation you want and then hook that animation to ScrollTrigger. The best thing to do when working with ScrollTrigger is to remove it! This seems counter intuitive, but ScrollTrigger is just animating something on scroll, so just focus on the animation at first and only when you're happy with the animation add ScrollTrigger back in. This way you can focus on one part at a time and it will save a lot of headache when debugging.  
  
Most of the ScrollTrigger effects you see are just moving things on the y-axis instead of scrolling them, then hooking that animation to ScrollTrigger will give the illusion of scrolling, but they are really just animating! Getting to grips with this knowledge will make it so much easier to create all kinds of effects, I've written a whole post about it, check it out:

 

 

Posted

Ummm... I think I get it... 

So in this instance, get the animation working correctly with NO scroll interactions first?

Ie

1. slide the 'hero' image off the underlying content in a way I like.. then

2. Hook that to scroll trigger?

the only thing is the whole feel of it is to do with the standard scroll behaviour 'revealing' a surprise layer underneath...

 

Posted

I would create an element, something like .myTrigger and put both of your (lets call them) cards in it. Use some CSS to stack both cards, see my post for a simple CSS grid trick. 

 

Then move card one 100% of its height eg yPercent: -100 up and have a ScrollTrigger that pins .myTrigger. 

 

47 minutes ago, modernanim said:

the only thing is the whole feel of it is to do with the standard scroll behaviour 'revealing' a surprise layer underneath...

If the element moves 100% of its own height (with a linear ease) and your ScrollTrigger lasts for that amount of distance, it will feel like if it was just scrolling normally. If you don't tell anyone I won't either 😉 🎩 🪄 

 

Hope it helps and happy tweening! 

 

See the Pen ogNWwWz?editors=0010 by mvaneijgen (@mvaneijgen) on CodePen.

 

  • Like 1
  • Solution
Posted

Hi,

 

Maybe something like this:

See the Pen wBvdpqL by GreenSock (@GreenSock) on CodePen.

 

Hopefully this helps

Happy Tweening!

Posted

Just got a moment for this — and big thanks to both @Rodrigo and @mvaneijgen — straight off the bat in Codepen it looks like Rodrigo might have nailed it, just lookign throihg the related info.

Posted

Actually @mvaneijgen has got this right too, just been toying with your helper commented .js — realyl helpful, thanks so much, a solution + learning experience!

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