Jump to content
Search Community

Mouse point morph to object on hover

smallio test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi guys,

 

I'm seeing a lot of websites use this effect as of late. Here is one - https://en.leviev-group.com/

 

I'm trying to recreate it with green sock and have managed to do it. I'm stuck applying it to more then one object though. For example if I had multiple shapes on the page, I'd like to make the mouse dot morph into them as you hover over them, with the magnetic effect I've been working on in codepen. 

 

Does anyone know of any cleaner examples or know how to do this for multiple objects?

 

Cheers,

Will

See the Pen RQwRVj by smallio (@smallio) on CodePen

  • Like 1
Link to comment
Share on other sites

I wish I had time to help you with the custom code, @smallio - it's a bit beyond what we can normally provide here in these forums which are intended to be pretty focused on GSAP-specific questions. Your code looked like it was maybe compiled from somewhere too which makes it rather awkward. Perhaps someone else can lend a hand - seems like something @OSUblake might enjoy ;)

  • Like 3
Link to comment
Share on other sites

Thanks @GreenSock! I'd love if someone like @OSUblake could point me in the right direction. I'm not expecting proper help,  I just posted on the off chance someone had something they had worked on recently as most of the code is done and the part I'm looking to do is basically only Greensock (I think anyway aha) 

 

I also accidentally removed babel & didn't notice that when I posted. It's reverted now & only like 50 lines :) Might help if anyone is interested! 

 

I'll try and keep it a bit more on topic in future. Do you know where the best place to post things like this are?  I think it would be cool to have a sub forum where people could post their progress and contribute like a team!

 

Thanks again :)

 

Will

 

 

  • Like 1
Link to comment
Share on other sites

Based on just a quick look, could you not pass the target as an array of items rather than a single item selected by id and then run the logic that detects proximity and fires the reactive animation through a loop or each to test each one individually against the cursor.

  • Like 3
Link to comment
Share on other sites

9 hours ago, smallio said:

I'll try and keep it a bit more on topic in future. Do you know where the best place to post things like this are?

 

Oh, it's totally fine to post here. It's not like we get offended or anything - I just wanted to set expectations properly (lest you or others get frustrated, like "why aren't they giving me an answer?")

 

No problem at all. If someone can pitch in and help, awesome! If you do the same for someone else, even better! That's the type of attitude we like to foster around here in general. 

 

Happy tweening!

  • Like 1
Link to comment
Share on other sites

Do you mean morph into different shapes? Or just scale up when you hover certain elements? You are just using HTML, for morphing you will need to use SVG throughout your project. I just posted a demo in following similar thread, my implementation is far different than yours but see if that helps.

 

 

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