Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
bubbles-rising
Advanced tools
The BubblesRising class is designed to create an animation of bubbles that rise and gradually disappear over time.
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.
1.6kB gzipped
➤ 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
Option | Type | Default | Description |
---|---|---|---|
el | string | HTMLElement | .bubbles | The container element for the animation. Can be a CSS selector (string) or an HTMLElement object. |
color | string | rgb(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
Method | Parameters | Returns | Description |
---|---|---|---|
init() | none | void | Initializes the canvas, sets up event listeners, and starts the animation loop. |
destroy() | none | void | Stops the animation, removes event listeners, clears the canvas, and releases resources. |
➤ License
bubbles-rising is released under MIT license
FAQs
The BubblesRising class is designed to create an animation of bubbles that rise and gradually disappear over time.
We found that bubbles-rising demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.