3.1.1 • Published 4 months ago

bubbles-rising v3.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

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