npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

particlesjs

v2.2.3

Published

A lightweight, dependency-free and responsive javascript plugin for particle backgrounds.

Downloads

4,528

Readme

particles.js

Github file size Travis David David npm CDNJS GitHub license

particles.js is a lightweight, dependency-free and responsive javascript plugin for particle backgrounds.

Installation

There are several ways to install particles.js:

  • Download the latest version
  • Install with npm: npm install particlesjs --save
  • Use the CDN: https://cdnjs.cloudflare.com/ajax/libs/particlesjs/2.2.3/particles.min.js

Usage

Include the minified JS in your HTML (right before the closing body tag).

<body>
  …
  <script src="path/to/particles.min.js"></script>
</body>

Add a canvas element to your markup (it should be the last element)

<body>
  …
  <canvas class="background"></canvas>
  <script src="path/to/particles.min.js"></script>
</body>

Add a few styles to your css.

html,
body {
  margin: 0;
  padding: 0;
}

.background {
  position: absolute;
  display: block;
  top: 0;
  left: 0;
  z-index: 0;
}

Initialize the plugin on the window.onload event.

window.onload = function() {
  Particles.init({
    selector: '.background'
  });
};

Options

Option | Type | Default | Description ------ | ------------- | ------------- | ----------- selector | string | - | Required: The CSS selector of your canvas element maxParticles | integer | 100 | Optional: Maximum amount of particles sizeVariations | integer | 3 | Optional: Amount of size variations speed | integer | 0.5 | Optional: Movement speed of the particles color | string or string[] | #000000 | Optional: Color(s) of the particles and connecting lines minDistance | integer | 120 | Optional: Distance in px for connecting lines connectParticles | boolean | false | Optional: true/false if connecting lines should be drawn or not responsive | array | null | Optional: Array of objects containing breakpoints and options

Example how to use the responsive option.

Methods

Method | Description ------ | ----------- pauseAnimation | Pauses/stops the particle animation resumeAnimation | Continues the particle animation destroy | Destroys the plugin

Example how to use the public methods.

Browser Support

IE9+ and all modern browsers.

Examples

See various examples how you can use particles.js.

Build

To compile the distribution files by yourself, make sure that you have node.js and gulp installed, then:

  • Clone the repository: https://github.com/marcbruederlin/particles.js.git
  • Change in the project directory: cd particles.js
  • Install the dependencies: npm install
  • Run the gulp build task gulp build to regenerate the dist folder. You can also run gulp build --watch to watch for file changes and automatically rebuild the files.

Using particles.js?

If you’re using particles.js in some interesting way or on a cool site, I’d be very grateful if you shoot me a link to it. For any problems or questions don't hesitate to open an issue.

License

particles.js is created by Marc Brüderlin and released under the MIT license.

Version 1.x

The source code for particles.js 1.x has been moved to the v1 branch.