@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.
@@ -0,0 +1,255 @@
1
+ import { t as e } from "./rolldown-runtime-CGnMp29N.js";
2
+ import { f as t, h as n, r, s as i, v as a, x as o } from "./three-o_76Nw0r.js";
3
+ import { D as s, E as c, a as l, c as u, d, f, i as p, l as m, m as h, n as g, o as _, p as v, s as y } from "./device-phone-DxWL5LkW.js";
4
+ // ../devices/src/tablet/spec.ts
5
+ var b = {
6
+ camera: {
7
+ size: 2.56,
8
+ radius: .68,
9
+ fromSide: .59,
10
+ fromTop: .5,
11
+ raise: .139,
12
+ glassInset: .126
13
+ },
14
+ lens: {
15
+ x: .56,
16
+ y: .5,
17
+ ring: .45,
18
+ glass: .39,
19
+ raise: .04
20
+ },
21
+ lidar: {
22
+ x: -.555,
23
+ y: -.025,
24
+ radius: .394
25
+ },
26
+ flash: {
27
+ x: -.556,
28
+ y: .82,
29
+ radius: .155
30
+ },
31
+ sensor: {
32
+ x: .56,
33
+ y: -.59,
34
+ radius: .09
35
+ },
36
+ mic: {
37
+ x: -.556,
38
+ y: -.806,
39
+ radius: .09
40
+ },
41
+ topButton: {
42
+ length: 1.16,
43
+ height: .28,
44
+ proud: .065,
45
+ fromSide: 1.95
46
+ },
47
+ volume: {
48
+ length: 1.01,
49
+ gap: .13,
50
+ height: .224,
51
+ proud: .09,
52
+ fromTop: 2.1
53
+ },
54
+ speaker: {
55
+ holes: 17,
56
+ hole: .194,
57
+ pitch: .2235,
58
+ fromSide: 2.8
59
+ },
60
+ usbC: {
61
+ length: .862,
62
+ height: .276
63
+ }
64
+ }, x = {
65
+ cornerRadius: 1.3,
66
+ edgeRadius: .04,
67
+ rim: .113,
68
+ frontCamera: {
69
+ fromEdge: .355,
70
+ radius: .16
71
+ },
72
+ finishes: ["space-black", "silver"]
73
+ }, S = {
74
+ ...x,
75
+ id: "tablet.ipad-pro-11",
76
+ label: "iPad Pro 11-inch",
77
+ width: 17.75,
78
+ height: 24.97,
79
+ depth: .53,
80
+ display: {
81
+ px: [1668, 2420],
82
+ ppi: 264,
83
+ cornerRadius: .72
84
+ },
85
+ logo: {
86
+ height: 3.05,
87
+ raise: .29
88
+ }
89
+ }, C = {
90
+ ...x,
91
+ id: "tablet.ipad-pro-13",
92
+ label: "iPad Pro 13-inch",
93
+ width: 21.55,
94
+ height: 28.16,
95
+ depth: .51,
96
+ display: {
97
+ px: [2064, 2752],
98
+ ppi: 264,
99
+ cornerRadius: .72
100
+ },
101
+ logo: {
102
+ height: 3.44,
103
+ raise: .33
104
+ }
105
+ }, w = {
106
+ [S.id]: S,
107
+ [C.id]: C
108
+ };
109
+ // ../devices/src/tablet/build.ts
110
+ function T(e, t) {
111
+ f(e, t), e.frame.anisotropy = 0;
112
+ }
113
+ function E(e, n, r = "high") {
114
+ let a = l[r], { width: u, height: d, depth: f, cornerRadius: b, rim: x } = e, S = v(n);
115
+ T(S, n);
116
+ let C = new o();
117
+ _(C, m({
118
+ width: u,
119
+ height: d,
120
+ depth: f,
121
+ radius: b,
122
+ edge: e.edgeRadius,
123
+ quality: a
124
+ }), S.frame), O(e, S, C, a);
125
+ let w = new o();
126
+ w.position.z = f / 2, C.add(w), _(w, y(u - 2 * x, d - 2 * x, b - x, 2, a), S.glass, { z: p });
127
+ let E = e.display.px[0] / e.display.ppi * 2.54, k = e.display.px[1] / e.display.ppi * 2.54, A = _(w, g(y(E, k, e.display.cornerRadius, 2, a)), S.display, { z: p * 2 }), j = e.frontCamera;
128
+ _(w, new t(j.radius, a.round), S.lens, {
129
+ x: u / 2 - j.fromEdge,
130
+ z: p * 3
131
+ }), _(w, new t(j.radius * .66, a.round), S.pupil, {
132
+ x: u / 2 - j.fromEdge,
133
+ z: p * 4
134
+ });
135
+ let M = new o();
136
+ M.position.z = -f / 2, M.rotation.y = Math.PI, C.add(M), _(M, y(u - .1, d - .1, b - .05, 2, a), S.back, { z: p }), D(e, S, M, a), e.branding !== !1 && _(M, c(e.logo.height), S.logo, {
137
+ y: e.logo.raise,
138
+ z: p * 2
139
+ });
140
+ let N = h(A, E / k, S);
141
+ return {
142
+ group: C,
143
+ screens: [N],
144
+ bounds: new i().setFromObject(C),
145
+ params: {},
146
+ restsOnFloor: !1,
147
+ setParam() {},
148
+ setFinish: (e) => T(S, e),
149
+ setGlare: (e, t) => N.setGlare(e, t),
150
+ dispose: () => s(C)
151
+ };
152
+ }
153
+ function D(e, r, i, s) {
154
+ let c = b.camera, l = -e.width / 2 + c.fromSide + c.size / 2, u = e.height / 2 - c.fromTop - c.size / 2, f = new o();
155
+ f.position.set(l, u, 0), i.add(f);
156
+ let m = .03, h = new a(d(c.size - 2 * m, c.size - 2 * m, c.radius - m, 2, s.corner), {
157
+ depth: c.raise - m,
158
+ bevelEnabled: !0,
159
+ bevelThickness: m,
160
+ bevelSize: m,
161
+ bevelSegments: 4
162
+ });
163
+ _(f, h, r.island);
164
+ let g = c.raise + p, v = c.size - 2 * c.glassInset;
165
+ _(f, y(v, v, c.radius - c.glassInset, 2, s), r.glass, { z: g });
166
+ let x = (e) => -e, { lens: S, lidar: C, flash: w, sensor: T, mic: E } = b, D = new n(S.ring, S.ring, S.raise, s.round);
167
+ D.rotateX(Math.PI / 2), _(f, D, r.lensRing, {
168
+ x: x(S.x),
169
+ y: S.y,
170
+ z: g + S.raise / 2
171
+ });
172
+ let O = g + S.raise + p;
173
+ _(f, new t(S.glass, s.round), r.lens, {
174
+ x: x(S.x),
175
+ y: S.y,
176
+ z: O
177
+ }), _(f, new t(S.glass * .36, s.round), r.pupil, {
178
+ x: x(S.x),
179
+ y: S.y,
180
+ z: O + p
181
+ }), _(f, new t(C.radius, s.round), r.pupil, {
182
+ x: x(C.x),
183
+ y: C.y,
184
+ z: g + p
185
+ }), _(f, new t(w.radius, s.round), r.flash, {
186
+ x: x(w.x),
187
+ y: w.y,
188
+ z: g + p
189
+ }), _(f, new t(T.radius, s.round), r.pupil, {
190
+ x: x(T.x),
191
+ y: T.y,
192
+ z: g + p
193
+ }), _(f, new t(E.radius, s.round), r.bezel, {
194
+ x: x(E.x),
195
+ y: E.y,
196
+ z: g + p
197
+ });
198
+ }
199
+ function O(e, n, i, a) {
200
+ let { width: o, height: s } = e, c = .1, l = b.topButton;
201
+ _(i, u(l.length, l.height, l.proud + c, "x", a), n.frame, {
202
+ x: o / 2 - l.fromSide,
203
+ y: s / 2 + l.proud - (l.proud + c) / 2,
204
+ rx: Math.PI / 2
205
+ });
206
+ let d = b.volume;
207
+ for (let e of [0, 1]) _(i, u(d.length, d.height, d.proud + c, "y", a), n.frame, {
208
+ x: o / 2 + d.proud - (d.proud + c) / 2,
209
+ y: s / 2 - d.fromTop - d.length / 2 - e * (d.length + d.gap),
210
+ ry: Math.PI / 2
211
+ });
212
+ let f = b.speaker, m = [];
213
+ for (let e of [-1, 1]) for (let n = 0; n < f.holes; n++) {
214
+ let r = new t(f.hole / 2, 12);
215
+ r.translate(e * (o / 2 - f.fromSide - n * f.pitch), 0, 0), m.push(r);
216
+ }
217
+ let h = r(m);
218
+ for (let e of m) e.dispose();
219
+ _(i, h, n.bezel, {
220
+ y: s / 2 + p,
221
+ rx: -Math.PI / 2
222
+ }), _(i, h.clone(), n.bezel, {
223
+ y: -s / 2 - p,
224
+ rx: Math.PI / 2
225
+ }), _(i, new t(.05, 12), n.bezel, {
226
+ y: s / 2 + p,
227
+ rx: -Math.PI / 2
228
+ }), _(i, y(b.usbC.length, b.usbC.height, b.usbC.height / 2, 2, a), n.bezel, {
229
+ y: -s / 2 - p,
230
+ rx: Math.PI / 2
231
+ });
232
+ }
233
+ // ../devices/src/tablet/finishes.ts
234
+ var k = {
235
+ "space-black": {
236
+ label: "Space Black",
237
+ frame: "#2b2b2e",
238
+ back: "#2b2b2e",
239
+ frameRoughness: .34,
240
+ backMaterial: "metal"
241
+ },
242
+ silver: {
243
+ label: "Silver",
244
+ frame: "#d7d7d9",
245
+ back: "#d7d7d9",
246
+ frameRoughness: .3,
247
+ backMaterial: "metal"
248
+ }
249
+ }, A = /* @__PURE__ */ e({ tablet: () => j }), j = {
250
+ type: "tablet",
251
+ specs: w,
252
+ finishes: k,
253
+ build: E
254
+ };
255
+ export { A as t };
@@ -0,0 +1,274 @@
1
+ import { t as e } from "./rolldown-runtime-CGnMp29N.js";
2
+ import { H as t, X as n, d as r, f as i, h as a, s as o, v as s, x as c } from "./three-o_76Nw0r.js";
3
+ import { D as l, E as u, a as d, c as f, f as p, i as m, l as h, m as g, n as _, o as v, p as y, s as b } from "./device-phone-DxWL5LkW.js";
4
+ // ../devices/src/primitives/strap.ts
5
+ function x({ width: e, thickness: i, length: a, curl: o, direction: c, segments: l = 24 }) {
6
+ let u = c, d = new r([
7
+ new n(0, 0, 0),
8
+ new n(0, u * a * .35, -i * .2),
9
+ new n(0, u * a * .7, -a * o * .35),
10
+ new n(0, u * a, -a * o)
11
+ ]), f = i / 2, p = new t();
12
+ return p.moveTo(-e / 2 + f, -f), p.lineTo(e / 2 - f, -f), p.absarc(e / 2 - f, 0, f, -Math.PI / 2, Math.PI / 2, !1), p.lineTo(-e / 2 + f, f), p.absarc(-e / 2 + f, 0, f, Math.PI / 2, 3 * Math.PI / 2, !1), new s(p, {
13
+ steps: l,
14
+ bevelEnabled: !1,
15
+ extrudePath: d
16
+ });
17
+ }
18
+ // ../devices/src/watch/index.ts
19
+ var S = /* @__PURE__ */ e({
20
+ WATCH_FINISHES: () => E,
21
+ WATCH_SERIES_12_42: () => w,
22
+ WATCH_SERIES_12_46: () => C,
23
+ WATCH_SPECS: () => O,
24
+ WATCH_ULTRA_4: () => T,
25
+ buildWatch: () => D,
26
+ watch: () => k
27
+ }), C = {
28
+ id: "watch.series-12-46",
29
+ label: "Apple Watch Series 12 (46 mm)",
30
+ finishes: [
31
+ "jet-black",
32
+ "space-gray",
33
+ "light-gold",
34
+ "dark-bronze",
35
+ "natural-titanium",
36
+ "radiant-gold",
37
+ "pearl-white",
38
+ "night-blue"
39
+ ],
40
+ width: 4,
41
+ height: 4.6,
42
+ depth: .97,
43
+ corner: {
44
+ radius: 1.25,
45
+ exponent: 2.8
46
+ },
47
+ edgeRadius: .22,
48
+ display: {
49
+ px: [416, 496],
50
+ ppi: 326
51
+ },
52
+ bezel: .28,
53
+ crystal: "domed",
54
+ crown: {
55
+ radius: .32,
56
+ depth: .22,
57
+ y: .75
58
+ },
59
+ sideButton: {
60
+ length: 1.1,
61
+ y: -.55
62
+ },
63
+ band: {
64
+ width: 2.2,
65
+ thickness: .3,
66
+ length: 7.5
67
+ },
68
+ logoHeight: .9
69
+ }, w = {
70
+ ...C,
71
+ id: "watch.series-12-42",
72
+ label: "Apple Watch Series 12 (42 mm)",
73
+ width: 3.7,
74
+ height: 4.2,
75
+ corner: {
76
+ radius: 1.15,
77
+ exponent: 2.8
78
+ },
79
+ display: {
80
+ px: [374, 446],
81
+ ppi: 326
82
+ },
83
+ crown: {
84
+ radius: .3,
85
+ depth: .2,
86
+ y: .65
87
+ },
88
+ sideButton: {
89
+ length: 1,
90
+ y: -.5
91
+ },
92
+ band: {
93
+ width: 2,
94
+ thickness: .28,
95
+ length: 7
96
+ },
97
+ logoHeight: .8
98
+ }, T = {
99
+ id: "watch.ultra-4",
100
+ label: "Apple Watch Ultra 4",
101
+ finishes: ["natural-titanium", "black-titanium"],
102
+ width: 4.4,
103
+ height: 4.9,
104
+ depth: 1.2,
105
+ corner: {
106
+ radius: 1,
107
+ exponent: 2.4
108
+ },
109
+ edgeRadius: .12,
110
+ display: {
111
+ px: [422, 514],
112
+ ppi: 326
113
+ },
114
+ bezel: .36,
115
+ crystal: "flat",
116
+ crown: {
117
+ radius: .36,
118
+ depth: .28,
119
+ y: .7
120
+ },
121
+ sideButton: {
122
+ length: 1.2,
123
+ y: -.6
124
+ },
125
+ actionButton: {
126
+ length: 1.3,
127
+ y: .3
128
+ },
129
+ band: {
130
+ width: 2.4,
131
+ thickness: .34,
132
+ length: 8
133
+ },
134
+ logoHeight: 1
135
+ }, E = {
136
+ "jet-black": {
137
+ label: "Black",
138
+ frame: "#1c1c1e",
139
+ back: "#141416",
140
+ frameRoughness: .12,
141
+ backMaterial: "ceramic"
142
+ },
143
+ "space-gray": {
144
+ label: "Space Gray",
145
+ frame: "#6e6e73",
146
+ back: "#141416",
147
+ frameRoughness: .3,
148
+ backMaterial: "ceramic"
149
+ },
150
+ "light-gold": {
151
+ label: "Light Gold",
152
+ frame: "#d9c9a9",
153
+ back: "#141416",
154
+ frameRoughness: .3,
155
+ backMaterial: "ceramic"
156
+ },
157
+ "dark-bronze": {
158
+ label: "Dark Bronze",
159
+ frame: "#5b4738",
160
+ back: "#141416",
161
+ frameRoughness: .3,
162
+ backMaterial: "ceramic"
163
+ },
164
+ "natural-titanium": {
165
+ label: "Natural Titanium",
166
+ frame: "#a19d95",
167
+ back: "#141416",
168
+ frameRoughness: .34,
169
+ backMaterial: "ceramic",
170
+ accent: "#ff7a1a"
171
+ },
172
+ "radiant-gold": {
173
+ label: "Radiant Gold",
174
+ frame: "#c9a96c",
175
+ back: "#141416",
176
+ frameRoughness: .22,
177
+ backMaterial: "ceramic"
178
+ },
179
+ "black-titanium": {
180
+ label: "Black Titanium",
181
+ frame: "#2b2b2e",
182
+ back: "#141416",
183
+ frameRoughness: .3,
184
+ backMaterial: "ceramic",
185
+ accent: "#ff7a1a"
186
+ },
187
+ "pearl-white": {
188
+ label: "Pearl White",
189
+ frame: "#ecebe5",
190
+ back: "#ecebe5",
191
+ frameRoughness: .12,
192
+ backMaterial: "ceramic"
193
+ },
194
+ "night-blue": {
195
+ label: "Night Blue",
196
+ frame: "#1f2a44",
197
+ back: "#1f2a44",
198
+ frameRoughness: .12,
199
+ backMaterial: "ceramic"
200
+ }
201
+ };
202
+ function D(e, t, n = "high") {
203
+ let r = d[n], { width: s, height: S, depth: C, bezel: w } = e, { radius: T, exponent: E } = e.corner, D = y(t), O = new c();
204
+ v(O, h({
205
+ width: s,
206
+ height: S,
207
+ depth: C,
208
+ radius: T,
209
+ exponent: E,
210
+ edge: e.edgeRadius,
211
+ quality: r
212
+ }), D.frame);
213
+ let k = new c();
214
+ k.position.z = C / 2, O.add(k);
215
+ let A = e.crystal === "flat" ? .2 : .05, j = s - 2 * w, M = S - 2 * w;
216
+ v(k, b(s - 2 * A, S - 2 * A, T - A, E, r), D.bezel, { z: m });
217
+ let N = v(k, _(b(j, M, T - w, E, r)), D.display, { z: m * 2 }), P = e.crown;
218
+ v(O, new a(P.radius, P.radius, P.depth, r.round), D.frame, {
219
+ x: s / 2 + P.depth / 2 - .04,
220
+ y: P.y,
221
+ rz: Math.PI / 2
222
+ }), v(O, new a(P.radius * .55, P.radius * .55, P.depth + .04, r.round), D.pupil, {
223
+ x: s / 2 + P.depth / 2 - .02,
224
+ y: P.y,
225
+ rz: Math.PI / 2
226
+ }), v(O, f(e.sideButton.length, .18, .16, "y", r), D.frame, {
227
+ x: s / 2 + .02,
228
+ y: e.sideButton.y,
229
+ ry: Math.PI / 2
230
+ }), e.actionButton && v(O, f(e.actionButton.length, .3, .26, "y", r), D.accent, {
231
+ x: -s / 2 - .02,
232
+ y: e.actionButton.y,
233
+ ry: Math.PI / 2
234
+ });
235
+ let F = new c();
236
+ F.position.z = -C / 2, F.rotation.y = Math.PI, O.add(F), v(F, new i(Math.min(s, S) * .42, r.round), D.back, { z: m }), e.branding !== !1 && v(F, u(e.logoHeight), D.logo, {
237
+ y: Math.min(s, S) * .22,
238
+ z: m * 2
239
+ });
240
+ let I = e.band;
241
+ for (let e of [1, -1]) v(O, x({
242
+ width: I.width,
243
+ thickness: I.thickness,
244
+ length: I.length * .55,
245
+ curl: 1.1,
246
+ direction: e
247
+ }), D.band, {
248
+ y: e * (S / 2 - .15),
249
+ z: -C * .15
250
+ });
251
+ let L = g(N, j / M, D);
252
+ return {
253
+ group: O,
254
+ screens: [L],
255
+ bounds: new o().setFromObject(O),
256
+ params: {},
257
+ restsOnFloor: !1,
258
+ setParam() {},
259
+ setFinish: (e) => p(D, e),
260
+ setGlare: (e, t) => L.setGlare(e, t),
261
+ dispose: () => l(O)
262
+ };
263
+ }
264
+ var O = {
265
+ [C.id]: C,
266
+ [w.id]: w,
267
+ [T.id]: T
268
+ }, k = {
269
+ type: "watch",
270
+ specs: O,
271
+ finishes: E,
272
+ build: D
273
+ };
274
+ export { S as t };