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

@omnedia/ngx-particles

v1.1.4

Published

A simple component library to create a container with an animated background.

Downloads

357

Readme

ngx-particles

@omnedia/ngx-particles is an Angular library that provides a dynamic and interactive particle animation effect. The particles react to mouse movements, creating a visually engaging and customizable background for your Angular components.

Features

  • Interactive particle animation that responds to mouse movements.
  • Customizable particle quantity, size, color, and motion dynamics.
  • Lightweight and easy to integrate as a standalone component.

Installation

Install the library using npm:

npm install @omnedia/ngx-particles

Usage

Import the NgxParticlesComponent in your Angular module or component:

import { NgxParticlesComponent } from '@omnedia/ngx-particles';

@Component({
  ...
  imports: [
    ...
    NgxParticlesComponent,
  ],
  ...
})

Use the component in your template:

<om-particles
  [quantity]="150"
  [size]="0.5"
  [circleColor]="'#ff69b4'"
  [staticity]="60"
  [ease]="40"
  [particleSpeed]="1"
  [vx]="0.1"
  [vy]="0.1"
  styleClass="custom-particles"
>
  <h1>Your content here</h1>
</om-particles>

API

<om-particles
  [quantity]="quantity"
  [size]="size"
  [circleColor]="circleColor"
  [staticity]="staticity"
  [ease]="ease"
  [particleSpeed]="particleSpeed"
  [vx]="vx"
  [vy]="vy"
  styleClass="your-custom-class"
>
  <ng-content></ng-content>
</om-particles>
  • quantity (optional): The number of particles. Defaults to 100.
  • size (optional): The size of the particles. Defaults to 0.4.
  • circleColor (optional): The color of the particles. Accepts any valid CSS color value (e.g., '#ff69b4', 'rgba(255, 105, 180, 0.8)'). Default is white
  • staticity (optional): Controls the responsiveness of the particles to the mouse. Higher values reduce particle movement. Defaults to 50.
  • ease (optional): Controls the smoothness of the particle movement. Lower values increase the speed of the transition. Defaults to 50.
  • particleSpeed (optional): Controls the speed of the particle movement. Higher values increase the speed of the particles. Defaults to 1.
  • vx (optional): Horizontal velocity of the particles. Defaults to 0.
  • vy (optional): Vertical velocity of the particles. Defaults to 0.
  • styleClass (optional): A custom CSS class to apply to the particle container.

Example

<om-particles
  [quantity]="200"
  [size]="0.6"
  [circleColor]="'#00ffcc'"
  [staticity]="70"
  [ease]="30"
  [particleSpeed]="2"
  [vx]="0.05"
  [vy]="0.05"
  styleClass="particles-background"
>
  <div class="content">Interactive Particle Background</div>
</om-particles>

This example creates a particle background with 200 particles, cyan-colored, and with custom motion dynamics. The particles will move more fluidly in response to mouse movements.

Styling

To further customize the appearance of the particles or the container, use the styleClass input to apply your own CSS classes.

.particles-background {
  background-color: #000;
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.content {
  position: relative;
  z-index: 1;
  color: white;
  text-align: center;
  padding-top: 50px;
}

This will create a fullscreen particle background with a centered text content overlay.

Contributing

Contributions are welcome. Please submit a pull request or open an issue to discuss your ideas.

License

This project is licensed under the MIT License.