Socket
Socket
Sign inDemoInstall

webgl-boom-js

Package Overview
Dependencies
4
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    webgl-boom-js

boomJS is a library for implementing the explosion effect of particle.


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

boomJS

boomJS is a library for implementing the explosion effect of particle.

boomJS can achieve particle explosion effects on any DOM node, and can achieve cool effects through simple APIs.

中文文档

Features

  • Based on webGL implementation, good performance, large-scale particle explosion effect can be achieved
  • Simple, just call boomJS function
  • Lightweight, only 14KB in size
  • Configurable, configurable particle number, explosion speed, explosion duration, etc.
  • Based on Promise, friendly interface

Configuration

Parameter nameTypeDefault valueDescription
mnumberwidthThe number of x-axis particles to split, one particle per pixel is split by default
nnumberheightThe number of y-axis particles to split, the default is to split one particle per pixel
speednumber0.1particle speed
durationnumber1000Particle effect duration, in milliseconds
declare function boomJS(node: Element, config?: IConfig): Promise<unknown>;
interface IConfig {
  m?: number; // The number of particles on the x axis of the explosion
  n?: number; // The number of particles on the y axis of the explosion
  speed?: number; // Explosion speed
  duration?: number; // Duration of explosion
}

Use

Used in the project

Command Line:

npm i webgl-boom-js

Code:

import boomJS from "webgl-boom-js";
document.body.addEventListener("click", (e) => {
  const ele = e.target;
  boomJS(ele).then(() => {});
});

Use in the page

Introduce:

<script src="./dist/boom.min.js" defer=""></script>

Code:

document.body.addEventListener("click", (e) => {
  const ele = e.target;
  boomJS(ele).then(() => {});
});

License

ISC

Keywords

FAQs

Last updated on 28 Jun 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc