@dioramajs/text/tunnel
Exports of @dioramajs/text/tunnel.
On this page
import { default, FAR, gap } from '@dioramajs/text/tunnel'Functions
gap | Distance between two convex outlines on screen, px; negative when they overlap. |
guides | The guide lines as segments: from and to (x, y in units of the tunnel's half size or the helix radius, phrase step along the axis) and the line's opacity. Tunnel: the edges and two lines down each wall, and a frame every half step; spiral: two strands of the helix; zoom: none. |
onScreen | The corners of a placed phrase's ink on screen, box-centre px (y up), in order around it. |
pace | How fast `travel` moves at `pin`, phrases per unit of pin. |
place | Phrase `i` with the camera at `t`: in focus (t = i) it lies flat where the DOM has it; further back it moves onto the floor or ceiling of the tunnel or the helix, leaning towards the axis, and fades into the fog; nearer it grows, blurs and fades out before it reaches the eye. Given the phrase in focus (`focus`, the one at round(t)), a phrase behind that would cross it on screen fades out while that one holds. Undefined when unseen. |
travel | Where the camera is at `pin` (0..1), in phrases: 0 on the first, `count - 1` on the last. It slows down on each phrase, so each one holds still to be read, and speeds up between them. |
Constants
default | The phrases of a pinned section as cards in real depth: the scroll flies the camera forward through them. Each phrase comes out of the fog, holds in focus where the DOM has it, then grows, blurs and passes the viewer, along the walls of a tunnel, straight on, or around a helix. At the end of the section the last phrase settles as DOM text. |
FAR | Phrases further behind the one in focus than this many steps are not drawn. |