VincentGarreau / particles.js

A lightweight JavaScript library for creating particles
https://vincentgarreau.com/particles.js/
MIT License
28.66k stars 4.81k forks source link

Particle data #484

Open anthonycmain opened 2 years ago

anthonycmain commented 2 years ago

Is there a way for me to use an array to inject data into the particles rather than random.

I want to essentially put a different icon in each and then have a hover event which will show the title.

matteobruni commented 2 years ago

You can see this sample here: https://codepen.io/matteobruni/pen/YzpOZpq

It uses tsParticles for creating particles manually

anthonycmain commented 2 years ago

Whats the difference between this and tsParticles? Im a bit confused

anthonycmain commented 2 years ago

Can I put in more than just the position, e.g. I want to ideally put in a stroked circle with a different icon in for each particle

matteobruni commented 2 years ago

Can I put in more than just the position, e.g. I want to ideally put in a stroked circle with a different icon in for each particle

Yes, you can see the properties here: https://particles.js.org/docs/classes/Options_Classes_ManualParticle.ManualParticle.html

You can specify position and options, the latest one contains the same object as the main particles object