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

Exports of @dioramajs/text/melt.

View as Markdown
On this page
import { default, edges, linesOf } from '@dioramajs/text/melt'

Functions

edgesThe undersides of the glyphs that liquid can run off: per line and column the lowest edge of the ink, kept where it reaches down to the baseline or below (feet of stems, bottoms of bowls, descenders), in runs without jumps. `field` is the signed distance in texels (negative inside), `scale` texels per px over `frame`.
linesOfThe lines of a raster top down, each owning the box down to halfway to the next one.
placeUp to `count` drips spread along the edges, about evenly with a seeded jitter: the stream fits its edge, two never touch.

Constants

defaultLetters melt like hot wax, paint or liquid metal: the shape of the glyphs sags, rounds off and runs down in glossy drips that stretch, neck and let their drops fall, lit as a 3D liquid with sharp highlights, studio reflections and a soft shadow on the page. The text stays in the DOM.
MAX_DRIPSDrips the shader holds at most.

Interfaces

DripOne drip: where it hangs from and how it runs. Lengths in box px unless said otherwise.
EdgeA stretch of the underside of the letters near a baseline, where liquid runs off.
LineOne line of text: its baseline, font size, the band of the box it owns and its ends, box px.
LookHow a style melts and shines. Lengths in em of the font size.