Particles system, written in pure JS

Particles.js is a API for developing graphical representations and animations of mathematical functions.

You can use it to drawings or animations.



How to use it:


var mySystem = Particles({
      number:160,
      canvas:document.getElementById('democanvas'),
      randomize:true,
      lines:true,
      particles:true,
      particleColor:'rgba(71, 188, 255, 0.7)',
      lineColor:'rgba(255, 255, 255, 0.3)'
});


Available options

number - number of the particles

canvas - canvas element on which the graphic will be drawn

randomize - automaticaly start the animations using the available graphics

lines - show or hide the lines

lineColor - color of the lines

particles - show or hide the particles

particleColor - color of the particles



Adding/removing new animation methods

Particles.module.cases is an array with all the animations(eg: circles, spirals...)



Here is how to add new animation method

The added function will be xecuted for each particle.


   Particles.module.cases.push(function(i, Particles.module){
       return {
           x:Math.round(Math.random()*100),
           y:Math.round(Math.random()*100),
           speed:50
       }
   });

DOWNLOAD