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/media/reflection

Exports of @dioramajs/media/reflection.

View as Markdown
On this page
import { default, floorOf, lowest } from '@dioramajs/media/reflection'

Functions

floorOfWhere the row at `share` of a picture's height (from its top) lands in the box, as box UV with y up, under the element's object-fit and object-position. Clamped to the box.
lowestThe share of the picture's height, from its top, down to the bottom of its lowest row with something in it: 1 for a picture without transparency, or one that cannot be read.

Constants

defaultA soft reflection of a product photo on a glossy floor below it: the picture mirrored at its base (the lowest solid row of a cutout, or the bottom edge of a photo), fading and blurring with distance, with an optional contact shadow and ripple. It draws on the canvas below the box: the element stays DOM, the layout does not move and clicks pass through.