wufe / react-particles-js

Particles.js for React
https://rpj.bembi.dev/
MIT License
1.16k stars 106 forks source link

Passing size range for particles shape to config #153

Closed mafiusu closed 4 years ago

mafiusu commented 4 years ago

Hello I want to display circle shapes with a size between 11 to 15px. Is it possible to do so? I've tried it with the image array to pass 5 different images but it display very small particles too and not only the size I've set.

matteobruni commented 4 years ago

Hi @mafiusu,

You can achive this setting size options like this:

size: {
      value: 15, /* max value */
      random: { enable: true, minimumValue: 11 /* min value */ }
}

You can see a working sample here: https://codepen.io/matteobruni/pen/YzyZzGZ

mafiusu commented 4 years ago

@matteobruni cool it worked! Thank you. Didn't know that you can also pass an object for this key random.