@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
|
@@ -0,0 +1,900 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-CGnMp29N.js";
|
|
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 { 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
|
+
// ../devices/src/laptop/keyboard.ts
|
|
5
|
+
var j = 1.646, M = 1.596, N = 1.846, P = 27.23, F = {
|
|
6
|
+
width: P,
|
|
7
|
+
depth: 10.826
|
|
8
|
+
};
|
|
9
|
+
function I(e, t, n) {
|
|
10
|
+
let r = (P - t.reduce((e, t) => e + t, 0)) / (t.length - 1), i = -27.23 / 2;
|
|
11
|
+
return t.map((t, a) => {
|
|
12
|
+
let o = n[a] ?? "", s = typeof o == "string" ? { label: o } : o, c = {
|
|
13
|
+
x: i + t / 2,
|
|
14
|
+
y: e * N + M / 2,
|
|
15
|
+
w: t,
|
|
16
|
+
h: M,
|
|
17
|
+
...s
|
|
18
|
+
};
|
|
19
|
+
return i += t + r, c;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
var L = (e) => Array(e).fill(j), R = [
|
|
23
|
+
...I(0, [2.593, ...L(13)], [
|
|
24
|
+
{
|
|
25
|
+
label: "esc",
|
|
26
|
+
align: "left"
|
|
27
|
+
},
|
|
28
|
+
"F1",
|
|
29
|
+
"F2",
|
|
30
|
+
"F3",
|
|
31
|
+
"F4",
|
|
32
|
+
"F5",
|
|
33
|
+
"F6",
|
|
34
|
+
"F7",
|
|
35
|
+
"F8",
|
|
36
|
+
"F9",
|
|
37
|
+
"F10",
|
|
38
|
+
"F11",
|
|
39
|
+
"F12",
|
|
40
|
+
{ touchId: !0 }
|
|
41
|
+
]),
|
|
42
|
+
...I(1, [...L(13), 2.593], [
|
|
43
|
+
{
|
|
44
|
+
label: "`",
|
|
45
|
+
shift: "~"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: "1",
|
|
49
|
+
shift: "!"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: "2",
|
|
53
|
+
shift: "@"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: "3",
|
|
57
|
+
shift: "#"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: "4",
|
|
61
|
+
shift: "$"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: "5",
|
|
65
|
+
shift: "%"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
label: "6",
|
|
69
|
+
shift: "^"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: "7",
|
|
73
|
+
shift: "&"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: "8",
|
|
77
|
+
shift: "*"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: "9",
|
|
81
|
+
shift: "("
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
label: "0",
|
|
85
|
+
shift: ")"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
label: "-",
|
|
89
|
+
shift: "_"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
label: "=",
|
|
93
|
+
shift: "+"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
label: "delete",
|
|
97
|
+
align: "right"
|
|
98
|
+
}
|
|
99
|
+
]),
|
|
100
|
+
...I(2, [2.593, ...L(13)], [
|
|
101
|
+
{
|
|
102
|
+
label: "tab",
|
|
103
|
+
align: "left"
|
|
104
|
+
},
|
|
105
|
+
"Q",
|
|
106
|
+
"W",
|
|
107
|
+
"E",
|
|
108
|
+
"R",
|
|
109
|
+
"T",
|
|
110
|
+
"Y",
|
|
111
|
+
"U",
|
|
112
|
+
"I",
|
|
113
|
+
"O",
|
|
114
|
+
"P",
|
|
115
|
+
{
|
|
116
|
+
label: "[",
|
|
117
|
+
shift: "{"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
label: "]",
|
|
121
|
+
shift: "}"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
label: "\\",
|
|
125
|
+
shift: "|"
|
|
126
|
+
}
|
|
127
|
+
]),
|
|
128
|
+
...I(3, [
|
|
129
|
+
3.067,
|
|
130
|
+
...L(11),
|
|
131
|
+
3.067
|
|
132
|
+
], [
|
|
133
|
+
{
|
|
134
|
+
label: "caps lock",
|
|
135
|
+
align: "left"
|
|
136
|
+
},
|
|
137
|
+
"A",
|
|
138
|
+
"S",
|
|
139
|
+
"D",
|
|
140
|
+
"F",
|
|
141
|
+
"G",
|
|
142
|
+
"H",
|
|
143
|
+
"J",
|
|
144
|
+
"K",
|
|
145
|
+
"L",
|
|
146
|
+
{
|
|
147
|
+
label: ";",
|
|
148
|
+
shift: ":"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
label: "'",
|
|
152
|
+
shift: "\""
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
label: "return",
|
|
156
|
+
align: "right"
|
|
157
|
+
}
|
|
158
|
+
]),
|
|
159
|
+
...I(4, [
|
|
160
|
+
4.015,
|
|
161
|
+
...L(10),
|
|
162
|
+
4.015
|
|
163
|
+
], [
|
|
164
|
+
{
|
|
165
|
+
label: "shift",
|
|
166
|
+
align: "left"
|
|
167
|
+
},
|
|
168
|
+
"Z",
|
|
169
|
+
"X",
|
|
170
|
+
"C",
|
|
171
|
+
"V",
|
|
172
|
+
"B",
|
|
173
|
+
"N",
|
|
174
|
+
"M",
|
|
175
|
+
{
|
|
176
|
+
label: ",",
|
|
177
|
+
shift: "<"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
label: ".",
|
|
181
|
+
shift: ">"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
label: "/",
|
|
185
|
+
shift: "?"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
label: "shift",
|
|
189
|
+
align: "right"
|
|
190
|
+
}
|
|
191
|
+
]),
|
|
192
|
+
...[
|
|
193
|
+
[
|
|
194
|
+
-12.792,
|
|
195
|
+
j,
|
|
196
|
+
"fn",
|
|
197
|
+
"left"
|
|
198
|
+
],
|
|
199
|
+
[
|
|
200
|
+
-10.897,
|
|
201
|
+
j,
|
|
202
|
+
"control",
|
|
203
|
+
"left"
|
|
204
|
+
],
|
|
205
|
+
[
|
|
206
|
+
-9.002,
|
|
207
|
+
j,
|
|
208
|
+
"option",
|
|
209
|
+
"left"
|
|
210
|
+
],
|
|
211
|
+
[
|
|
212
|
+
-6.87,
|
|
213
|
+
2.12,
|
|
214
|
+
"command",
|
|
215
|
+
"left"
|
|
216
|
+
],
|
|
217
|
+
[
|
|
218
|
+
-.9475,
|
|
219
|
+
9.226,
|
|
220
|
+
""
|
|
221
|
+
],
|
|
222
|
+
[
|
|
223
|
+
4.9745,
|
|
224
|
+
2.12,
|
|
225
|
+
"command",
|
|
226
|
+
"right"
|
|
227
|
+
],
|
|
228
|
+
[
|
|
229
|
+
7.107,
|
|
230
|
+
j,
|
|
231
|
+
"option",
|
|
232
|
+
"right"
|
|
233
|
+
]
|
|
234
|
+
].map(([e, t, n, r]) => ({
|
|
235
|
+
x: e,
|
|
236
|
+
y: 10.028,
|
|
237
|
+
w: t,
|
|
238
|
+
h: M,
|
|
239
|
+
label: n,
|
|
240
|
+
align: r
|
|
241
|
+
})),
|
|
242
|
+
{
|
|
243
|
+
x: 9.002,
|
|
244
|
+
y: 10.826 - .389,
|
|
245
|
+
w: j,
|
|
246
|
+
h: .778,
|
|
247
|
+
label: "◀"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
x: 10.897,
|
|
251
|
+
y: 9.619,
|
|
252
|
+
w: j,
|
|
253
|
+
h: .778,
|
|
254
|
+
label: "▲"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
x: 10.897,
|
|
258
|
+
y: 10.826 - .389,
|
|
259
|
+
w: j,
|
|
260
|
+
h: .778,
|
|
261
|
+
label: "▼"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
x: 12.792,
|
|
265
|
+
y: 10.826 - .389,
|
|
266
|
+
w: j,
|
|
267
|
+
h: .778,
|
|
268
|
+
label: "▶"
|
|
269
|
+
}
|
|
270
|
+
], z = {
|
|
271
|
+
radius: .146,
|
|
272
|
+
roll: .021,
|
|
273
|
+
height: .146
|
|
274
|
+
}, B = .04;
|
|
275
|
+
function V(e, t) {
|
|
276
|
+
let n = /* @__PURE__ */ new Map(), r = [];
|
|
277
|
+
for (let i of R) {
|
|
278
|
+
let a = `${i.w}x${i.h}`, o = n.get(a);
|
|
279
|
+
if (!o) {
|
|
280
|
+
let e = z.roll;
|
|
281
|
+
o = new g(x(i.w - 2 * e, i.h - 2 * e, z.radius - e, 2, t), {
|
|
282
|
+
depth: z.height - 2 * e,
|
|
283
|
+
bevelEnabled: !0,
|
|
284
|
+
bevelThickness: e,
|
|
285
|
+
bevelSize: e,
|
|
286
|
+
bevelSegments: 3
|
|
287
|
+
}), o.deleteAttribute("uv"), n.set(a, o);
|
|
288
|
+
}
|
|
289
|
+
let s = o.clone();
|
|
290
|
+
s.translate(i.x, F.depth / 2 - i.y, e - z.height + z.roll), r.push(s);
|
|
291
|
+
}
|
|
292
|
+
let i = p(r);
|
|
293
|
+
for (let e of [...r, ...n.values()]) e.dispose();
|
|
294
|
+
return i;
|
|
295
|
+
}
|
|
296
|
+
function H(e) {
|
|
297
|
+
return R.map((t) => {
|
|
298
|
+
let n = x(t.w + 2 * B, t.h + 2 * B, z.radius + B, 2, Math.max(4, e / 2)).getPoints().map((e) => new c(e.x + t.x, e.y + F.depth / 2 - t.y));
|
|
299
|
+
return new i(n.reverse());
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
function U() {
|
|
303
|
+
let e = document.createElement("canvas");
|
|
304
|
+
e.width = Math.round(F.width * 76), e.height = Math.round(F.depth * 76);
|
|
305
|
+
let t = e.getContext("2d");
|
|
306
|
+
if (t) {
|
|
307
|
+
let e = (e, t = 400) => `${t} ${e}px ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif`;
|
|
308
|
+
t.fillStyle = "#fff", t.strokeStyle = "#fff";
|
|
309
|
+
for (let n of R) {
|
|
310
|
+
let r = (n.x + F.width / 2) * 76, i = n.y * 76, a = n.w / 2 * 76, o = n.h / 2 * 76, s = .2 * 76;
|
|
311
|
+
n.touchId ? (t.lineWidth = 2, t.globalAlpha = .35, t.beginPath(), t.arc(r, i, 35.72, 0, Math.PI * 2), t.stroke(), t.globalAlpha = 1) : n.label && (n.shift ? (t.font = e(.27 * 76), t.textAlign = "center", t.textBaseline = "middle", t.fillText(n.shift, r, i - .27 * 76), t.fillText(n.label, r, i + .27 * 76)) : n.align ? (t.font = e(.2 * 76), t.textBaseline = "alphabetic", t.textAlign = n.align, t.fillText(n.label, n.align === "left" ? r - a + s : r + a - s, i + o - s)) : (t.font = e((n.label.length > 1 || n.h < 1.596 ? .22 : .34) * 76), t.textAlign = "center", t.textBaseline = "middle", t.fillText(n.label, r, i)));
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
let n = new h(e);
|
|
315
|
+
return n.colorSpace = o, n.anisotropy = 8, n;
|
|
316
|
+
}
|
|
317
|
+
// ../devices/src/laptop/build.ts
|
|
318
|
+
var W = Math.PI / 180, G = [
|
|
319
|
+
[0, -.33],
|
|
320
|
+
[.001, -.48],
|
|
321
|
+
[.003, -.56],
|
|
322
|
+
[.008, -.64],
|
|
323
|
+
[.018, -.716],
|
|
324
|
+
[.037, -.792],
|
|
325
|
+
[.064, -.865],
|
|
326
|
+
[.102, -.933],
|
|
327
|
+
[.146, -.995],
|
|
328
|
+
[.205, -1.057],
|
|
329
|
+
[.259, -1.101],
|
|
330
|
+
[.268, -1.107],
|
|
331
|
+
[.305, -1.131],
|
|
332
|
+
[.338, -1.149],
|
|
333
|
+
[.378, -1.167],
|
|
334
|
+
[.421, -1.184],
|
|
335
|
+
[.492, -1.203],
|
|
336
|
+
[.571, -1.215],
|
|
337
|
+
[.651, -1.221],
|
|
338
|
+
[.8, -1.224]
|
|
339
|
+
], ee = 1.224, K = {
|
|
340
|
+
front: -.243,
|
|
341
|
+
bottom: -.52,
|
|
342
|
+
overhang: .026
|
|
343
|
+
}, q = 1.27, te = {
|
|
344
|
+
"usb-c": {
|
|
345
|
+
length: .862,
|
|
346
|
+
height: .276,
|
|
347
|
+
radius: .138,
|
|
348
|
+
z: -.377
|
|
349
|
+
},
|
|
350
|
+
magsafe: {
|
|
351
|
+
length: 1.62,
|
|
352
|
+
height: .34,
|
|
353
|
+
radius: .17,
|
|
354
|
+
z: -.38
|
|
355
|
+
},
|
|
356
|
+
headphone: {
|
|
357
|
+
length: .38,
|
|
358
|
+
height: .38,
|
|
359
|
+
radius: .19,
|
|
360
|
+
z: -.375
|
|
361
|
+
},
|
|
362
|
+
hdmi: {
|
|
363
|
+
length: 1.45,
|
|
364
|
+
height: .5,
|
|
365
|
+
radius: .08,
|
|
366
|
+
z: -.42
|
|
367
|
+
},
|
|
368
|
+
sd: {
|
|
369
|
+
length: 2.45,
|
|
370
|
+
height: .2,
|
|
371
|
+
radius: .1,
|
|
372
|
+
z: -.38
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
function ne() {
|
|
376
|
+
let e = new t({
|
|
377
|
+
color: 328966,
|
|
378
|
+
roughness: .9,
|
|
379
|
+
transparent: !0,
|
|
380
|
+
depthWrite: !1
|
|
381
|
+
}), n = le();
|
|
382
|
+
n ? e.alphaMap = n : e.opacity = .35;
|
|
383
|
+
let r = new t({
|
|
384
|
+
color: 14277083,
|
|
385
|
+
roughness: .6,
|
|
386
|
+
transparent: !0,
|
|
387
|
+
depthWrite: !1
|
|
388
|
+
});
|
|
389
|
+
return typeof document < "u" && (r.map = U()), {
|
|
390
|
+
keycap: new f({
|
|
391
|
+
color: 1118483,
|
|
392
|
+
roughness: .55,
|
|
393
|
+
clearcoat: .25,
|
|
394
|
+
clearcoatRoughness: .5
|
|
395
|
+
}),
|
|
396
|
+
legend: r,
|
|
397
|
+
plate: new t({
|
|
398
|
+
color: 657931,
|
|
399
|
+
roughness: .75
|
|
400
|
+
}),
|
|
401
|
+
well: new t({
|
|
402
|
+
color: 197380,
|
|
403
|
+
roughness: .9
|
|
404
|
+
}),
|
|
405
|
+
trackpad: new f({
|
|
406
|
+
roughness: .4,
|
|
407
|
+
clearcoat: .4,
|
|
408
|
+
clearcoatRoughness: .35
|
|
409
|
+
}),
|
|
410
|
+
gap: new t({
|
|
411
|
+
color: 394759,
|
|
412
|
+
roughness: .8
|
|
413
|
+
}),
|
|
414
|
+
grille: e,
|
|
415
|
+
foot: new t({
|
|
416
|
+
color: 2697515,
|
|
417
|
+
roughness: .92
|
|
418
|
+
}),
|
|
419
|
+
clutch: new f({
|
|
420
|
+
color: 789517,
|
|
421
|
+
roughness: .35,
|
|
422
|
+
clearcoat: .6,
|
|
423
|
+
clearcoatRoughness: .2
|
|
424
|
+
}),
|
|
425
|
+
cameraHousing: J(855312),
|
|
426
|
+
cameraLens: J(328967),
|
|
427
|
+
cameraWindow: J(724260),
|
|
428
|
+
cameraPupil: J(0)
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
function J(e) {
|
|
432
|
+
return new f({
|
|
433
|
+
color: e,
|
|
434
|
+
roughness: .6,
|
|
435
|
+
specularIntensity: 0,
|
|
436
|
+
clearcoat: 1,
|
|
437
|
+
clearcoatRoughness: .02
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
function Y(e, t, n) {
|
|
441
|
+
S(e, n), e.frame.anisotropy = 0, t.trackpad.color.set(n.frame).multiplyScalar(.62);
|
|
442
|
+
}
|
|
443
|
+
function re(e, t, n = "high") {
|
|
444
|
+
let r = b[n], i = D(t), a = ne();
|
|
445
|
+
Y(i, a, t);
|
|
446
|
+
let o = new _(), s = new _();
|
|
447
|
+
s.position.y = e.feet.height + e.baseHeight, s.rotation.x = -Math.PI / 2, o.add(s), ie(e, i, a, s, r);
|
|
448
|
+
let c = new _();
|
|
449
|
+
c.position.set(0, s.position.y - e.lid.pivot.belowDeck, -e.depth / 2 + e.lid.pivot.fromBack), o.add(c);
|
|
450
|
+
let { displayMesh: l, aspect: u, setOpen: d } = oe(e, i, a, c, r), f = (e) => {
|
|
451
|
+
c.rotation.x = (90 - e) * W, d(e);
|
|
452
|
+
};
|
|
453
|
+
f(110);
|
|
454
|
+
let p = w(l, u, i);
|
|
455
|
+
return {
|
|
456
|
+
group: o,
|
|
457
|
+
screens: [p],
|
|
458
|
+
bounds: new m().setFromObject(o),
|
|
459
|
+
params: { lidAngle: {
|
|
460
|
+
min: 0,
|
|
461
|
+
max: 135,
|
|
462
|
+
default: 110,
|
|
463
|
+
unit: "deg",
|
|
464
|
+
label: "Lid angle"
|
|
465
|
+
} },
|
|
466
|
+
restsOnFloor: !0,
|
|
467
|
+
setParam(e, t) {
|
|
468
|
+
e === "lidAngle" && f(t);
|
|
469
|
+
},
|
|
470
|
+
setFinish: (e) => Y(i, a, e),
|
|
471
|
+
setGlare: (e, t) => {
|
|
472
|
+
p.setGlare(e, t);
|
|
473
|
+
for (let e of [
|
|
474
|
+
a.cameraHousing,
|
|
475
|
+
a.cameraLens,
|
|
476
|
+
a.cameraWindow,
|
|
477
|
+
a.cameraPupil
|
|
478
|
+
]) e.clearcoat = i.glass.clearcoat;
|
|
479
|
+
},
|
|
480
|
+
dispose: () => {
|
|
481
|
+
v(o);
|
|
482
|
+
for (let e of Object.values(a)) e.map?.dispose(), e.alphaMap?.dispose(), e.dispose();
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
function ie(e, t, r, o, l) {
|
|
487
|
+
let { width: f, depth: p, baseHeight: m } = e, { radius: h, exponent: _ } = e.corner, v = e.scoop.height, y = p / 2 - e.keyboard.fromBack - F.depth / 2, b = F.width + 2 * e.keyboard.margin, S = F.depth + 2 * e.keyboard.margin, w = new n(ae(e, l)), T = x(b, S, .5, 2, l.corner).getPoints().map((e) => new c(e.x, e.y + y));
|
|
488
|
+
w.holes.push(new i(T));
|
|
489
|
+
let D = new g(w, {
|
|
490
|
+
depth: v,
|
|
491
|
+
bevelEnabled: !1,
|
|
492
|
+
curveSegments: l.corner
|
|
493
|
+
});
|
|
494
|
+
D.translate(0, 0, -v), E(o, d(D, 30 * W), t.frame);
|
|
495
|
+
let A = ee - m, j = G.map(([e, t]) => [e, t < -.48 ? t + A : t]);
|
|
496
|
+
E(o, O({
|
|
497
|
+
width: f,
|
|
498
|
+
height: p,
|
|
499
|
+
radius: h,
|
|
500
|
+
exponent: _,
|
|
501
|
+
segments: l.corner,
|
|
502
|
+
profile: j
|
|
503
|
+
}), t.frame), E(o, k(f, p, h, _, l), t.frame, { z: -v });
|
|
504
|
+
let [M] = j[j.length - 1];
|
|
505
|
+
E(o, k(f - 2 * M, p - 2 * M, h - M, _, l), t.frame, {
|
|
506
|
+
z: -m,
|
|
507
|
+
rx: Math.PI
|
|
508
|
+
}), E(o, k(b, S, .5, 2, l), r.well, {
|
|
509
|
+
y,
|
|
510
|
+
z: -.258
|
|
511
|
+
});
|
|
512
|
+
let N = x(b, S, .5, 2, l.corner);
|
|
513
|
+
for (let e of H(l.corner)) N.holes.push(e);
|
|
514
|
+
E(o, new s(N, l.corner), r.plate, { y }), E(o, V(.01, Math.max(6, l.corner / 3)), r.keycap, { y }), r.legend.map && E(o, new a(F.width, F.depth), r.legend, {
|
|
515
|
+
y,
|
|
516
|
+
z: .0125
|
|
517
|
+
});
|
|
518
|
+
let P = e.trackpad, I = -p / 2 + P.fromFront + P.depth / 2;
|
|
519
|
+
E(o, k(P.width + .055, P.depth + .055, P.radius + .0275, 2, l), r.gap, {
|
|
520
|
+
y: I,
|
|
521
|
+
z: C
|
|
522
|
+
}), E(o, k(P.width, P.depth, P.radius, 2, l), r.trackpad, {
|
|
523
|
+
y: I,
|
|
524
|
+
z: C * 2
|
|
525
|
+
});
|
|
526
|
+
let L = F.depth - .19, R = e.grille.outer - e.grille.inner;
|
|
527
|
+
r.grille.alphaMap?.repeat.set(R / .64, L / .64);
|
|
528
|
+
for (let t of [-1, 1]) E(o, new a(R, L), r.grille, {
|
|
529
|
+
x: t * (e.grille.inner + R / 2),
|
|
530
|
+
y,
|
|
531
|
+
z: C
|
|
532
|
+
});
|
|
533
|
+
E(o, new u(.3, .3, e.hinge.width - .3, l.round), r.clutch, {
|
|
534
|
+
y: p / 2 - .44,
|
|
535
|
+
z: -.3,
|
|
536
|
+
rz: Math.PI / 2
|
|
537
|
+
});
|
|
538
|
+
for (let t of e.ports) {
|
|
539
|
+
let e = te[t.kind];
|
|
540
|
+
E(o, k(e.height, e.length, e.radius, 2, l), r.gap, {
|
|
541
|
+
x: t.side * (f / 2 + .002),
|
|
542
|
+
y: p / 2 - t.fromBack,
|
|
543
|
+
z: e.z,
|
|
544
|
+
ry: t.side * Math.PI / 2
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
let z = e.feet;
|
|
548
|
+
for (let e of [-1, 1]) for (let t of [-1, 1]) E(o, new u(z.radius, z.radius, z.height, l.round), r.foot, {
|
|
549
|
+
x: e * (f / 2 - z.inset),
|
|
550
|
+
y: t * (p / 2 - z.inset),
|
|
551
|
+
z: -m - z.height / 2,
|
|
552
|
+
rx: Math.PI / 2
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
function ae(e, t) {
|
|
556
|
+
let { width: n, depth: r } = e, i = A(n, r, e.corner.radius, e.corner.exponent, t.corner), a = r / 2, o = i.findIndex((e, t) => {
|
|
557
|
+
let n = i[(t + 1) % i.length];
|
|
558
|
+
return Math.abs(e.y - a) < 1e-6 && Math.abs(n.y - a) < 1e-6 && n.x < e.x;
|
|
559
|
+
}), s = e.hinge.width / 2, l = [
|
|
560
|
+
new c(s, a),
|
|
561
|
+
new c(s, a - e.hinge.depth),
|
|
562
|
+
new c(-s, a - e.hinge.depth),
|
|
563
|
+
new c(-s, a)
|
|
564
|
+
];
|
|
565
|
+
i.splice(o + 1, 0, ...l);
|
|
566
|
+
let u = e.scoop.width / 2, d = .74, f = [];
|
|
567
|
+
for (let t = 0; t <= 8; t++) {
|
|
568
|
+
let n = t / 8, i = n * n * (3 - 2 * n);
|
|
569
|
+
f.push(new c(-u + d * n, -r / 2 + e.scoop.depth * i));
|
|
570
|
+
}
|
|
571
|
+
for (let t = 8; t >= 0; t--) {
|
|
572
|
+
let n = t / 8, i = n * n * (3 - 2 * n);
|
|
573
|
+
f.push(new c(u - d * n, -r / 2 + e.scoop.depth * i));
|
|
574
|
+
}
|
|
575
|
+
return i.push(...f), i;
|
|
576
|
+
}
|
|
577
|
+
function oe(e, t, n, r, i) {
|
|
578
|
+
let { width: a } = e, { thickness: o, rim: c } = e.lid, { radius: u, exponent: d } = e.lid.corner, f = e.depth + K.overhang, p = K.bottom + f / 2, m = K.front, h = m - o, g = [
|
|
579
|
+
[c, m],
|
|
580
|
+
[c * .4, m - .007],
|
|
581
|
+
[.008, m - .025],
|
|
582
|
+
[0, m - .047],
|
|
583
|
+
[0, h + .08],
|
|
584
|
+
[.012, h + .04],
|
|
585
|
+
[.04, h + .015],
|
|
586
|
+
[.09, h + .002],
|
|
587
|
+
[.15, h]
|
|
588
|
+
];
|
|
589
|
+
E(r, O({
|
|
590
|
+
width: a,
|
|
591
|
+
height: f,
|
|
592
|
+
radius: u,
|
|
593
|
+
exponent: d,
|
|
594
|
+
segments: i.corner,
|
|
595
|
+
profile: g
|
|
596
|
+
}), t.frame, { y: p }), E(r, k(a - 2 * c, f - 2 * c, u - c, d, i), t.glass, {
|
|
597
|
+
y: p,
|
|
598
|
+
z: m + C
|
|
599
|
+
});
|
|
600
|
+
let v = e.display.px[0] / e.display.ppi * 2.54, b = e.display.px[1] / e.display.ppi * 2.54, x = K.bottom + f - e.bezel, { radius: S, exponent: w } = e.displayCorner, D = E(r, T(new s(se(v, b, S, w, i.corner))), t.display, {
|
|
601
|
+
y: x - b / 2,
|
|
602
|
+
z: m + C * 2
|
|
603
|
+
});
|
|
604
|
+
E(r, new s(ce(e.notch, i.corner)), t.glass, {
|
|
605
|
+
y: x,
|
|
606
|
+
z: m + C * 3
|
|
607
|
+
});
|
|
608
|
+
let A = e.camera, j = x - A.fromTop;
|
|
609
|
+
E(r, new l(A.housing, i.round), n.cameraHousing, {
|
|
610
|
+
y: j,
|
|
611
|
+
z: m + C * 4
|
|
612
|
+
}), E(r, new l(A.lens, i.round), n.cameraLens, {
|
|
613
|
+
y: j,
|
|
614
|
+
z: m + C * 5
|
|
615
|
+
}), E(r, new l(A.window, i.round), n.cameraWindow, {
|
|
616
|
+
y: j,
|
|
617
|
+
z: m + C * 6
|
|
618
|
+
}), E(r, new l(A.pupil, i.round), n.cameraPupil, {
|
|
619
|
+
y: j,
|
|
620
|
+
z: m + C * 7
|
|
621
|
+
});
|
|
622
|
+
let M = new _();
|
|
623
|
+
M.position.z = h, M.rotation.y = Math.PI, r.add(M), E(M, k(a - .3, f - .3, u - .15, d, i), t.frame, { y: p });
|
|
624
|
+
let N = k(e.hinge.width - .28, q, .3, 2, i);
|
|
625
|
+
N.translate(0, q / 2, 0);
|
|
626
|
+
let P = E(M, N, n.clutch, {
|
|
627
|
+
y: K.bottom,
|
|
628
|
+
z: C
|
|
629
|
+
});
|
|
630
|
+
return e.branding !== !1 && E(M, y(e.logo.height), t.logo, {
|
|
631
|
+
y: p + e.logo.raise,
|
|
632
|
+
z: C
|
|
633
|
+
}), {
|
|
634
|
+
displayMesh: D,
|
|
635
|
+
aspect: v / b,
|
|
636
|
+
setOpen: (e) => {
|
|
637
|
+
let t = Math.min(1, Math.max(0, e / 40));
|
|
638
|
+
P.scale.y = Math.max(.001, t * t * (3 - 2 * t)), P.visible = e > .5;
|
|
639
|
+
}
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
function X(e, t, n, r, i, a, o) {
|
|
643
|
+
let s = [];
|
|
644
|
+
for (let l = 0; l <= o; l++) {
|
|
645
|
+
let u = i + (a - i) * l / o, d = Math.cos(u), f = Math.sin(u);
|
|
646
|
+
s.push(new c(e + n * Math.sign(d) * Math.abs(d) ** (2 / r), t + n * Math.sign(f) * Math.abs(f) ** (2 / r)));
|
|
647
|
+
}
|
|
648
|
+
return s;
|
|
649
|
+
}
|
|
650
|
+
function se(e, t, r, i, a) {
|
|
651
|
+
let o = e / 2 - r, s = t / 2 - r;
|
|
652
|
+
return new n([
|
|
653
|
+
new c(-e / 2, -t / 2),
|
|
654
|
+
new c(e / 2, -t / 2),
|
|
655
|
+
...X(o, s, r, i, 0, Math.PI / 2, a),
|
|
656
|
+
...X(-o, s, r, i, Math.PI / 2, Math.PI, a)
|
|
657
|
+
]);
|
|
658
|
+
}
|
|
659
|
+
function ce(e, t, r = .3) {
|
|
660
|
+
let { height: i, radius: a, exponent: o, flare: s } = e, l = e.width / 2, u = Math.max(6, t / 2), d = [
|
|
661
|
+
new c(l + s, r),
|
|
662
|
+
...X(l + s, -s, s, 2, Math.PI / 2, Math.PI, u),
|
|
663
|
+
...X(l - a, -(i - a), a, o, 0, -Math.PI / 2, u)
|
|
664
|
+
], f = d.map((e) => new c(-e.x, e.y)).reverse();
|
|
665
|
+
return new n([...d, ...f]);
|
|
666
|
+
}
|
|
667
|
+
function le() {
|
|
668
|
+
if (typeof document > "u") return null;
|
|
669
|
+
let e = document.createElement("canvas");
|
|
670
|
+
e.width = e.height = 128;
|
|
671
|
+
let t = e.getContext("2d");
|
|
672
|
+
if (!t) return null;
|
|
673
|
+
t.fillStyle = "#000", t.fillRect(0, 0, 128, 128), t.fillStyle = "#fff";
|
|
674
|
+
for (let e = 0; e < 8; e++) for (let n = 0; n <= 8; n++) {
|
|
675
|
+
let r = n * 16 + (e % 2 ? 8 : 0);
|
|
676
|
+
t.beginPath(), t.arc(r % 128, e * 16 + 8, 4, 0, Math.PI * 2), t.fill();
|
|
677
|
+
}
|
|
678
|
+
let n = new h(e);
|
|
679
|
+
return n.wrapS = n.wrapT = r, n.anisotropy = 8, n;
|
|
680
|
+
}
|
|
681
|
+
// ../devices/src/laptop/finishes.ts
|
|
682
|
+
var ue = {
|
|
683
|
+
"space-black": {
|
|
684
|
+
label: "Space Black",
|
|
685
|
+
frame: "#47484c",
|
|
686
|
+
back: "#47484c",
|
|
687
|
+
frameRoughness: .4,
|
|
688
|
+
backMaterial: "metal"
|
|
689
|
+
},
|
|
690
|
+
silver: {
|
|
691
|
+
label: "Silver",
|
|
692
|
+
frame: "#d3d4d6",
|
|
693
|
+
back: "#d3d4d6",
|
|
694
|
+
frameRoughness: .42,
|
|
695
|
+
backMaterial: "metal"
|
|
696
|
+
}
|
|
697
|
+
}, Z = {
|
|
698
|
+
corner: {
|
|
699
|
+
radius: 1,
|
|
700
|
+
exponent: 2.2
|
|
701
|
+
},
|
|
702
|
+
feet: {
|
|
703
|
+
radius: .956,
|
|
704
|
+
height: .18,
|
|
705
|
+
inset: 2.74
|
|
706
|
+
},
|
|
707
|
+
keyboard: {
|
|
708
|
+
fromBack: 2.779,
|
|
709
|
+
margin: .325
|
|
710
|
+
},
|
|
711
|
+
scoop: {
|
|
712
|
+
width: 5.46,
|
|
713
|
+
depth: .249,
|
|
714
|
+
height: .336
|
|
715
|
+
},
|
|
716
|
+
hinge: {
|
|
717
|
+
width: 28.12,
|
|
718
|
+
depth: .556
|
|
719
|
+
},
|
|
720
|
+
lid: {
|
|
721
|
+
thickness: .417,
|
|
722
|
+
corner: {
|
|
723
|
+
radius: 1.15,
|
|
724
|
+
exponent: 2.2
|
|
725
|
+
},
|
|
726
|
+
rim: .08,
|
|
727
|
+
pivot: {
|
|
728
|
+
fromBack: .494,
|
|
729
|
+
belowDeck: .204
|
|
730
|
+
}
|
|
731
|
+
},
|
|
732
|
+
displayCorner: {
|
|
733
|
+
radius: .66,
|
|
734
|
+
exponent: 3.6
|
|
735
|
+
},
|
|
736
|
+
bezel: .548,
|
|
737
|
+
notch: {
|
|
738
|
+
width: 3.68,
|
|
739
|
+
height: .637,
|
|
740
|
+
radius: .2875,
|
|
741
|
+
exponent: 3,
|
|
742
|
+
flare: .098
|
|
743
|
+
},
|
|
744
|
+
camera: {
|
|
745
|
+
fromTop: .167,
|
|
746
|
+
housing: .201,
|
|
747
|
+
lens: .175,
|
|
748
|
+
window: .11,
|
|
749
|
+
pupil: .036
|
|
750
|
+
},
|
|
751
|
+
logo: {
|
|
752
|
+
height: 4.646,
|
|
753
|
+
raise: .387
|
|
754
|
+
},
|
|
755
|
+
finishes: ["space-black", "silver"]
|
|
756
|
+
}, de = [
|
|
757
|
+
{
|
|
758
|
+
side: -1,
|
|
759
|
+
kind: "magsafe",
|
|
760
|
+
fromBack: 3.572
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
side: -1,
|
|
764
|
+
kind: "usb-c",
|
|
765
|
+
fromBack: 5.423
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
side: -1,
|
|
769
|
+
kind: "usb-c",
|
|
770
|
+
fromBack: 6.907
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
side: -1,
|
|
774
|
+
kind: "headphone",
|
|
775
|
+
fromBack: 8.186
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
side: 1,
|
|
779
|
+
kind: "hdmi",
|
|
780
|
+
fromBack: 3.579
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
side: 1,
|
|
784
|
+
kind: "usb-c",
|
|
785
|
+
fromBack: 5.428
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
side: 1,
|
|
789
|
+
kind: "sd",
|
|
790
|
+
fromBack: 7.866
|
|
791
|
+
}
|
|
792
|
+
], Q = {
|
|
793
|
+
...Z,
|
|
794
|
+
id: "laptop.macbook-pro-16",
|
|
795
|
+
label: "MacBook Pro 16-inch",
|
|
796
|
+
width: 35.57,
|
|
797
|
+
depth: 24.81,
|
|
798
|
+
height: 1.68,
|
|
799
|
+
baseHeight: 1.224,
|
|
800
|
+
trackpad: {
|
|
801
|
+
width: 15.903,
|
|
802
|
+
depth: 9.92,
|
|
803
|
+
fromFront: .577,
|
|
804
|
+
radius: .525
|
|
805
|
+
},
|
|
806
|
+
grille: {
|
|
807
|
+
inner: 14.061,
|
|
808
|
+
outer: 17.646
|
|
809
|
+
},
|
|
810
|
+
display: {
|
|
811
|
+
px: [3456, 2234],
|
|
812
|
+
ppi: 254
|
|
813
|
+
},
|
|
814
|
+
ports: de
|
|
815
|
+
}, fe = [
|
|
816
|
+
{
|
|
817
|
+
side: -1,
|
|
818
|
+
kind: "magsafe",
|
|
819
|
+
fromBack: 2.779
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
side: -1,
|
|
823
|
+
kind: "usb-c",
|
|
824
|
+
fromBack: 4.627
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
side: -1,
|
|
828
|
+
kind: "usb-c",
|
|
829
|
+
fromBack: 6.112
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
side: -1,
|
|
833
|
+
kind: "headphone",
|
|
834
|
+
fromBack: 7.398
|
|
835
|
+
},
|
|
836
|
+
{
|
|
837
|
+
side: 1,
|
|
838
|
+
kind: "hdmi",
|
|
839
|
+
fromBack: 2.78
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
side: 1,
|
|
843
|
+
kind: "usb-c",
|
|
844
|
+
fromBack: 4.627
|
|
845
|
+
},
|
|
846
|
+
{
|
|
847
|
+
side: 1,
|
|
848
|
+
kind: "sd",
|
|
849
|
+
fromBack: 7.08
|
|
850
|
+
}
|
|
851
|
+
], $ = {
|
|
852
|
+
...Z,
|
|
853
|
+
id: "laptop.macbook-pro-14",
|
|
854
|
+
label: "MacBook Pro 14-inch",
|
|
855
|
+
width: 31.26,
|
|
856
|
+
depth: 22.12,
|
|
857
|
+
height: 1.55,
|
|
858
|
+
baseHeight: 1.113,
|
|
859
|
+
keyboard: {
|
|
860
|
+
fromBack: 1.98,
|
|
861
|
+
margin: .325
|
|
862
|
+
},
|
|
863
|
+
trackpad: {
|
|
864
|
+
width: 12.883,
|
|
865
|
+
depth: 8.044,
|
|
866
|
+
fromFront: .578,
|
|
867
|
+
radius: .525
|
|
868
|
+
},
|
|
869
|
+
scoop: {
|
|
870
|
+
width: 5.449,
|
|
871
|
+
depth: .25,
|
|
872
|
+
height: .389
|
|
873
|
+
},
|
|
874
|
+
grille: {
|
|
875
|
+
inner: 14.056,
|
|
876
|
+
outer: 15.45
|
|
877
|
+
},
|
|
878
|
+
hinge: {
|
|
879
|
+
width: 23.68,
|
|
880
|
+
depth: .463
|
|
881
|
+
},
|
|
882
|
+
lid: {
|
|
883
|
+
...Z.lid,
|
|
884
|
+
thickness: .392
|
|
885
|
+
},
|
|
886
|
+
display: {
|
|
887
|
+
px: [3024, 1964],
|
|
888
|
+
ppi: 254
|
|
889
|
+
},
|
|
890
|
+
ports: fe
|
|
891
|
+
}, pe = {
|
|
892
|
+
[$.id]: $,
|
|
893
|
+
[Q.id]: Q
|
|
894
|
+
}, me = /* @__PURE__ */ e({ laptop: () => he }), he = {
|
|
895
|
+
type: "laptop",
|
|
896
|
+
specs: pe,
|
|
897
|
+
finishes: ue,
|
|
898
|
+
build: re
|
|
899
|
+
};
|
|
900
|
+
export { me as t };
|