@openmockup-studio/player 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -5
- package/dist/{device-laptop-abUqnCPB.js → device-laptop-DlKLhrO9.js} +1 -1
- package/dist/{device-monitor-DRfsMb1A.js → device-monitor-BkXp8a-n.js} +1 -1
- package/dist/{device-phone-D__ngcPt.js → device-phone-DxWL5LkW.js} +337 -328
- package/dist/{device-tablet-C89f1GUw.js → device-tablet-B1JOR7Rf.js} +1 -1
- package/dist/{device-watch-PwEcwA3q.js → device-watch-9Y7wuyPn.js} +1 -1
- package/dist/embed.iife.js +56 -56
- package/dist/embed.js +7 -4
- package/dist/{runtime-D-Di0bkW.js → runtime-RiyRiexX.js} +224 -215
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
`<mockup-embed>`: put an animated 3D device mockup made in openmockup Studio on any web page with one script tag.
|
|
4
4
|
|
|
5
5
|
```html
|
|
6
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@openmockup-studio/player@0.
|
|
7
|
-
<mockup-embed
|
|
6
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@openmockup-studio/player@0.2.0/dist/embed.js"></script>
|
|
7
|
+
<mockup-embed mockup-id="…" trigger="in-view" aspect-ratio="16 / 9"></mockup-embed>
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
**Publish** in the Studio's Embed dialog uploads the scene and gives you its `mockup-id`; that is all the snippet needs. To host a scene yourself instead, use **Download files (.zip)** and point `src` at its `project.json` (any static host works). The zip also contains a copy of the player, so it runs without the CDN too.
|
|
11
11
|
|
|
12
12
|
The loader (`embed.js`, a few kB) shows the poster at once and fetches the renderer only when the element is about to be seen. Three.js and each device model load as separate chunks, on demand.
|
|
13
13
|
|
|
@@ -15,7 +15,9 @@ The loader (`embed.js`, a few kB) shows the poster at once and fetches the rende
|
|
|
15
15
|
|
|
16
16
|
| Attribute | Values | |
|
|
17
17
|
| --- | --- | --- |
|
|
18
|
-
| `
|
|
18
|
+
| `mockup-id` | id | A scene published from the Studio. |
|
|
19
|
+
| `base` | URL | Where `mockup-id` scenes live, if not the Studio's own store. |
|
|
20
|
+
| `src` | URL | A project JSON you host yourself; wins over `mockup-id`. |
|
|
19
21
|
| `trigger` | `load`, `in-view`, `click`, `hover`, `scroll`, `cursor-move`, `none` | When the animation plays. Defaults to the value saved in the project. |
|
|
20
22
|
| `trigger-loop` | `true`, `false`, `pingpong` | Loop mode. |
|
|
21
23
|
| `trigger-delay` | ms | Delay before playing. |
|
|
@@ -28,6 +30,8 @@ The loader (`embed.js`, a few kB) shows the poster at once and fetches the rende
|
|
|
28
30
|
| `shake-intensity` | 0–100 | Idle hand-held shake. |
|
|
29
31
|
| `low-bandwidth` | `true`, `false` | Poster only. Defaults to on for Save-Data and 2G connections. |
|
|
30
32
|
| `theme` | `light`, `dark` | Loader colours. |
|
|
33
|
+
| `camera-zoom` | number, `100` = twice as close, `-100` = twice as far | Move the camera in or out from the saved framing. Default `0`. |
|
|
34
|
+
| `background-color` | `transparent` or a CSS colour (hex, `rgb()`, `hsl()`, named) | Replace the saved backdrop with a flat colour. Also the loader background. |
|
|
31
35
|
|
|
32
36
|
Attributes win over the playback settings saved in the project.
|
|
33
37
|
|
|
@@ -36,7 +40,7 @@ Attributes win over the playback settings saved in the project.
|
|
|
36
40
|
`dist/embed.iife.js` is a single classic script for hosts that cannot load ES modules:
|
|
37
41
|
|
|
38
42
|
```html
|
|
39
|
-
<script src="https://cdn.jsdelivr.net/npm/@openmockup-studio/player@0.
|
|
43
|
+
<script src="https://cdn.jsdelivr.net/npm/@openmockup-studio/player@0.2.0/dist/embed.iife.js"></script>
|
|
40
44
|
```
|
|
41
45
|
|
|
42
46
|
## License
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
2
|
import { A as t, H as n, I as r, M as i, P as a, R as o, U as s, Y as c, f as l, h as u, i as d, k as f, r as p, s as m, u as h, v as g, x as _ } from "./three-o_76Nw0r.js";
|
|
3
|
-
import {
|
|
3
|
+
import { D as v, E as y, a as b, d as x, f as S, i as C, m as w, n as T, o as E, p as D, r as O, s as k, u as A } from "./device-phone-DxWL5LkW.js";
|
|
4
4
|
// ../devices/src/laptop/keyboard.ts
|
|
5
5
|
var j = 1.646, M = 1.596, N = 1.846, P = 27.23, F = {
|
|
6
6
|
width: P,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
2
2
|
import { A as t, H as n, I as r, L as i, M as a, P as o, W as s, Y as c, f as l, h as u, k as d, p as f, s as p, u as m, v as h, x as g } from "./three-o_76Nw0r.js";
|
|
3
|
-
import {
|
|
3
|
+
import { D as _, E as v, a as y, d as b, f as x, i as S, l as C, m as w, n as T, o as E, p as D, r as O, s as k } from "./device-phone-DxWL5LkW.js";
|
|
4
4
|
// ../devices/src/monitor/build.ts
|
|
5
5
|
var A = Math.PI / 180;
|
|
6
6
|
function j() {
|