🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

bubbles-rising

Package Overview
Dependencies
Maintainers
0
Versions
7
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.

3.1.1
latest
Source
npm
Version published
Weekly downloads
7
16.67%
Maintainers
0
Weekly downloads
 
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

2kB gzipped

Demo


Install

$ yarn add bubbles-rising

Import

import BubblesRising from 'bubbles-rising';

Usage

const bubblesRising = new BubblesRising({
  el: '.bubbles',
  color: 'rgb(158, 128, 128)',
  sizes: [2, 24],
  shape: 'star',
  angle: true,
});

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][4, 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.
shape'circle' | 'square' | 'triangle' | 'star''circle'The shape of the particles. Options are 'circle', 'square', 'triangle', or 'star'.
anglebooleanfalseEnables or disables rotation angles for the particles.

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

bubbles

FAQs

Package last updated on 10 Mar 2025

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