@dioramajs/text/unfold
Exports of @dioramajs/text/unfold.
On this page
import { cut, default, eyeOf } from '@dioramajs/text/unfold'Functions
cut | Cuts the text block for a style. `bands` 'auto' picks the cut from the text: a band per line for strips and origami (three for a single line of strips), about an em per pleat for accordion. `flaps` hangs every strip from the page instead of from the strip above, for hover. |
eyeOf | Distance of the eye from the paper, px: a perspective like CSS `perspective` on the box. |
foldsAt | The fold of every unit at `time` s after the trigger, radians: `angle` before, 0 once open. |
gapOf | Seconds between neighbouring units: `stagger`, shrunk so all units start within `spread` durations. |
paint | The order to paint the cuts in, back to front, for an eye at `eye` (element frame). A cut's children fold to its front: they go after it when the eye is on that side, before it otherwise. Siblings go by their height over the parent's plane, then the farthest from the eye first. |
place | Every cut of the sheet in 3D for the folds of its units (radians, 0 flat). A cut turns on its hinge towards its parent's front, carrying the cuts that hang from it. |
spanOf | Seconds from the trigger until the last unit lies flat. |
spreadOf | Units start within this many durations at most; the pleats of an accordion nearly together. |
Constants
default | The headline unfolds out of the page like paper: cut into strips, a zig-zag band, a card per letter or folded squares, hinged together and opened one after another in perspective, with paper backs, crease shading and soft shadows on the page. Once flat it is DOM text again. |