@dioramajs/text/fire
Exports of @dioramajs/text/fire.
import { default, flare, FPS } from '@dioramajs/text/fire'Functions
flare | Heat of a unit `t` seconds after it catches with the view trigger, and whether it has settled: flame flares up, burns and dies down; a candle lights, burns and goes out; coals flare and settle at a steady glow. |
scrolled | Heat of the scroll trigger: none while the box's middle is low in the viewport, full above 40%. |
swell | The slow swell of the whole fire at time `t`, about ±0.2: incommensurate sines. |
toward | Moves `value` toward `goal` with time constant `tau` s plus a slow steady pace, so it gets there in finite time. |
wallOf | Lightness 0..1 of what the page paints behind the element; a picture counts as darkish. |
weights | Emission weights from a CSS color, the brightest channel 1; natural fire without one. |
Constants
default | The letters burn: flames driven by the distance field of the glyphs rise from their tops, hot white-yellow at the strokes, orange and red higher up, broken into tongues by noise carried up through them; sparks drift up in front of and behind the text in depth; the fire lights the page around the text and the tops of the strokes, and can char the letters where it burned. The text stays in the DOM. |
FPS | Frames a second while the fire burns. |
MAX_EMBERS | Most sparks in the air at the high tier. |
TALL | Flame height of a style as a share of `height`. |