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-background-beams

v1.0.2

Published

`@omnedia/ngx-background-beams` is an Angular component that generates dynamic animated background beams with customizable gradients and motion paths. It creates visually captivating backgrounds, ideal for enhancing the aesthetics of your application with

Downloads

19

Readme

ngx-background-beams

@omnedia/ngx-background-beams is an Angular component that generates dynamic animated background beams with customizable gradients and motion paths. It creates visually captivating backgrounds, ideal for enhancing the aesthetics of your application with smooth, animated beams.

Features

  • Dynamic Paths: Generates smooth, animated SVG path beams that are customizable in quantity and motion.
  • Customizable Gradients: Define up to 3 gradient colors to create unique color transitions for the beams.
  • Responsive & Interactive: Animations are tied to the viewport using an intersection observer, so they trigger only when visible.

Installation

Install the library using npm:

npm install @omnedia/ngx-background-beams

Usage

Import the NgxBackgroundBeamsComponent in your Angular module or component:

import {NgxBackgroundBeamsComponent} from '@omnedia/ngx-background-beams';

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

Use the component in your template:


<om-background-beams
  [gradientColorValues]="['#18CCFC', '#6344F5', '#AE48FF']"
  pathColor="rgba(255, 255, 255, 0.1)"
  [pathQuantity]="30"
>
  <div class="your-content">

  </div>
</om-background-beams>

This creates a dynamic background with animated beams using the specified gradient colors and path count. Example with Content


<om-background-beams
  [gradientColorValues]="['#18CCFC', '#6344F5', '#AE48FF']"
  pathColor="rgba(255, 255, 255, 0.08)"
  [pathQuantity]="50"
>
  <div class="content">
    <h1>Welcome to the Dynamic World of Beams!</h1>
    <p>Beautiful background animations for your Angular apps.</p>
  </div>
</om-background-beams>

How It Works

  • Path Generation: The component calculates multiple dynamic SVG paths, animating them over time. Each path has randomized motion, start and end points, giving a lively, fluid feel to the background.
  • Viewport Awareness: With an intersection observer, animations start when the component enters the viewport, ensuring performance is optimized.
  • Gradient Motion: The beams use a linear gradient that dynamically shifts over time, providing a mesmerizing, continuous motion effect.

API


<om-background-beams
  [gradientColorValues]="['#18CCFC', '#6344F5', '#AE48FF']"
  [pathColor]="'rgba(255, 255, 255, 0.08)'"
  [pathQuantity]="50"
>
  <ng-content></ng-content>
</om-background-beams>
  • gradientColorValues (optional): Array of exactly 3 colors for the gradient. Must provide exactly 3 colors. Defaults to ['#18CCFC', '#6344F5', '#AE48FF'].
  • pathColor (optional): Defines the color of the path lines. Defaults to rgba(255, 255, 255, 0.08).
  • pathQuantity (optional): Number of animated paths to generate. Defaults to 50.

Example


<om-background-beams
  [gradientColorValues]="['#FF5733', '#C70039', '#900C3F']"
  pathColor="rgba(255, 255, 255, 0.1)"
  [pathQuantity]="30"
>
  <div class="example-content">
    <h1>Stunning Visual Effects</h1>
  </div>
</om-background-beams>

This example draws 30 animated beams with a red-to-purple gradient, creating an eye-catching background for your content.

Performance Considerations

  • Path Quantity: Higher numbers of paths can add complexity and visual density, but may affect performance on low-end devices or with large screen resolutions.
  • Viewport Optimization: The component uses an intersection observer to ensure animations are only running when the component is visible on the screen, which helps save resources.

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.