Jump to content
Search Community

Lissajous Curves GSAP 3

DLong test
Moderator Tag

Recommended Posts

I noticed a few things:

  • You had a bad value:
    // BAD
    x: "+= + ${somePI}",
      
    // GOOD
    x: `+=${somePI}`,
      
    // ALSO GOOD
    x: "+=" + somePI,

     

  • Your modifier was returning NaN because the "x" value that gets passed in is a string with units, like "0px", so Math.cos("0px") is NaN. 
  • You're using the old syntax where the duration is the 2nd parameter. It still works, but I'd encourage you to move to the more modern syntax where "duration" is in the vars. 
  • You don't need your own random() function - GSAP has that built in. gsap.utils.random()

Here's a fork with the corrections in place:

See the Pen KKaJPbp?editors=0010 by GreenSock (@GreenSock) on CodePen

 

Does that clear things up? 

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