Cuberto / mouse-follower

A powerful javascript library to create amazing and smooth effects for the mouse cursor on your website.
MIT License
724 stars 60 forks source link

Changing colour of cursors (for those that don't know) #31

Closed alex-rankin closed 9 months ago

alex-rankin commented 1 year ago

Hey, this is for other slow folks (like me) that might run into this as it's not in the readme.md!

To change color on anything you just need to do: data-cursor="-your-color"

Then in your styling you can just do: .-your-color { color: #fb6052; }

Took me longer than it should to figure this out (ended up writing my own way of implementing until i stumbled on it LOL)

Anish-Aby commented 11 months ago

Could you explain in a little more detail? I'm using the CDN given, would your method work for that as well? I tried putting it here as such: var cursor = new MouseFollower({ speed: 0.5, ease: "sine.out", "data-cursor": "#EB5939", });

alex-rankin commented 11 months ago

You would add the data-cursor="-your-color" to your element that you want to change color when mouse over.

eg. <a href="/" data-cursor="-your-color">

Which you would style separately

Anish-Aby commented 11 months ago

got it working! thank you so much haha

Drafteed commented 9 months ago

35