@playcanvas/supersplat-viewer 1.7.0 → 1.8.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/dist/index.js +3 -3
- package/package.json +13 -13
- package/public/index.css +14 -0
- package/public/index.html +47 -29
- package/public/index.js +11510 -6966
- package/public/index.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playcanvas/supersplat-viewer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"author": "PlayCanvas <support@playcanvas.com>",
|
|
5
5
|
"homepage": "https://github.com/playcanvas/supersplat-viewer#readme",
|
|
6
6
|
"description": "Viewer for https://superspl.at",
|
|
@@ -38,23 +38,23 @@
|
|
|
38
38
|
],
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@playcanvas/eslint-config": "2.1.0",
|
|
41
|
-
"@playcanvas/web-components": "0.2.
|
|
42
|
-
"@rollup/plugin-node-resolve": "16.0.
|
|
43
|
-
"@rollup/plugin-typescript": "12.
|
|
44
|
-
"@typescript-eslint/eslint-plugin": "8.46.
|
|
45
|
-
"@typescript-eslint/parser": "8.46.
|
|
46
|
-
"autoprefixer": "10.4.
|
|
41
|
+
"@playcanvas/web-components": "0.2.11",
|
|
42
|
+
"@rollup/plugin-node-resolve": "16.0.3",
|
|
43
|
+
"@rollup/plugin-typescript": "12.3.0",
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "8.46.4",
|
|
45
|
+
"@typescript-eslint/parser": "8.46.4",
|
|
46
|
+
"autoprefixer": "10.4.22",
|
|
47
47
|
"concurrently": "9.2.1",
|
|
48
|
-
"eslint": "9.
|
|
49
|
-
"globals": "16.
|
|
50
|
-
"playcanvas": "2.
|
|
48
|
+
"eslint": "9.39.1",
|
|
49
|
+
"globals": "16.5.0",
|
|
50
|
+
"playcanvas": "2.13.0",
|
|
51
51
|
"postcss": "8.5.6",
|
|
52
|
-
"publint": "0.3.
|
|
53
|
-
"rollup": "4.
|
|
52
|
+
"publint": "0.3.15",
|
|
53
|
+
"rollup": "4.53.2",
|
|
54
54
|
"rollup-plugin-copy": "3.5.0",
|
|
55
55
|
"rollup-plugin-scss": "4.0.1",
|
|
56
56
|
"rollup-plugin-string": "3.0.0",
|
|
57
|
-
"sass": "1.
|
|
57
|
+
"sass": "1.94.0",
|
|
58
58
|
"serve": "14.2.5",
|
|
59
59
|
"typescript": "5.9.3"
|
|
60
60
|
},
|
package/public/index.css
CHANGED
|
@@ -335,10 +335,24 @@ button {
|
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
#tooltip {
|
|
338
|
+
display: none;
|
|
338
339
|
position: absolute;
|
|
339
340
|
border-radius: 4px;
|
|
340
341
|
padding: 4px 4px;
|
|
341
342
|
font-size: 12px;
|
|
342
343
|
color: #E0DCDD;
|
|
343
344
|
background-color: #282828;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
#annotations {
|
|
348
|
+
position: fixed;
|
|
349
|
+
top: 0;
|
|
350
|
+
left: 0;
|
|
351
|
+
width: 100%;
|
|
352
|
+
height: 100%;
|
|
353
|
+
pointer-events: none;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
#annotations * {
|
|
357
|
+
pointer-events: auto;
|
|
344
358
|
}
|
package/public/index.html
CHANGED
|
@@ -7,37 +7,39 @@
|
|
|
7
7
|
<base href="">
|
|
8
8
|
<link rel="stylesheet" href="./index.css">
|
|
9
9
|
<script type="module">
|
|
10
|
-
const url = new URL(location.href);
|
|
11
|
-
const settingsUrl = url.searchParams.has('settings') ? url.searchParams.get('settings') : './settings.json';
|
|
12
|
-
const contentUrl = url.searchParams.has('content') ? url.searchParams.get('content') : './scene.compressed.ply';
|
|
13
|
-
const params = {};
|
|
14
|
-
|
|
15
|
-
// apply url parameter overrides
|
|
16
|
-
if (url.searchParams.has('noui')) params.noui = true;
|
|
17
|
-
if (url.searchParams.has('noanim')) params.noanim = true;
|
|
18
|
-
if (url.searchParams.has('poster')) params.posterUrl = url.searchParams.get('poster');
|
|
19
|
-
if (url.searchParams.has('skybox')) params.skyboxUrl = url.searchParams.get('skybox');
|
|
20
|
-
if (url.searchParams.has('ministats')) params.ministats = true;
|
|
21
|
-
|
|
22
10
|
const createImage = (url) => {
|
|
23
11
|
const img = new Image();
|
|
24
12
|
img.src = url;
|
|
25
13
|
return img;
|
|
26
14
|
};
|
|
27
15
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
const url = new URL(location.href);
|
|
17
|
+
|
|
18
|
+
const posterUrl = url.searchParams.get('poster');
|
|
19
|
+
const skyboxUrl = url.searchParams.get('skybox');
|
|
20
|
+
const settingsUrl = url.searchParams.has('settings') ? url.searchParams.get('settings') : './settings.json';
|
|
21
|
+
const contentUrl = url.searchParams.has('content') ? url.searchParams.get('content') : './scene.compressed.ply';
|
|
22
|
+
|
|
23
|
+
const sseConfig = {
|
|
24
|
+
poster: posterUrl && createImage(posterUrl),
|
|
25
|
+
skyboxUrl,
|
|
31
26
|
contentUrl,
|
|
32
27
|
contents: fetch(contentUrl),
|
|
33
|
-
|
|
28
|
+
noui: url.searchParams.has('noui'),
|
|
29
|
+
noanim: url.searchParams.has('noanim'),
|
|
30
|
+
ministats: url.searchParams.has('ministats'),
|
|
31
|
+
unified: url.searchParams.has('unified'),
|
|
32
|
+
aa: url.searchParams.has('aa')
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
window.sse = {
|
|
36
|
+
config: sseConfig,
|
|
37
|
+
settings: fetch(settingsUrl).then(response => response.json())
|
|
34
38
|
};
|
|
35
39
|
</script>
|
|
36
|
-
<script type="module" src="./index.js"></script>
|
|
37
40
|
</head>
|
|
38
41
|
<body>
|
|
39
|
-
|
|
40
|
-
<pc-app antialias="false" depth="false" high-resolution="true" stencil="false">
|
|
42
|
+
<pc-app antialias="false" depth="true" high-resolution="true" stencil="false">
|
|
41
43
|
<pc-scene>
|
|
42
44
|
<!-- Camera (with XR support) -->
|
|
43
45
|
<pc-entity name="camera root">
|
|
@@ -253,16 +255,6 @@
|
|
|
253
255
|
<!-- Tooltip -->
|
|
254
256
|
<div id="tooltip"></div>
|
|
255
257
|
</div>
|
|
256
|
-
<script type="module">
|
|
257
|
-
// Load the poster image if available
|
|
258
|
-
const poster = window.sse?.poster;
|
|
259
|
-
if (poster) {
|
|
260
|
-
const element = document.getElementById('poster');
|
|
261
|
-
element.style.backgroundImage = `url(${poster.src})`;
|
|
262
|
-
element.style.display = 'block';
|
|
263
|
-
element.style.filter = 'blur(40px)';
|
|
264
|
-
}
|
|
265
|
-
</script>
|
|
266
258
|
|
|
267
259
|
<!-- SVG Icons -->
|
|
268
260
|
<svg>
|
|
@@ -313,5 +305,31 @@
|
|
|
313
305
|
<path d="M16 2.09961C16.4971 2.09961 16.9004 2.50294 16.9004 3V7.09961H21C21.4971 7.09961 21.9004 7.50294 21.9004 8C21.9004 8.49706 21.4971 8.90039 21 8.90039H16C15.5029 8.90039 15.0996 8.49706 15.0996 8V3C15.0996 2.50294 15.5029 2.09961 16 2.09961Z" />
|
|
314
306
|
</symbol>
|
|
315
307
|
</svg>
|
|
308
|
+
|
|
309
|
+
<!-- Application Script -->
|
|
310
|
+
<script type="module">
|
|
311
|
+
import { main } from './index.js';
|
|
312
|
+
|
|
313
|
+
const { config, settings } = window.sse;
|
|
314
|
+
const { poster } = config;
|
|
315
|
+
|
|
316
|
+
// Show the poster image
|
|
317
|
+
if (poster) {
|
|
318
|
+
const element = document.getElementById('poster');
|
|
319
|
+
element.style.backgroundImage = `url(${poster.src})`;
|
|
320
|
+
element.style.display = 'block';
|
|
321
|
+
element.style.filter = 'blur(40px)';
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
document.addEventListener('DOMContentLoaded', async () => {
|
|
325
|
+
const [appElement, cameraElement, settingsJson] = await Promise.all([
|
|
326
|
+
document.querySelector('pc-app').ready(),
|
|
327
|
+
document.querySelector('pc-entity[name="camera"]').ready(),
|
|
328
|
+
settings
|
|
329
|
+
]);
|
|
330
|
+
|
|
331
|
+
const viewer = await main(appElement.app, cameraElement.entity, settingsJson, config);
|
|
332
|
+
});
|
|
333
|
+
</script>
|
|
316
334
|
</body>
|
|
317
335
|
</html>
|