tsparticles / tsparticles

tsParticles - Easily create highly customizable JavaScript particles effects, confetti explosions and fireworks animations and use them as animated backgrounds for your website. Ready to use components available for React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Solid, Riot and Web Components.
https://particles.js.org
MIT License
7.7k stars 847 forks source link

How to make particles interact with an external div? #4654

Closed Wollivan closed 2 years ago

Wollivan commented 2 years ago

Contact Details

@Wollivan on GitHub

What is your request?

An option to have the particles interact with another element in the same way they do the mouse.

For example, if the particles are set to move out of the way of the cursor, have them ALSO move out of the way of a div that is moving across the because of a css animation.

tsParticles Version

2.2.3

Which library are you using?

React.js (react-particles, react-tsparticles, react-particles-js)

Code of Conduct

matteobruni commented 2 years ago

It's something that already exists, you can see a sample here: https://codepen.io/matteobruni/pen/mdVdPKj

Wollivan commented 2 years ago

It's something that already exists, you can see a sample here: https://codepen.io/matteobruni/pen/mdVdPKj

Oh incredible thanks! I will have a go at implementing this at some point then!