Jump to content
Search Community

Animating text from right to left

marcusps1 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

I have some tex that needs to disappear from right to left (it is getting wiped away by a windscreen wiper)  Currently I have it so it fades out but I need it to disappear differently.

 

Here is my current code 

this.timeline.from(".section1", speed, {opacity: 0}, "-=" + (speed / 2));
this.timeline.to(".section1", speed, {opacity: 0, delay: 2});

How would i do this?

Link to comment
Share on other sites

HI and welcome to the GreenSock forums,

 

For questions like these it is very important that we can see what is happening.

Please post a very simple demo with just the code necessary to illustrate the issue:

http://greensock.com/forums/topic/9002-read-this-first-how-to-create-a-codepen-demo/

 

You said you need it to work differently but I'm not sure what that means. Please clarify. Thanks!

  • Like 1
Link to comment
Share on other sites

Hey Marcus, are you talking about masking it away?  If it's just disappearing from right to left, you could put it in a div with the overflow set to hidden and then tween the width of the div so that it disappears.

 

You can also use clip rect for straight lines: 

See the Pen eZgywN by ohem (@ohem) on CodePen

 

Or if it needs to be wiped away at an angle, you could use/rotate SVG masks, or possibly MorphSVG could make sense too.  Here's an example of SVG masks using MorphSVG.  I forked it a while ago for future use:

See the Pen MaoMvo by ohem (@ohem) on CodePen

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