Jump to content
Search Community

How to make a left to right image reveal using GSAP

Just_Jack test
Moderator Tag

Recommended Posts

Hi,

 

Without a minimal demo or an example is really hard to know exactly what you mean.

 

Maybe clip path could be helpful in this scenario. Here is an example that uses ScrollTrigger, which can be removed super easy in order to use just GSAP:

See the Pen eYjoOEW by GreenSock (@GreenSock) on CodePen

 

In order to create a lateral reveal you only have to change the start and end values. This tool is super helpful for that.

https://bennettfeely.com/clippy/

 

Finally remember that when using clip path with GSAP always express the values in percentage:

gsap.to(image, {
  clipPath: "polygon(0% 100%, 100% 100%, 100% 0%, 0% 0%)"
});

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