@openmockup-studio/player 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +47 -2
- package/dist/device-laptop-DlKLhrO9.js +900 -0
- package/dist/device-monitor-BkXp8a-n.js +366 -0
- package/dist/device-phone-DxWL5LkW.js +3227 -0
- package/dist/device-tablet-B1JOR7Rf.js +255 -0
- package/dist/device-watch-9Y7wuyPn.js +274 -0
- package/dist/embed.iife.js +4759 -0
- package/dist/embed.js +106 -0
- package/dist/rolldown-runtime-CGnMp29N.js +10 -0
- package/dist/runtime-RiyRiexX.js +1956 -0
- package/dist/three-o_76Nw0r.js +13763 -0
- package/package.json +70 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 openmockup contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,48 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @openmockup-studio/player
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`<mockup-embed>`: put an animated 3D device mockup made in openmockup Studio on any web page with one script tag.
|
|
4
|
+
|
|
5
|
+
```html
|
|
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
|
+
```
|
|
9
|
+
|
|
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
|
+
|
|
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
|
+
|
|
14
|
+
## Attributes
|
|
15
|
+
|
|
16
|
+
| Attribute | Values | |
|
|
17
|
+
| --- | --- | --- |
|
|
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`. |
|
|
21
|
+
| `trigger` | `load`, `in-view`, `click`, `hover`, `scroll`, `cursor-move`, `none` | When the animation plays. Defaults to the value saved in the project. |
|
|
22
|
+
| `trigger-loop` | `true`, `false`, `pingpong` | Loop mode. |
|
|
23
|
+
| `trigger-delay` | ms | Delay before playing. |
|
|
24
|
+
| `trigger-speed` | number | Playback speed, `1` = normal. |
|
|
25
|
+
| `aspect-ratio`, `width`, `height` | CSS values | Element size. |
|
|
26
|
+
| `poster` | URL | Image shown until the scene renders. |
|
|
27
|
+
| `loader` | `true`, `false` | Show a progress indicator while loading. |
|
|
28
|
+
| `cursor-enabled`, `cursor-amount`, `cursor-mode` | `false`; 0–100; `device`/`camera` | Cursor follow. |
|
|
29
|
+
| `zoom-amount`, `zoom-mode` | 0–100; `zoom`/`dolly` | Hover zoom. |
|
|
30
|
+
| `shake-intensity` | 0–100 | Idle hand-held shake. |
|
|
31
|
+
| `low-bandwidth` | `true`, `false` | Poster only. Defaults to on for Save-Data and 2G connections. |
|
|
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. |
|
|
35
|
+
|
|
36
|
+
Attributes win over the playback settings saved in the project.
|
|
37
|
+
|
|
38
|
+
## Without modules
|
|
39
|
+
|
|
40
|
+
`dist/embed.iife.js` is a single classic script for hosts that cannot load ES modules:
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<script src="https://cdn.jsdelivr.net/npm/@openmockup-studio/player@0.2.0/dist/embed.iife.js"></script>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
MIT. Source: [github.com/bitta-ux/openmockup](https://github.com/bitta-ux/openmockup).
|