smoke-effect

1.1.1 • Public • Published

Smoke Effect

Realistic smoke effect using html canvas.

Example

(Note that the used example is highly degraded when using GIF format. The real effect is nearly perfect.)

https://github.com/elisiondesign/smoke-effect/raw/master/example/Feb-26-2019%2009-52-17.gif

Usage

<canvas id="canvas"></canvas>
    var canvas = document.getElementById("canvas");
    var context = canvas.getContext("2d");
    canvas.width = 1500;
    canvas.height = 1000;
    var smoke = new Smoke(context, [80, 80, 80]); // context canvas, smoke color
    smoke.start();
    smoke.step(500);
    addSmoke(smoke);
  
  // Make run smoke run indefinitely
    function addSmoke() {
      smoke.addSmoke(400, 500, 2);
      smoke.addSmoke(600, 500, 3);
      setTimeout(() => {
        addSmoke();
      }, 1000);
    }

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.1
    6
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.1
    6
  • 1.1.0
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i smoke-effect

Weekly Downloads

8

Version

1.1.1

License

ISC

Unpacked Size

132 kB

Total Files

6

Last publish

Collaborators

  • xbilek18
  • xcharvat