@dioramajs/text/text-glitch
Exports of @dioramajs/text/text-glitch.
On this page
import { chance, default, flashes } from '@dioramajs/text/text-glitch'Functions
chance | A uniform random number in [0, 1) for the seed and two counters: the same on every load. |
flashes | Keeps 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. |
flicker | Opacity 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. |
gap | Steps of a burst where the signal drops out between its two hits; none in a short burst. |
pattern | Cuts 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 | |
strike | Strength 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
default | A 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 |