Jump to content
GreenSock

Lynx

Reveal image with bezier path ?

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

Hi, I want to reveal this, using bezier paths, at first it's invisble, then an object moves from the top, down following the path of the image to reveal the image. 

 

How do I hide the image before revealing ?

Link to comment
Share on other sites

Check out my plant generator. It definitely has the growing vine look you were going after. 

 

See the Pen gpGEye by osublake (@osublake) on CodePen

  • Like 2
Link to comment
Share on other sites

Still trying to make stuff grow.  ;-)

 

You should start out with something basic like a rectangle.

See the Pen 45acd3617e6ec885fe7df8e1e705e0be by osublake (@osublake) on CodePen

 

Then check out this post by Sara Soueidan to create more complex shapes.

http://sarasoueidan.com/blog/css-svg-clipping/

 

This is perfect.  Except I set stroke="#000000" for the id=rect so I could see the rectangle, but the rectangle is not showing with a black outline ?

 

The only problem with your last example; post #3, is varying widths, which I know gsap can't do. 

 

Can you control control the speed to which it's revealed by two methods, the speed someone swipes on a touch device and the speed to which someone scrolls on a desktop ?

Link to comment
Share on other sites

Great examples, Blake.

 

Lynx, you can't see the border of the rect because it is being used as a clip path. If you could see it then it wouldn't work as a mask.

To see the rect you can just rip out the clip path info in svg and css: http://codepen.io/GreenSock/pen/40d638c9981d1f1afb72c1abfabf4be6

 

Can you control control the speed to which it's revealed by two methods, the speed someone swipes on a touch device and the speed to which someone scrolls on a desktop ?

 

 

Yes, you could use Draggable and ThrowPropsPlugin to contol how quickly the rect grows. In simple terms you can use a ThrowProps tween to control the progress() of the tween that makes the rect grow OR you could use a proxy object that "thows" the height of the rect. Note how the cube in this tutorial spins based on "swipe speed"

http://greensock.com/cube-dial-tutorial 

 

For controlling the speed based on Scrolling please investigate the jQuery plugin ScrollMagic: http://scrollmagic.io/

  • Like 1
Link to comment
Share on other sites

Well Carl beat me to it. I was going to suggest just creating a copy of your path while you are working on it, and then animate both of the elements. Just be sure to remove the copy when you are done.

 

See the Pen 45acd3617e6ec885fe7df8e1e705e0be by osublake (@osublake) on CodePen

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