Mockups
Glass Phone Duo
A folding phone rendered in WebGL2, with your screens on the cover and inside.
Preview
Closed Open
Installation
Install the package once, then import the parts you use into a standalone component.
Install
npm install ngx-vitreo @angular/cdk @floating-ui/domImport
import { GlassPhoneDuo } from 'ngx-vitreo';
@Component({
imports: [GlassPhoneDuo],
// ...
})Usage
Usage
<figure
glassPhoneDuo
screenSrc="/app-landscape.png"
screenAlt="The app on the unfolded display"
coverSrc="/app-portrait.png"
coverAlt="The app on the cover display"
finish="star-white"
pose="laptop"
[angle]="90"
></figure>API reference
GlassPhoneDuo
figure[glassPhoneDuo]
| Input | Type | Default | Description |
|---|---|---|---|
screenSrc | string | None | Landscape screenshot for the inner display, at a 2670:1878 ratio. Same origin or served with CORS. Required. |
coverSrc | string | None | Portrait screenshot for the outer display, at a 1398:2034 ratio. Same origin or served with CORS. Required. |
screenAlt | string | 'App on the unfolded phone display' | Accessible label while the front of the open phone shows. |
coverAlt | string | 'App on the outer phone display' | Accessible label while the closed phone shows, or the back of the open phone. |
open | boolean | true | Opens or closes the hinge. Ignored when angle is set. |
angle | number | None | Hinge angle from 0 (closed) to 180 (flat), clamped. Overrides open; while it is set, view and pose changes apply at once. |
finish | 'night-sky' | 'star-white' | 'night-sky' | Frame colour. |
view | 'front' | 'back' | 'front' | Which side of the phone faces you. |
pose | 'upright' | 'book' | 'tent' | 'laptop' | 'side' | 'upright' | Device orientation. Use angle to set the opening for book, tent or laptop. |
glare | boolean | true | Reflections on the glass. Off under reduced transparency. |