Skip to content

aduh95/fireworks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Fireworks animation

This is a simple firework animation using HTML5 Canvas (and a bit of maths).

Demo

Usage

import fireworks from "https://aduh95.github.io/fireworks/src/fireworks.js";

const numberOfRocketToLaunch = 5;
const delayBetweenRocketInMilliseconds = 200;
const scale = 1; // Canvas of 1000x1000

const figure = document.createElement("figure");
const figcaption = document.createElement("figcaption");
figcaption.append("Canvas displaying a fireworks show.");
figure.append(
  fireworks(numberOfRocketToLaunch, delayBetweenRocketInMilliseconds, scale),
  figcaption
);

document.body.append(figure);

Note: the canvas gets deleted at the end of the animation.

You can also use the other exported functions of fireworks.js to customize the show.

Releases

No releases published

Packages

No packages published