Fire

Flames off a top edge with embers that are flung up, slow to a buoyant drift and cool from white to red; plasma hugging a border; or a little heat for a button.

Hot take
<Fx effect="fire" preset="Flames" />

Features

  • Domain-warped flames off a top edge, hottest at the base.
  • Embers flung up, slowed by drag into a buoyant drift, cooling white to red.
  • Plasma hugging a border, and a small heat preset for buttons.

Use it for

  • A hot take or trending item.
  • Error and 404 pages.
  • A dramatic deploy button.

On this site

Installation

  1. Get runets.
    git clone https://github.com/ziyam-khan/runets
  2. Copy these files into your project, keeping their folders.
  3. Install what they use.
    pnpm add react

Usage

import { Fx } from 'runets'

<div className="card"> {/* position: relative */}
  <Fx effect="fire" />
</div>

API

PropTypeWhat it does
effectstringThe effect’s id, as in the address of this page.
presetstringOne of the presets above; the first by default.
paramsParamsAny parameter from the table, over the preset.
place'under' | 'over'Under the parent’s content (fills, halos) or over it (sparkles, glass). Default under.
radiusnumberCorner radius in points; the parent’s own border radius by default.
backdropstring | PaintWhat glass and distortion read: an image URL, or a function that paints a canvas the size of the parent.
maskPaintAn alpha mask for mask glow and text sheen.
hotbooleanDrives heat: the layer lights in 60 ms and cools over half a second instead of cutting off.
triggernumberChange it to fire a one-shot now (ping, ripple, burst, shockwave, zap).
wakenumberChange it to redraw for a second when something the layer reads, such as its occluders, moves on its own.
shape(time, w, h) => RectThe effect’s shape inside the parent, per frame: a lens that drifts.

Parameters

NameRangeDefault
style Styletop, heat, border, emberstop
low Lowcolor0x8a1405
mid Midcolor0xff5a14
hot Hotcolor0xffc65a
height Height4 to 16054
scale Scale4 to 8020
speed Speed0 to 51.5
intensity Intensity0 to 31
embers Embers0 to 4016
emberRise Ember rise0 to 20058
emberSize Ember size0.2 to 30.8
emberLife Ember life0.2 to 41.5
warp Warp0 to 31
sides Sides0 to 10.32
baseGlow Base glow0 to 20.5
swirl Swirl0 to 30
occlusion Occlusion0 to 10.25

Accessibility

Source

The code is in src/fx/glsl/emit.ts in runets, MIT licensed.