@dioramajs/text/inflate
Exports of @dioramajs/text/inflate.
On this page
import { default, membrane, puff } from '@dioramajs/text/inflate'Functions
membrane | The radius of the round profile over a signed distance field `dist` (CSS px, positive inside, `cols` by `rows` cells of `cell` px), written d below. The letters are inflated like a membrane under pressure: `u` solves Poisson's equation, zero on the glyph edge, coarse to fine. Where a stroke of half-width a is straight, u = d (2a - d) / 2, so the radius u / d + d / 2 is a, and the height sqrt(d (2a - d)) is a round tube; a dot becomes a dome and a joint bulges. Cells outside get the radius of the edge next to them. |
puff | Builds the puffed letters of a raster: a distance field over the raster's frame and a margin for the shadow, the round profile's radius from an inflated membrane, and the nearest letter. |
Constants
default | Letters puff up into soft, round 3D shapes, like balloons or clay, lit by a studio light with a glossy highlight and a soft shadow on the page. They inflate one after another when they come into view, dent where the pointer presses, spring back with a wobble and lean toward it. |
Interfaces
Puff | The puffed letters of a raster: the distance to their edge and how round each part is. |
Types
Pause | Lets the page breathe between long steps of a build. |