Skip to content
This repository was archived by the owner on Jun 18, 2020. It is now read-only.
/ particles Public archive

A JavaScript library to create simple particle systems.

Notifications You must be signed in to change notification settings

nicovank/particles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Particles

This lightweight library will allow you to make a very basic moving particule system.

For a more advanced system, I recommend particles.js.

Demo

You can find a live demo here on CodePen.

Installation

Download the compressed version of Particles. Then, add it to your page like so:

<!-- Create a canvas on which the particules will be drawn -->
<canvas id="particles"></canvas>

<!-- Import the script. (use your installation path) -->
<script src="particles.js"></script>

You can then start an instance of Particles like so:

const particles = new Particles(document.getElementById("particles"), options);

Options

Here are the default options. You can override any of them by passing an option object when creating a Particles instance.

{
    size: { // size of the particles
        min: 0,
        max: 2
    },
    density: 1000,  // density of particles on the canvas
    speed: 3, // speed of the particules
    fps: 60, // number of times per second the canvas is refreshed
    color: "#FFFFFF" // color of the particles
}

About

A JavaScript library to create simple particle systems.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published