delux Posted July 28, 2020 Share Posted July 28, 2020 Hello! I have an animation of flying elements on gsap - the elements move slightly when the cursor moves, please tell me how to make these elements move (a little slower) even if you do not move the cursor? That is, the page loaded, and the elements began to float slightly .. moved the cursor - they move a little faster - is that possible? See the Pen eYJagvz by Alexandr (@Alexandr) on CodePen Link to comment Share on other sites More sharing options...
mikel Posted July 28, 2020 Share Posted July 28, 2020 Hey @delux, Do you mean such a constellation? See the Pen mdVJxwj by mikeK (@mikeK) on CodePen Happy tweening ... Mikel Link to comment Share on other sites More sharing options...
delux Posted July 28, 2020 Author Share Posted July 28, 2020 11 minutes ago, mikel said: Hey @delux, Do you mean such a constellation? Happy tweening ... Mikel Thank you very much for responding This is roughly what I need, but how can I connect this to my script? For me, the elements react to the movement of the cursor ( Link to comment Share on other sites More sharing options...
delux Posted July 28, 2020 Author Share Posted July 28, 2020 Here, I got your solution to connect with mine - but it works extremely badly (.. buggy ( 22 minutes ago, mikel said: Hey @delux, Do you mean such a constellation? Happy tweening ... Mikel Link to comment Share on other sites More sharing options...
ZachSaucier Posted July 28, 2020 Share Posted July 28, 2020 Hey delux. The trick to having two animations affecting the same properties of the same element is to not affect the same element. Instead, create a container around the element and animate that with one animation and animate the element itself with the other animation. There are a lot of ways to set that up though. Here's one way: See the Pen qBbGprL?editors=0010 by GreenSock (@GreenSock) on CodePen Side note: Please use the "fork" button on CodePen when making changes to respond in the forum so that the old context is not lost and future readers can see the whole picture 3 Link to comment Share on other sites More sharing options...
mikel Posted July 28, 2020 Share Posted July 28, 2020 Hey ZACH, Cool concept! Happy creating ... Mikel Link to comment Share on other sites More sharing options...
delux Posted July 29, 2020 Author Share Posted July 29, 2020 Thank you very much - you helped a lot!! Link to comment Share on other sites More sharing options...
mikel Posted July 29, 2020 Share Posted July 29, 2020 Hey, Here I have 'dug up' another concept: See the Pen pogmXEz by mikeK (@mikeK) on CodePen Happy tweening ... Mikel 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now