Jump to content
Search Community

Can I make my code in a more elegant way?

soma
Moderator Tag

Go to solution Solved by PointC,

Recommended Posts

Posted

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.

  • Solution
Posted

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
Posted
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

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