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

Exports of @dioramajs/text/lens.

View as Markdown
On this page
import { default, grounds, magnification } from '@dioramajs/text/lens'

Functions

groundsThe page color under the element's text, and behind the element.
magnificationThe magnification at the lens's centre at `height` over the page.
opticsThe lens for a radius on screen, a magnification and a thickness: the height over the page that gives `zoom` at the centre, and the glass sized so its rim looks `radius` px from there.
rows
traceWhere a ray from a camera `distance` px above the page, aimed at page point `x0` from the lens axis, meets the page through the lens (2D, in the plane of the axis). NaN when the glass sends it elsewhere (the edge, or total internal reflection).

Constants

defaultA reading glass over the text: a thick biconvex lens in a thin metal ring follows the pointer, traced per pixel through both curved faces. The text under it comes up magnified in the middle, bends and splits into colors toward the rim; the glass reflects a studio, and on the page beside it lies its shadow with the light it focuses and the shadow of its handle. It leans into its motion and settles. The DOM text stays as it is around the lens.

Interfaces

OpticsThe glass: a biconvex lens of aperture `a` with both faces of sag `sag`, edge `edge` thick.