Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

@dioramajs/text/fire

Exports of @dioramajs/text/fire.

View as Markdown
On this page
import { default, flare, FPS } from '@dioramajs/text/fire'

Functions

flareHeat 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.
scrolledHeat of the scroll trigger: none while the box's middle is low in the viewport, full above 40%.
swellThe slow swell of the whole fire at time `t`, about ±0.2: incommensurate sines.
towardMoves `value` toward `goal` with time constant `tau` s plus a slow steady pace, so it gets there in finite time.
wallOfLightness 0..1 of what the page paints behind the element; a picture counts as darkish.
weightsEmission weights from a CSS color, the brightest channel 1; natural fire without one.

Constants

defaultThe 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.
FPSFrames a second while the fire burns.
MAX_EMBERSMost sparks in the air at the high tier.
TALLFlame height of a style as a share of `height`.