ignis

Fire, drawn as dots.

Flames that rise, cool and fade, embers that break loose and ride the wind, smoke that carries on up after the light has gone. A campfire, a candle, a torch, a match and a forge, bushfire fronts right across the canvas, fireworks, and lava. No dependencies, one script.

Flags

The same fire four ways. They stack.

Use it

One script, then a canvas. Height is the size; a wider canvas gives a front more ground to burn.

<script src="https://cdn.jsdelivr.net/gh/TonkaTuff/ignis@v0.2.0/dist/ignis.min.js"></script>
<canvas class="fire" width="300" height="200" data-fire-body="campfire"></canvas>
attributevaluewhat it does
data-fire-bodynameany name above
data-fire-formfire · candle · torch · match · forge · frontthe shape of a fire: a campfire, a teardrop on a wick, a flame on a stick, a match, a forge, a line across the canvas. Fireworks take shell · willow · wheel; lava takes lake · flow · fountain
data-fire-heightnumberflame height as a fraction of the canvas height (0.5 for a campfire, 0.42 for a front)
data-fire-widthnumberhalf the fire's foot as a fraction of the height; a front always spans the canvas (0.15)
data-fire-windnumberhow far the flames, embers and smoke lean; positive is to the right (0.1, 0.5 for a front)
data-fire-embers / -smoke / -flamesnumberhow many of each, as a fraction of the flame dots (0.12 / 0.35 / 1)
data-fire-nnumberflame dots at a 64px height, scaled up with size (700)
data-fire-temponumberhow fast it all happens (1)
data-fire-logs0a campfire without the logs
data-fire-slots / -period / -reachnumberfireworks: shells in the air at once (4), seconds between them (3.4), burst size as a fraction of the height (0.26)
data-fire-seams / -heat / -speednumberlava: how many seams (1), how open they are (1), how fast a flow runs (0.06)
data-fire-ink / -lite / -ground1monochrome dots that follow the page theme · half the dots · a night behind, lit by the fire
data-fire-glow0no soft glow, just the dots on a clear canvas