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

live-particles

v1.1.14

Published

live-particles is a package for rendering lively and realistic particles in the browser. With simple configuration file adjustments, you can create effects such as rain, snow, sandstorms, blizzards, smoke, or water bubbles. Let your creativity flow with d

Downloads

56

Readme

live-particles

live-larticles is a lightweight JavaScript library for rendering lively and realistic particles in the browser. With just a few simple adjustments to the configuration file, you can create dynamic effects such as rain, snow, sandstorms, blizzards, smoke, or water bubbles.

experimantal

added experimental feature: you can add svg props with url for your svg. testing now

Installation

You can install live-particles via npm:

npm install live-particles

Usage

To use live-particles, follow these steps:

Import the library into your App file, it is best to be used as one of the first components on your web-application:

import { LiveParticles } from 'live-particles';

<App>
  <LiveParticles config={'bubbles'} size={[1,5]} colors={['#000', '#12c3a0']} />
  ... your code
</App>

This will set bubbles config but custom sizes from 1px to 5px and custom colors

You can also customize canvas element with CSS styles simply using style props. This will place canvas on top 50% of screen and behind any other elements:

<LiveParticles style={{zIndex:'-1', height:'50%'}} />

By default canvas has three css properties:

canvas {
  position: fixed;
  top: 0;
  left: 0;
}

Enjoy the dynamic and customizable particle animations in your web application!

Configuration Options

  • style: any CSS style. Will apply to canvas element.
  • config: preinstalled configs. There is 'snow', 'sandstorm', 'bubbles', 'space' for now.
  • colors: Array of colors for the particles.
  • sizeRange: Boolean indicating whether the particle size is a range(true) or an array(false).
  • size: Array defining the size range of particles or array of different sizes if sizeRange is false.
  • particlesCount: Density of particles (number of particles per 100,000 pixels).
  • deltaX: Speed of particles along the X-axis (positive values - move from left to right, negative values - vice-versa).
  • deltaY: Speed of particles along the Y-axis (positive values - move from top to bottom, negative values - vice-versa).
  • deltaXrandomness: Randomness factor for the X-axis speed. If 0 - then only parallax depending on particles size. Bigger value - more chaotic movement
  • deltaYrandomness: Randomness factor for the Y-axis speed. If 0 - then only parallax depending on particles size. Bigger value - more chaotic movement
  • parallaxDepth: Depth of parallax effect. If 0 - then only parallax depending on particles size. Bigger value - begger difference between first-plane particles and back-plane particles
  • roundness: Roundness factor for particle shapes. If 1 - particle is a circle

Example

You can use from none to all of them whith you values (but be careful with big numbers, it can heavily loaded your system)

<LiveParticles
  style={{height:'50%', width:'10%'}}
  config={'bubbles'}
  colors={['#fff', '#ccc', '#aaa']}
  sizeRange={true}
  size={[0.2, 4]} 
  particlesCount={30}
  deltaX={1} 
  deltaY={1} 
  deltaXrandomness={1}
  deltaYrandomness={1} 
  parallaxDepth={1}
  roundness={1}
/>

this is configs for preinstalled particles

(you can use it simply by giving config props with selected type)

snow

  colors: ['#fff', '#ccc', '#aaa'],
  sizeRange: true, 
  size: [0.2, 4], 
  particlesCount: 30, 
  deltaX: 1, 
  deltaY: 1, 
  deltaXrandomness: 1, 
  deltaYrandomness: 1, 
  parallaxDepth: 1,
  roundness: 1,

sandstorm

  colors: ['#ffd43b', '#f08c00', '#fd7e14', '#e8590c'],
  sizeRange: true,
  size: [0.2, 1], 
  particlesCount: 100,
  deltaX: 20, 
  deltaY: 1, 
  deltaXrandomness: 2,
  deltaYrandomness: 1, 
  parallaxDepth: 2, 
  roundness: .5,

bubbles

  colors: ['#3b89d1', '#6057e7', '#172ead', '#1a84b6'],
  sizeRange: true,
  size: [1, 5], 
  particlesCount: 50,
  deltaX: .5, 
  deltaY: -1, 
  deltaXrandomness: -1,
  deltaYrandomness: 1, 
  parallaxDepth: .5, 
  roundness: 1,

space

  colors: ['#fff'],
  sizeRange: true,
  size: [.1, 1], 
  particlesCount: 70,
  deltaX: -.01, 
  deltaY: 0, 
  deltaXrandomness: 0,
  deltaYrandomness: 0, 
  parallaxDepth: 100, 
  roundness: 1,

feel free for experimentig, i'll gladly check any suggestions for improvment

License

This project is licensed under the MIT License - see the LICENSE file for details.

This README includes a description of the package, installation instructions, usage guidelines, configuration options, an example, and licensing information. Feel free to adjust it further to suit your needs!