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

Exports of @dioramajs/text/emboss.

View as Markdown
On this page
import { backgroundOf, default, reachOf } from '@dioramajs/text/emboss'

Functions

backgroundOfThe material's base color: the element's own background color when it has one at least half opaque (the surface then covers the box), else undefined.
reachOfThe pointer's offset from the box center, eased so a far pointer stays a lamp nearby.
restThe light at rest, from the box center in px (y down) and its height: `angle` as a CSS angle (0 above, 90 right) at about the size of the box away and above it, moved up and down with the box's place in the viewport, as a lamp fixed in the room would be.

Constants

defaultLetters pressed into or raised out of a material: paper, leather, brushed metal, stone or plaster drawn over the element's box in its background color, with the relief built from the shape of the glyphs. A lamp follows the pointer and drifts with the scroll; the letters, their walls and the fine grain of the surface catch it and cast real shadows. The text stays in the DOM, hidden behind the copy.
SMALLLines set smaller than this, px, are printed in their color by emboss and deboss.