Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
ZachSaucier

How NOT to use GSAP

Recommended Posts

lol. this is awesome. you were exposed to many horrors around here ;)

 

 

 

 

  • Haha 4
Link to post
Share on other sites

Truly truly cursed codepens

Link to post
Share on other sites

Anything that uses jQuery for selectors and creating animations setTimeout/setInterval would get my vote. setTimeout/setInterval has this wonderul effect when you switch tabs and come back 10 minutes later... 100,000 animations all starting at the same time.

 

 

  • Like 1
Link to post
Share on other sites

I think I have a pretty neat solution here for getting a div to move back and forth. Think something like a yoyo, but horizontally. I'm still working on the reason the opacity doesn't go back to 100% on the second pass, but other than that, I'm pretty happy with it. Maybe I'll add a rotation this weekend if I have time.

 

See the Pen WNRYpZY by PointC (@PointC) on CodePen

 

Edit: I'm kinda wondering if I can make it a little smoother too. I'll work on it.

  • Like 2
  • Haha 2
Link to post
Share on other sites

Love the naming!

$(".l2-ht-gr-001-bnew-iewq-4g7-kl3478-vqw-kl09-alewq-63rt-copy")

 

That reminds of more bad jQuery stuff. Always using class names to keep track of state.

if ($(".l2-ht-gr-001-bnew-iewq-4g7-kl3478-vqw-kl09-alewq-63rt-copy").hasClass("active")) {
  ... 
} else {
  $(".l2-ht-gr-001-bnew-iewq-4g7-kl3478-vqw-kl09-alewq-63rt-copy").addClass("active");
}

 

  • Like 1
  • Haha 2
Link to post
Share on other sites

@PointC I completely forgot about the CSS wrapper, haha.

  • Haha 2
Link to post
Share on other sites

All functions must be arrow functions that include arrow functions. Everything must be a one liner.

 

TBH, I'm actually surprised at how smooth that animation is using setTimeout.

  • Like 1
Link to post
Share on other sites
46 minutes ago, OSUblake said:

TBH, I'm actually surprised at how smooth that animation is using setTimeout.

 

It's because it's written using Smarter Animation Code™️

Link to post
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.

×