@dioramajs/text/neon
Exports of @dioramajs/text/neon.
On this page
import { brokenUnits, build, default } from '@dioramajs/text/neon'Functions
brokenUnits | Units that keep flickering: `share` of `count`, at least one, picked by the seed. |
build | Builds the sign from a raster of the text: a distance field of the glyphs with its direction (the tubes' normals come from it), the shape of each piece's tube and its light blurred at three radii into an atlas cell of its own, so every letter lights up alone. Yields to the browser between steps. |
ignite | Brightness 0..1 of a tube `t` seconds after its turn to light, and whether it is steady: it stutters on with a few flashes, holds, and warms up to full. `fast` is the short version of a sign switched on by hand. |
outlineRadius | Radius of the outline tube at font size `em`, px. |
wallTone | Lightness 0..1 of the wall behind the element: the first background color at least half opaque on it or an ancestor, white (the page's default) without one. |
Constants
default | A heading becomes a neon sign mounted in front of the wall: round glass tubes in the shape of its letters, lit from inside with a highlight along each, a soft colored light thrown on the wall around them, and their shadow on it. The tubes stutter on one by one as the sign comes into view and buzz now and then; the light that casts the shadow follows the scroll and the pointer, and the sign turns a little toward the pointer. The text stays in the DOM. |
Interfaces
Sign | The letters of the sign drawn once: distance field, light atlas and one instance per piece. |