Jump to content
Search Community

Random Element Movement around starting position

emjay test
Moderator Tag

Recommended Posts

Hello GSAP friends :),


in the following pen you can see a simplified demo of a project I'm trying to implement. For better understanding a little background information about it:


The lightblue circle will later be a graphic that represents a process. The lines of the 4 tooltips point to different places of this graphic. You should be able to hover over a tooltip, then it will stop to move. If you click on a tooltip it will enlarge and some text will appear. If you leave the tooltip it will close itself again.


As you can see in my demo, the 4 squares are already moving. However, it doesn't really look nice because they all move quite evenly, plus there is a little pause at the end where I don't know how to prevent it.


Would someone have a tip on how I can create some kind of random movement around the start position that looks a bit more fluid?

(I tried to demonstrate the movement in the attached GIF).


And I have one more general question. I solved the lines to the square with a SVG which has no aspect ratio. If someone has a better idea or a tip from his own experience how I could solve this more elegantly, I would be very happy about it.


Thanks and best regards

emjay

 

random-movement.gif

See the Pen 8092d811ccf58f84597f3561fa3eacc4 by emjay (@emjay) on CodePen

Link to comment
Share on other sites

Hello @mikel,

 

thank you very much for your different approaches or perfecting them. :) I like it all much better to solve it with a SVG. However, I'm not so good at it yet, and I also have to display text that is maintained in a CMS.


In the following pen I demonstrated the hover effect to make it easier to understand what I want / have to display. As you can see, it already goes quite well, what I do not understand why the box shakes briefly when closing.

 

See the Pen b980ba33696a413a71e2811a19e06bef by emjay (@emjay) on CodePen

 

But I don't want to move too far away from your solution. Do you see that I can do this with just a SVG? Or should I try to optimize my solution. The random movement I have unfortunately still not managed well. Also the effect from your last pen is really great.


Really thanks again for your answers and the time you invested. Thank you!


Emjay

mouseover-text.png

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