Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bubbles-rising

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bubbles-rising

The BubblesRising class is designed to create an animation of bubbles that rise and gradually disappear over time.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bubbles-rising

The BubblesRising class is designed to create an animation of bubbles that rise and gradually disappear over time. It dynamically generates particles, controls their movement and opacity, and adjusts the canvas size when the container is resized. The class ensures smooth animation updates using requestAnimationFrame. It supports customization options such as bubble color and size range and includes methods for initialization, updating, rendering, and resource cleanup.

npm GitHub package version NPM Downloads

1.6kB gzipped

Demo


Install

$ yarn add bubbles-rising

Import

import BubblesRising from 'bubbles-rising';

Usage

const bubblesRising = new BubblesRising({
  el: '.bubbles',
  color: 'rgb(128, 128, 128)',
  sizes: [2, 18],
});

bubblesRising.init();

Options

OptionTypeDefaultDescription
elstring | HTMLElement.bubblesThe container element for the animation. Can be a CSS selector (string) or an HTMLElement object.
colorstringrgb(120, 200, 150)The color of the particles in the animation.
sizes[number, number][3, 12]The range of particle sizes, defined as an array where the first value is the minimum size and the second is the maximum size.

Methods

MethodParametersReturnsDescription
init()nonevoidInitializes the canvas, sets up event listeners, and starts the animation loop.
destroy()nonevoidStops the animation, removes event listeners, clears the canvas, and releases resources.

License

bubbles-rising is released under MIT license

Keywords

FAQs

Package last updated on 04 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc