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/text-glitch

Exports of @dioramajs/text/text-glitch.

View as Markdown
On this page
import { chance, default, flashes } from '@dioramajs/text/text-glitch'

Functions

chanceA uniform random number in [0, 1) for the seed and two counters: the same on every load.
flashesKeeps the text from flashing: the returned function passes the opacity of each drawn frame at `now` seconds and holds it at 1 for a dip that would be the fourth to start within a second.
flickerOpacity of the whole text at step `n` of a burst of `steps`: it dims while the signal drops out between the hits, and late in the second hit it may flicker once.
gapSteps of a burst where the signal drops out between its two hits; none in a short burst.
patternCuts the text into horizontal slabs for one step of the pattern and writes their layers back to front: the hologram, the red and cyan layers, the sides of an extruded block, then the text itself on top. Slabs left in place merge, and at level 0 it is the flat text in one layer.
slabs
strikeStrength of step `n` of burst `burst` that lasts `steps`, 0..1. It hits twice: each hit starts in full, then stutters (some steps drop out) and fades; between them the signal drops out.

Constants

defaultA heading glitches like a broken signal, in depth: for a fraction of a second it breaks into slabs that jump towards the viewer and turn in perspective, its red and cyan layers part at different depths, blocks extrude out of the page or a hologram trails behind it. Then it snaps back flat. At rest the element is plain DOM text.
LOOKS

Interfaces

LookHow a style breaks the text. Distances are in em, so a heading and a label break alike.
SlabsInstance attributes, one row per layer of a slab, in draw order.
StepWhat one step of the pattern needs to know.