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

Exports of @dioramajs/text/prism.

View as Markdown
On this page
import { default, lamp, rainbow } from '@dioramajs/text/prism'

Functions

lampThe light from the box center in px (y down) and its height: at `angle` (a CSS angle, 0 above, 90 right) about the size of the box away, drifting with the box's place in the viewport.
rainbowSaturated linear RGB hues from red to violet, `count` of them, for light split into bands.
reachThe pointer's offset from the box center, eased so a far pointer stays a light nearby.
spectrumLinear RGB weights of `count` wavelength samples from red to violet: each channel sums to 1, so the samples landing on one spot add up to white and pull apart into a rainbow.

Constants

defaultLetters become cut crystal standing off the page: clear bevelled glass with bright inner edges, that splits the light of a lamp into rainbows cast on the page behind and beside it. The lamp follows the pointer, sweeps with the scroll, orbits on a loop or passes once in view. The text stays in the DOM, hidden behind the copy.