@miris-inc/components 0.0.1
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/bus.ts +33 -0
- package/camera.ts +67 -0
- package/elements.ts +4 -0
- package/group.ts +12 -0
- package/index.html +11 -0
- package/index.ts +10 -0
- package/package.json +16 -0
- package/primitive.ts +202 -0
- package/scene.ts +127 -0
- package/stream.ts +217 -0
- package/test/carousel-multiple.html +386 -0
- package/test/carousel-single.html +494 -0
- package/test/controls.html +71 -0
- package/test/hero-test.html +99 -0
- package/test/index.html +29 -0
- package/test/sdk.html +10 -0
- package/vite.config.ts +32 -0
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>hero</title>
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
8
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
9
|
+
<link
|
|
10
|
+
href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap"
|
|
11
|
+
rel="stylesheet"
|
|
12
|
+
/>
|
|
13
|
+
<style>
|
|
14
|
+
body {
|
|
15
|
+
margin: 0;
|
|
16
|
+
background-color: black;
|
|
17
|
+
font-family:
|
|
18
|
+
Plus Jakarta Sans,
|
|
19
|
+
sans-serif;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.hero {
|
|
23
|
+
position: relative;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.hero-list {
|
|
27
|
+
--button-width: 192px;
|
|
28
|
+
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
display: flex;
|
|
31
|
+
grid-column-start: 7;
|
|
32
|
+
grid-column-end: 12;
|
|
33
|
+
list-style-type: none;
|
|
34
|
+
padding-inline-start: 0;
|
|
35
|
+
margin-block: 0;
|
|
36
|
+
justify-content: flex-start;
|
|
37
|
+
width: calc(2 * var(--button-width));
|
|
38
|
+
scroll-snap-type: inline mandatory;
|
|
39
|
+
overflow-x: auto;
|
|
40
|
+
padding-inline: calc(var(--button-width) / 2);
|
|
41
|
+
scrollbar-width: none;
|
|
42
|
+
/* scroll-behavior: smooth; */
|
|
43
|
+
mask-image: linear-gradient(
|
|
44
|
+
to right,
|
|
45
|
+
transparent,
|
|
46
|
+
black 64px,
|
|
47
|
+
black calc(100% - 64px),
|
|
48
|
+
transparent
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.hero-item {
|
|
53
|
+
scroll-snap-align: center;
|
|
54
|
+
display: block;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.hero-button {
|
|
58
|
+
text-transform: uppercase;
|
|
59
|
+
color: #9e9e9e;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
background-color: transparent;
|
|
62
|
+
border-style: none;
|
|
63
|
+
padding: 12px 16px;
|
|
64
|
+
width: var(--button-width);
|
|
65
|
+
|
|
66
|
+
&:hover {
|
|
67
|
+
color: #fff;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.hero-container {
|
|
72
|
+
position: relative;
|
|
73
|
+
display: grid;
|
|
74
|
+
max-width: 1536px;
|
|
75
|
+
margin-inline: auto;
|
|
76
|
+
padding-inline: 64px;
|
|
77
|
+
padding-block: 4rem;
|
|
78
|
+
grid-template-columns: repeat(12, minmax(0, 1fr));
|
|
79
|
+
align-items: center;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.hero-description {
|
|
83
|
+
color: #9e9e9e;
|
|
84
|
+
margin-block: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.hero-display {
|
|
88
|
+
grid-column-start: 6;
|
|
89
|
+
grid-column-end: 13;
|
|
90
|
+
place-items: center;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.hero-heading {
|
|
94
|
+
color: #fff;
|
|
95
|
+
font-size: 72px;
|
|
96
|
+
line-height: 94%;
|
|
97
|
+
margin-block: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.hero-links-anchor {
|
|
101
|
+
display: block;
|
|
102
|
+
text-transform: uppercase;
|
|
103
|
+
letter-spacing: 2px;
|
|
104
|
+
border-radius: 25px;
|
|
105
|
+
text-align: center;
|
|
106
|
+
padding: 16px 24px;
|
|
107
|
+
text-decoration: none;
|
|
108
|
+
font-size: 10px;
|
|
109
|
+
border-width: 1px;
|
|
110
|
+
border-style: solid;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.hero-links-anchor-primary {
|
|
114
|
+
color: #151515;
|
|
115
|
+
background-color: #fff;
|
|
116
|
+
border-color: transparent;
|
|
117
|
+
font-weight: 800;
|
|
118
|
+
|
|
119
|
+
&:hover {
|
|
120
|
+
background-color: #d7d8d2;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.hero-links-anchor-secondary {
|
|
125
|
+
border-color: #c2c3be;
|
|
126
|
+
color: #fff;
|
|
127
|
+
font-weight: 500;
|
|
128
|
+
|
|
129
|
+
&:hover {
|
|
130
|
+
background-color: #151515;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.hero-links-list {
|
|
135
|
+
display: flex;
|
|
136
|
+
column-gap: 1rem;
|
|
137
|
+
list-style-type: none;
|
|
138
|
+
padding-inline-start: 0;
|
|
139
|
+
margin-block: 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.hero-stream {
|
|
143
|
+
display: block;
|
|
144
|
+
width: 100%;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.hero-text {
|
|
148
|
+
display: grid;
|
|
149
|
+
grid-column-start: 1;
|
|
150
|
+
grid-column-end: 6;
|
|
151
|
+
grid-row-start: 1;
|
|
152
|
+
grid-row-end: 3;
|
|
153
|
+
row-gap: 24px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.hero-video {
|
|
157
|
+
position: absolute;
|
|
158
|
+
width: 100%;
|
|
159
|
+
height: 100%;
|
|
160
|
+
object-fit: cover;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.hero-scene {
|
|
164
|
+
aspect-ratio: 1;
|
|
165
|
+
}
|
|
166
|
+
</style>
|
|
167
|
+
<script type="module" src="/index.ts"></script>
|
|
168
|
+
<script type="module" lang="ts">
|
|
169
|
+
const items = [
|
|
170
|
+
{
|
|
171
|
+
uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/4ea303d2-d891-441c-987f-4dd06b18ad01/Structure.structure_files/structure.usda",
|
|
172
|
+
// offset: "-0.05, 0.15, -0.05",
|
|
173
|
+
text: "Miris Asset One",
|
|
174
|
+
// scale: 1,
|
|
175
|
+
scale: 0.25,
|
|
176
|
+
},
|
|
177
|
+
// {
|
|
178
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/e738fb2e-77b6-4f01-b043-225190110d26/Structure.structure_files/structure.usda",
|
|
179
|
+
// // offset: "0 0.55 0",
|
|
180
|
+
// text: "Miris Asset Two",
|
|
181
|
+
// // scale: 1,
|
|
182
|
+
// scale: 0.25,
|
|
183
|
+
// },
|
|
184
|
+
// {
|
|
185
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/202c55bc-a95f-45e4-a5d8-d20e708c5acd/Structure.structure_files/structure.usda",
|
|
186
|
+
// text: "Miris Asset Three",
|
|
187
|
+
// // scale: 1,
|
|
188
|
+
// scale: 0.01,
|
|
189
|
+
// },
|
|
190
|
+
{
|
|
191
|
+
uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/3538c5f8-8040-4129-b0bc-c88d38fc739e/Structure.structure_files/structure.usda",
|
|
192
|
+
text: "Miris Asset Four",
|
|
193
|
+
scale: 1,
|
|
194
|
+
},
|
|
195
|
+
// {
|
|
196
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/48587f88-fa59-4565-afed-89ca1d68f01e/Structure.structure_files/structure.usda",
|
|
197
|
+
// text: "Miris Asset Five",
|
|
198
|
+
// // scale: 0.1,
|
|
199
|
+
// scale: 1,
|
|
200
|
+
// },
|
|
201
|
+
// {
|
|
202
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/4ea303d2-d891-441c-987f-4dd06b18ad01/Structure.structure_files/structure.usda",
|
|
203
|
+
// // offset: "-0.05, 0.15, -0.05",
|
|
204
|
+
// text: "Miris Asset One",
|
|
205
|
+
// scale: 1, // 0.25,
|
|
206
|
+
// },
|
|
207
|
+
// {
|
|
208
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/e738fb2e-77b6-4f01-b043-225190110d26/Structure.structure_files/structure.usda",
|
|
209
|
+
// // offset: "0 0.55 0",
|
|
210
|
+
// text: "Miris Asset Two",
|
|
211
|
+
// scale: 1, // 0.25,
|
|
212
|
+
// },
|
|
213
|
+
// {
|
|
214
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/202c55bc-a95f-45e4-a5d8-d20e708c5acd/Structure.structure_files/structure.usda",
|
|
215
|
+
// text: "Miris Asset Three",
|
|
216
|
+
// // scale: 0.01,
|
|
217
|
+
// scale: 1,
|
|
218
|
+
// },
|
|
219
|
+
// {
|
|
220
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/dbb38d09-1e2d-43bc-aa68-00c149e9f81b/Structure.structure_files/structure.usda",
|
|
221
|
+
// text: "Miris Asset Four",
|
|
222
|
+
// scale: 1,
|
|
223
|
+
// },
|
|
224
|
+
// {
|
|
225
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/48587f88-fa59-4565-afed-89ca1d68f01e/Structure.structure_files/structure.usda",
|
|
226
|
+
// text: "Miris Asset Five",
|
|
227
|
+
// // scale: 0.1,
|
|
228
|
+
// scale: 1,
|
|
229
|
+
// },
|
|
230
|
+
// {
|
|
231
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/4ea303d2-d891-441c-987f-4dd06b18ad01/Structure.structure_files/structure.usda",
|
|
232
|
+
// // offset: "-0.05, 0.15, -0.05",
|
|
233
|
+
// text: "Miris Asset One",
|
|
234
|
+
// scale: 1, // 0.25,
|
|
235
|
+
// },
|
|
236
|
+
// {
|
|
237
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/e738fb2e-77b6-4f01-b043-225190110d26/Structure.structure_files/structure.usda",
|
|
238
|
+
// // offset: "0 0.55 0",
|
|
239
|
+
// text: "Miris Asset Two",
|
|
240
|
+
// scale: 1, // 0.25,
|
|
241
|
+
// },
|
|
242
|
+
// {
|
|
243
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/202c55bc-a95f-45e4-a5d8-d20e708c5acd/Structure.structure_files/structure.usda",
|
|
244
|
+
// text: "Miris Asset Three",
|
|
245
|
+
// // scale: 0.01,
|
|
246
|
+
// scale: 1,
|
|
247
|
+
// },
|
|
248
|
+
// {
|
|
249
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/dbb38d09-1e2d-43bc-aa68-00c149e9f81b/Structure.structure_files/structure.usda",
|
|
250
|
+
// text: "Miris Asset Four",
|
|
251
|
+
// scale: 1,
|
|
252
|
+
// },
|
|
253
|
+
// {
|
|
254
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/48587f88-fa59-4565-afed-89ca1d68f01e/Structure.structure_files/structure.usda",
|
|
255
|
+
// text: "Miris Asset Five",
|
|
256
|
+
// // scale: 0.1,
|
|
257
|
+
// scale: 1,
|
|
258
|
+
// },
|
|
259
|
+
// {
|
|
260
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/4ea303d2-d891-441c-987f-4dd06b18ad01/Structure.structure_files/structure.usda",
|
|
261
|
+
// // offset: "-0.05, 0.15, -0.05",
|
|
262
|
+
// text: "Miris Asset One",
|
|
263
|
+
// scale: 1, // 0.25,
|
|
264
|
+
// },
|
|
265
|
+
// {
|
|
266
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/e738fb2e-77b6-4f01-b043-225190110d26/Structure.structure_files/structure.usda",
|
|
267
|
+
// // offset: "0 0.55 0",
|
|
268
|
+
// text: "Miris Asset Two",
|
|
269
|
+
// scale: 1, // 0.25,
|
|
270
|
+
// },
|
|
271
|
+
// {
|
|
272
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/202c55bc-a95f-45e4-a5d8-d20e708c5acd/Structure.structure_files/structure.usda",
|
|
273
|
+
// text: "Miris Asset Three",
|
|
274
|
+
// // scale: 0.01,
|
|
275
|
+
// scale: 1,
|
|
276
|
+
// },
|
|
277
|
+
// {
|
|
278
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/dbb38d09-1e2d-43bc-aa68-00c149e9f81b/Structure.structure_files/structure.usda",
|
|
279
|
+
// text: "Miris Asset Four",
|
|
280
|
+
// scale: 1,
|
|
281
|
+
// },
|
|
282
|
+
// {
|
|
283
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/48587f88-fa59-4565-afed-89ca1d68f01e/Structure.structure_files/structure.usda",
|
|
284
|
+
// text: "Miris Asset Five",
|
|
285
|
+
// // scale: 0.1,
|
|
286
|
+
// scale: 1,
|
|
287
|
+
// },
|
|
288
|
+
// {
|
|
289
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/4ea303d2-d891-441c-987f-4dd06b18ad01/Structure.structure_files/structure.usda",
|
|
290
|
+
// // offset: "-0.05, 0.15, -0.05",
|
|
291
|
+
// text: "Miris Asset One",
|
|
292
|
+
// scale: 1, // 0.25,
|
|
293
|
+
// },
|
|
294
|
+
// {
|
|
295
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/e738fb2e-77b6-4f01-b043-225190110d26/Structure.structure_files/structure.usda",
|
|
296
|
+
// // offset: "0 0.55 0",
|
|
297
|
+
// text: "Miris Asset Two",
|
|
298
|
+
// scale: 1, // 0.25,
|
|
299
|
+
// },
|
|
300
|
+
// {
|
|
301
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/202c55bc-a95f-45e4-a5d8-d20e708c5acd/Structure.structure_files/structure.usda",
|
|
302
|
+
// text: "Miris Asset Three",
|
|
303
|
+
// // scale: 0.01,
|
|
304
|
+
// scale: 1,
|
|
305
|
+
// },
|
|
306
|
+
// {
|
|
307
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/dbb38d09-1e2d-43bc-aa68-00c149e9f81b/Structure.structure_files/structure.usda",
|
|
308
|
+
// text: "Miris Asset Four",
|
|
309
|
+
// scale: 1,
|
|
310
|
+
// },
|
|
311
|
+
// {
|
|
312
|
+
// uuid: "https://devcontents3.miris.com/app.miris.com/e49b58cb-6bbf-4f73-a9ec-bc8f89a30b7c/48587f88-fa59-4565-afed-89ca1d68f01e/Structure.structure_files/structure.usda",
|
|
313
|
+
// text: "Miris Asset Five",
|
|
314
|
+
// // scale: 0.1,
|
|
315
|
+
// scale: 1,
|
|
316
|
+
// },
|
|
317
|
+
];
|
|
318
|
+
const count = items.length;
|
|
319
|
+
const slots = 7;
|
|
320
|
+
const streams = [
|
|
321
|
+
{
|
|
322
|
+
scale: "1 1 1",
|
|
323
|
+
},
|
|
324
|
+
];
|
|
325
|
+
|
|
326
|
+
await customElements.whenDefined("miris-stream");
|
|
327
|
+
|
|
328
|
+
for (const hero of document.getElementsByClassName("hero")) {
|
|
329
|
+
break;
|
|
330
|
+
// const scene = hero.querySelector(".hero-scene");
|
|
331
|
+
// const stream = hero.querySelector(".hero-stream");
|
|
332
|
+
// const list = hero.querySelector(".hero-list");
|
|
333
|
+
// const assets = scene.fetchAssets();
|
|
334
|
+
|
|
335
|
+
// console.log(assets);
|
|
336
|
+
// const streams = [];
|
|
337
|
+
// const radius = 1 / (2 * Math.sin(Math.PI / slots));
|
|
338
|
+
|
|
339
|
+
items.forEach(({ uuid, text, scale }, index) => {
|
|
340
|
+
// calculate positions
|
|
341
|
+
// const angle = (index % slots) * ((2 * Math.PI) / slots);
|
|
342
|
+
// const pX = radius * Math.sin(angle);
|
|
343
|
+
// const pZ = radius * Math.cos(angle);
|
|
344
|
+
|
|
345
|
+
// create stream
|
|
346
|
+
// const stream = document.createElement("miris-stream");
|
|
347
|
+
// stream.disabled = true;
|
|
348
|
+
// stream.uuid = uuid;
|
|
349
|
+
// stream.position.set(pX, 0, pZ);
|
|
350
|
+
// stream.scale.set(scale, scale, scale);
|
|
351
|
+
// streams.push(stream);
|
|
352
|
+
// group.append(stream);
|
|
353
|
+
|
|
354
|
+
// create list item
|
|
355
|
+
const item = document.createElement("li");
|
|
356
|
+
item.className = "hero-item";
|
|
357
|
+
list.append(item);
|
|
358
|
+
|
|
359
|
+
// create button
|
|
360
|
+
const button = document.createElement("button");
|
|
361
|
+
button.className = "hero-button";
|
|
362
|
+
button.innerText = text;
|
|
363
|
+
button.addEventListener("click", () => button.scrollIntoView());
|
|
364
|
+
item.append(button);
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
let waiting = false;
|
|
368
|
+
const scroll = () => {
|
|
369
|
+
const { clientWidth: cwL, scrollLeft: slL, scrollWidth: swL } = list;
|
|
370
|
+
const cwB = swL / count;
|
|
371
|
+
|
|
372
|
+
// calculate rotation
|
|
373
|
+
// const rMaxProgress = 1 - 1 / count;
|
|
374
|
+
// const rProgress = rMaxProgress * (slL / (swL - cwL));
|
|
375
|
+
// const rRadians = rProgress * 2 * Math.PI;
|
|
376
|
+
// const rY = rRadians * (count / slots);
|
|
377
|
+
|
|
378
|
+
// determine active indices
|
|
379
|
+
const iProgress = (slL + cwB / 2) / (swL - cwL + cwB);
|
|
380
|
+
const iCurr = Math.floor(iProgress / (1 / count));
|
|
381
|
+
// const iPrev = iCurr - 1;
|
|
382
|
+
// const iNext = iCurr + 1;
|
|
383
|
+
|
|
384
|
+
const { uuid } = assets[iCurr];
|
|
385
|
+
|
|
386
|
+
if (uuid !== stream.uuid) stream.uuid = uuid;
|
|
387
|
+
|
|
388
|
+
waiting = false;
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
// let waiting = false;
|
|
392
|
+
// const scroll = () => {
|
|
393
|
+
// // take measurements
|
|
394
|
+
// const { clientWidth: cwL, scrollLeft: slL, scrollWidth: swL } = list;
|
|
395
|
+
// const cwB = swL / count;
|
|
396
|
+
|
|
397
|
+
// // calculate rotation
|
|
398
|
+
// const rMaxProgress = 1 - 1 / count;
|
|
399
|
+
// const rProgress = rMaxProgress * (slL / (swL - cwL));
|
|
400
|
+
// const rRadians = rProgress * 2 * Math.PI;
|
|
401
|
+
// const rY = rRadians * (count / slots);
|
|
402
|
+
|
|
403
|
+
// // determine active indices
|
|
404
|
+
// const iProgress = (slL + cwB / 2) / (swL - cwL + cwB);
|
|
405
|
+
// const iCurr = Math.floor(iProgress / (1 / count));
|
|
406
|
+
// const iPrev = iCurr - 1;
|
|
407
|
+
// const iNext = iCurr + 1;
|
|
408
|
+
|
|
409
|
+
// // update scene
|
|
410
|
+
// streams.forEach((stream, index) => {
|
|
411
|
+
// stream.disabled = ![iPrev, iCurr, iNext].includes(index);
|
|
412
|
+
// stream.rotation.y = rY;
|
|
413
|
+
// });
|
|
414
|
+
// group.rotation.y = -rY;
|
|
415
|
+
|
|
416
|
+
// // release hold
|
|
417
|
+
// waiting = false;
|
|
418
|
+
// };
|
|
419
|
+
|
|
420
|
+
list.addEventListener("scroll", () => {
|
|
421
|
+
if (!waiting) {
|
|
422
|
+
waiting = Boolean(requestAnimationFrame(scroll));
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
scroll();
|
|
426
|
+
}
|
|
427
|
+
</script>
|
|
428
|
+
</head>
|
|
429
|
+
<body>
|
|
430
|
+
<div class="hero">
|
|
431
|
+
<video
|
|
432
|
+
class="hero-video"
|
|
433
|
+
id="1e8a3c71-b459-55fb-1a54-917d4a449f95-video"
|
|
434
|
+
autoplay=""
|
|
435
|
+
loop=""
|
|
436
|
+
style="
|
|
437
|
+
background-image: url("https://cdn.prod.website-files.com/68ff68e9fd889fd60fe0a83c%2F69375e0ca776fc35337671c4_387094_Particles%20Water%20Light%20Water%20Particles_By_Kristian_Ozer_Kettner_Artlist_HD-2_poster.0000000.jpg");
|
|
438
|
+
"
|
|
439
|
+
muted=""
|
|
440
|
+
playsinline=""
|
|
441
|
+
data-wf-ignore="true"
|
|
442
|
+
data-object-fit="cover"
|
|
443
|
+
crossorigin
|
|
444
|
+
>
|
|
445
|
+
<source
|
|
446
|
+
src="https://cdn.prod.website-files.com/68ff68e9fd889fd60fe0a83c%2F69375e0ca776fc35337671c4_387094_Particles%20Water%20Light%20Water%20Particles_By_Kristian_Ozer_Kettner_Artlist_HD-2_mp4.mp4"
|
|
447
|
+
data-wf-ignore="true"
|
|
448
|
+
/>
|
|
449
|
+
<source
|
|
450
|
+
src="https://cdn.prod.website-files.com/68ff68e9fd889fd60fe0a83c%2F69375e0ca776fc35337671c4_387094_Particles%20Water%20Light%20Water%20Particles_By_Kristian_Ozer_Kettner_Artlist_HD-2_webm.webm"
|
|
451
|
+
data-wf-ignore="true"
|
|
452
|
+
/>
|
|
453
|
+
</video>
|
|
454
|
+
<div class="hero-container">
|
|
455
|
+
<div class="hero-text">
|
|
456
|
+
<h1 class="hero-heading">Stream 3D content without limits</h1>
|
|
457
|
+
<p class="hero-description">
|
|
458
|
+
AI-optimized streaming that delivers 3D content at billion-user
|
|
459
|
+
scale.
|
|
460
|
+
</p>
|
|
461
|
+
<ul class="hero-links-list">
|
|
462
|
+
<li class="hero-links-item">
|
|
463
|
+
<a
|
|
464
|
+
class="hero-links-anchor hero-links-anchor-primary"
|
|
465
|
+
href="/get-a-demo"
|
|
466
|
+
>
|
|
467
|
+
Get a demo
|
|
468
|
+
</a>
|
|
469
|
+
</li>
|
|
470
|
+
<li class="hero-links-item">
|
|
471
|
+
<a
|
|
472
|
+
class="hero-links-anchor hero-links-anchor-secondary"
|
|
473
|
+
href="/developers"
|
|
474
|
+
>
|
|
475
|
+
For developers
|
|
476
|
+
</a>
|
|
477
|
+
</li>
|
|
478
|
+
</ul>
|
|
479
|
+
</div>
|
|
480
|
+
<div class="hero-display">
|
|
481
|
+
<!-- <miris-scene class="hero-scene"> -->
|
|
482
|
+
<!-- uuid="8c55a389-b157-43f8-b15a-59708d74f77e" -->
|
|
483
|
+
<!-- </miris-scene> -->
|
|
484
|
+
<miris-stream
|
|
485
|
+
key="ieTaiFfwO03ONh94XzZQELRb1SVlNddiOHLaf7lslls"
|
|
486
|
+
uuid="82c0d8ac-993f-44b6-b472-7b45e433b96c"
|
|
487
|
+
class="hero-stream"
|
|
488
|
+
></miris-stream>
|
|
489
|
+
<ul class="hero-list"></ul>
|
|
490
|
+
</div>
|
|
491
|
+
</div>
|
|
492
|
+
</div>
|
|
493
|
+
</body>
|
|
494
|
+
</html>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
3
|
+
<title>Document</title>
|
|
4
|
+
<style>
|
|
5
|
+
body {
|
|
6
|
+
margin: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
canvas {
|
|
10
|
+
width: 100vw;
|
|
11
|
+
height: 100vh;
|
|
12
|
+
background-color: black;
|
|
13
|
+
}
|
|
14
|
+
</style>
|
|
15
|
+
<script type="module" src="/index.ts"></script>
|
|
16
|
+
<script type="module">
|
|
17
|
+
import { MirisScene as ThreeScene, MirisStream } from "@miris-inc/three";
|
|
18
|
+
import {
|
|
19
|
+
MOUSE,
|
|
20
|
+
PerspectiveCamera as ThreeCamera,
|
|
21
|
+
WebGLRenderer as ThreeRenderer,
|
|
22
|
+
BoxGeometry,
|
|
23
|
+
Mesh,
|
|
24
|
+
MeshBasicMaterial,
|
|
25
|
+
Raycaster,
|
|
26
|
+
Vector2,
|
|
27
|
+
Vector3,
|
|
28
|
+
Quaternion,
|
|
29
|
+
} from "three";
|
|
30
|
+
import { DragControls } from "three/addons/controls/DragControls.js";
|
|
31
|
+
import { ArcballControls } from "three/addons/controls/ArcballControls.js";
|
|
32
|
+
|
|
33
|
+
const camera = new ThreeCamera();
|
|
34
|
+
camera.position.z = 4; // give ArcballControls a non-zero radius before initialization
|
|
35
|
+
const renderer = new ThreeRenderer({ alpha: true });
|
|
36
|
+
const scene = new ThreeScene("ieTaiFfwO03ONh94XzZQELRb1SVlNddiOHLaf7lslls");
|
|
37
|
+
const controls = new ArcballControls(camera, renderer.domElement, scene);
|
|
38
|
+
const stream = new MirisStream("ad3869cd-4380-4ce6-adcc-3be9835af002");
|
|
39
|
+
const observer = new ResizeObserver((entries) => {
|
|
40
|
+
const entry = entries[entries.length - 1];
|
|
41
|
+
const width = entry.contentBoxSize[0].inlineSize;
|
|
42
|
+
const height = entry.contentBoxSize[0].blockSize;
|
|
43
|
+
|
|
44
|
+
renderer.setPixelRatio(devicePixelRatio);
|
|
45
|
+
renderer.setSize(width, height, false);
|
|
46
|
+
|
|
47
|
+
camera.aspect = width / height;
|
|
48
|
+
camera.updateProjectionMatrix();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
console.log(camera);
|
|
52
|
+
|
|
53
|
+
scene.add(camera);
|
|
54
|
+
const scale = 0.05;
|
|
55
|
+
// stream.position.z = -3;
|
|
56
|
+
stream.scale.set(scale, scale, scale);
|
|
57
|
+
scene.add(stream);
|
|
58
|
+
|
|
59
|
+
controls.activateGizmos(true);
|
|
60
|
+
|
|
61
|
+
// setTimeout(() => {
|
|
62
|
+
// // controls.target.set(0, 0, -3);
|
|
63
|
+
// controls.setCamera(camera); // recompute internal state for the new target/distance
|
|
64
|
+
// }, 1000);
|
|
65
|
+
|
|
66
|
+
document.body.append(renderer.domElement);
|
|
67
|
+
observer.observe(renderer.domElement);
|
|
68
|
+
renderer.setAnimationLoop(() => {
|
|
69
|
+
renderer.render(scene, camera);
|
|
70
|
+
});
|
|
71
|
+
</script>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Document</title>
|
|
7
|
+
<link
|
|
8
|
+
rel="stylesheet"
|
|
9
|
+
href="https://www.miris.com/miris-supporting-js-files/index-DgK9rQgv.css"
|
|
10
|
+
/>
|
|
11
|
+
<script
|
|
12
|
+
type="module"
|
|
13
|
+
src="https://www.miris.com/miris-supporting-js-files/index-Zo5EryY7.js"
|
|
14
|
+
></script>
|
|
15
|
+
</head>
|
|
16
|
+
<body>
|
|
17
|
+
<div class="hero">
|
|
18
|
+
<video
|
|
19
|
+
class="hero-video"
|
|
20
|
+
id="1e8a3c71-b459-55fb-1a54-917d4a449f95-video"
|
|
21
|
+
autoplay=""
|
|
22
|
+
loop=""
|
|
23
|
+
style="
|
|
24
|
+
background-image: url("https://cdn.prod.website-files.com/68ff68e9fd889fd60fe0a83c%2F69375e0ca776fc35337671c4_387094_Particles%20Water%20Light%20Water%20Particles_By_Kristian_Ozer_Kettner_Artlist_HD-2_poster.0000000.jpg");
|
|
25
|
+
"
|
|
26
|
+
muted=""
|
|
27
|
+
playsinline=""
|
|
28
|
+
data-wf-ignore="true"
|
|
29
|
+
data-object-fit="cover"
|
|
30
|
+
crossorigin
|
|
31
|
+
>
|
|
32
|
+
<source
|
|
33
|
+
src="https://cdn.prod.website-files.com/68ff68e9fd889fd60fe0a83c%2F69375e0ca776fc35337671c4_387094_Particles%20Water%20Light%20Water%20Particles_By_Kristian_Ozer_Kettner_Artlist_HD-2_mp4.mp4"
|
|
34
|
+
data-wf-ignore="true"
|
|
35
|
+
/>
|
|
36
|
+
<source
|
|
37
|
+
src="https://cdn.prod.website-files.com/68ff68e9fd889fd60fe0a83c%2F69375e0ca776fc35337671c4_387094_Particles%20Water%20Light%20Water%20Particles_By_Kristian_Ozer_Kettner_Artlist_HD-2_webm.webm"
|
|
38
|
+
data-wf-ignore="true"
|
|
39
|
+
/>
|
|
40
|
+
</video>
|
|
41
|
+
<div class="hero-container">
|
|
42
|
+
<div class="hero-text">
|
|
43
|
+
<h1 class="hero-heading">Stream 3D content without limits</h1>
|
|
44
|
+
<p class="hero-description">
|
|
45
|
+
AI-optimized streaming that delivers 3D content at billion-user
|
|
46
|
+
scale.
|
|
47
|
+
</p>
|
|
48
|
+
<ul class="hero-links-list">
|
|
49
|
+
<li class="hero-links-item">
|
|
50
|
+
<a
|
|
51
|
+
class="hero-links-anchor hero-links-anchor-primary"
|
|
52
|
+
href="/get-a-demo"
|
|
53
|
+
>Get a demo</a
|
|
54
|
+
>
|
|
55
|
+
</li>
|
|
56
|
+
<li class="hero-links-item">
|
|
57
|
+
<a
|
|
58
|
+
class="hero-links-anchor hero-links-anchor-secondary"
|
|
59
|
+
href="/developers"
|
|
60
|
+
>For developers</a
|
|
61
|
+
>
|
|
62
|
+
</li>
|
|
63
|
+
</ul>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="hero-wrapper">
|
|
66
|
+
<div class="hero-display">
|
|
67
|
+
<div class="hero-mask">
|
|
68
|
+
<miris-scene
|
|
69
|
+
key="ieTaiFfwO03ONh94XzZQELRb1SVlNddiOHLaf7lslls"
|
|
70
|
+
class="hero-scene"
|
|
71
|
+
>
|
|
72
|
+
<miris-group position="0 0 -3" class="hero-group"></miris-group>
|
|
73
|
+
</miris-scene>
|
|
74
|
+
<ul class="hero-pagination-list"></ul>
|
|
75
|
+
</div>
|
|
76
|
+
<button class="hero-nav hero-nav-prev">
|
|
77
|
+
<svg viewBox="0 0 24 24">
|
|
78
|
+
<path
|
|
79
|
+
fill-rule="evenodd"
|
|
80
|
+
d="M7.72 12.53a.75.75 0 0 1 0-1.06l7.5-7.5a.75.75 0 1 1 1.06 1.06L9.31 12l6.97 6.97a.75.75 0 1 1-1.06 1.06l-7.5-7.5Z"
|
|
81
|
+
clip-rule="evenodd"
|
|
82
|
+
/>
|
|
83
|
+
</svg>
|
|
84
|
+
</button>
|
|
85
|
+
<button class="hero-nav hero-nav-next">
|
|
86
|
+
<svg viewBox="0 0 24 24">
|
|
87
|
+
<path
|
|
88
|
+
fill-rule="evenodd"
|
|
89
|
+
d="M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z"
|
|
90
|
+
clip-rule="evenodd"
|
|
91
|
+
/>
|
|
92
|
+
</svg>
|
|
93
|
+
</button>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</body>
|
|
99
|
+
</html>
|
package/test/index.html
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
5
|
+
<title>Miris Components</title>
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
margin: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
miris-scene,
|
|
12
|
+
miris-stream {
|
|
13
|
+
width: 100vw;
|
|
14
|
+
height: 100vh;
|
|
15
|
+
background-color: black;
|
|
16
|
+
}
|
|
17
|
+
</style>
|
|
18
|
+
<script type="module" src="/index.ts"></script>
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
<miris-stream
|
|
22
|
+
key="l2LWVHS39ZhmXDOtefPoOmvPdAp55OxTPJfwVmNo7rY"
|
|
23
|
+
uuid="9a3d3f7e-e744-4d29-8243-8c4cdf938644"
|
|
24
|
+
position="0 -0.25 -5"
|
|
25
|
+
rotation="0 -1.75 0"
|
|
26
|
+
controls
|
|
27
|
+
></miris-stream>
|
|
28
|
+
</body>
|
|
29
|
+
</html>
|