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/inflate

Exports of @dioramajs/text/inflate.

View as Markdown
On this page
import { default, membrane, puff } from '@dioramajs/text/inflate'

Functions

membraneThe 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.
puffBuilds 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

defaultLetters 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

PuffThe puffed letters of a raster: the distance to their edge and how round each part is.

Types

PauseLets the page breathe between long steps of a build.