@dioramajs/text/voxel
Exports of @dioramajs/text/voxel.
On this page
import { default, FLAT, HOLD } from '@dioramajs/text/voxel'Functions
span | Seconds from the trigger until the last cube has landed, and with `handoff` until the text shows. |
voxels | Cubes where the ink covers enough of a grid cell, coloured by the ink under them. The grid widens until they fit `max`. With `bricks`, neighbours in a row pair up into bricks, the pairs shifted by a cell on every other row like a wall. Each cube gets its place in the build wave: left to right, lower rows a little earlier, each line a little after the one above. |
Constants
default | The heading built from small lit 3D cubes, one instanced draw of boxes coloured by the text under each grid cell. On view they tumble in from above and behind the page in a wave, land with a hop and a squash, and flatten into the real text; the pixels style keeps them. Cubes under the pointer pop out toward the viewer on springs. Once on view, scrubbed by scroll, or as voxels for the pointer only. |
FLAT | Seconds the cubes take to flatten and cross-fade into the text. |
HOLD | Seconds the built heading holds before it flattens into the text. |
JITTER | Share of `duration` a cube may start late, at random. |
MAX_CUBES | Most cubes at the high tier; past it the grid widens. |
Interfaces
VoxelOptions | |
Voxels | Cubes on a grid over the glyphs of a raster. |