Jump to content
GreenSock

soma

Can I make my code in a more elegant way?

Go to solution Solved by PointC,

Recommended Posts

Hi!
I've made a simple follow cursor animation for my current project. I think I could make it better or shorter (maybe with a forEach), but I don't know how. Can somebody help me with this? 

Thanks

See the Pen vYdRNQb by szsoma (@szsoma) on CodePen

Link to comment
Share on other sites

  • Solution

Hi @soma :) 

 

Here's a nice little function @GreenSock showed me when I was learning about the new quickTo. I was using a Draggable, but I've modified it a tiny bit to listen for your mousemove event.

 

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

 

Happy tweening.

:)

 

  • Like 3
Link to comment
Share on other sites

oooh useful. 🏆

Link to comment
Share on other sites

Jack is fancy. 

giphy.gif

  • Haha 1
Link to comment
Share on other sites

8 minutes ago, PointC said:

Hi @soma :) 

 

Here's a nice little function @GreenSock showed me when I was learning about the new quickTo. I was using a Draggable, but I've modified it a tiny bit to listen for your mousemove event.

 

 

 

 

Happy tweening.

:)

 

Hi Craig!
That's awesome, thanks! I have to sharpen my JS skills... 😅

  • Haha 1
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.
×