@dioramajs/model/device
Exports of @dioramajs/model/device.
On this page
import { build, coverOf, default } from '@dioramajs/model/device'Functions
build | The device of a frame around a screen for a box of `aspect` (width over height), the screen 1 unit tall. Proportions follow the real devices: screen aspect, bezels, depth and corner radius, `radius` times as round. |
coverOf | Crop of a picture of `media` aspect that covers a screen of `screen` aspect: scale and offset of the UV, centred across and from the top down, as a screenshot is read. |
fitOf | Px per unit that fits the device in the box in its rest pose, and the shift that centres it: the corners of its parts turned by pitch and yaw, each grown by the perspective of its depth seen from `distance` px. |
screenOf | The screen aspect (width over height) of a frame for a box of `aspect`: within the range of the real device, in the box's orientation for a phone or a tablet, always landscape for a laptop. |
Constants
default | A screenshot or a video in a 3D phone, tablet, laptop or browser window that leans toward the pointer. |