@playcanvas/supersplat-viewer 1.5.0 → 1.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playcanvas/supersplat-viewer",
3
- "version": "1.5.0",
3
+ "version": "1.6.1",
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",
@@ -43,22 +43,26 @@
43
43
  "@rollup/plugin-typescript": "^12.1.4",
44
44
  "@typescript-eslint/eslint-plugin": "^8.44.0",
45
45
  "@typescript-eslint/parser": "^8.44.0",
46
+ "autoprefixer": "^10.4.21",
46
47
  "concurrently": "^9.2.1",
47
48
  "eslint": "^9.35.0",
48
49
  "globals": "^16.4.0",
49
50
  "playcanvas": "^2.11.8",
51
+ "postcss": "^8.5.6",
50
52
  "publint": "^0.3.12",
51
53
  "rollup": "^4.50.2",
52
54
  "rollup-plugin-copy": "^3.5.0",
55
+ "rollup-plugin-scss": "^4.0.1",
53
56
  "rollup-plugin-string": "^3.0.0",
57
+ "sass": "^1.93.2",
54
58
  "serve": "^14.2.5",
55
59
  "typescript": "^5.9.2"
56
60
  },
57
61
  "scripts": {
58
62
  "build": "rollup -c",
59
63
  "develop": "concurrently --kill-others \"npm run watch\" \"npm run serve\"",
60
- "lint": "eslint src module rollup.config.mjs eslint.config.mjs",
61
- "lint:fix": "eslint src module rollup.config.mjs eslint.config.mjs --fix",
64
+ "lint": "eslint src rollup.config.mjs eslint.config.mjs",
65
+ "lint:fix": "eslint src rollup.config.mjs eslint.config.mjs --fix",
62
66
  "publint": "publint",
63
67
  "serve": "serve public -C",
64
68
  "test": "echo \"Error: no test specified\" && exit 1",
package/public/index.css CHANGED
@@ -1,336 +1,344 @@
1
1
  * {
2
- margin: 0;
3
- padding: 0;
4
- touch-action: none;
2
+ margin: 0;
3
+ padding: 0;
4
+ touch-action: none;
5
5
  }
6
+
6
7
  body {
7
- overflow: hidden;
8
- font-family: 'Arial', sans-serif;
9
- user-select: none;
10
- -webkit-user-select: none;
11
- -webkit-touch-callout: none;
8
+ overflow: hidden;
9
+ font-family: "Arial", sans-serif;
10
+ -moz-user-select: none;
11
+ user-select: none;
12
+ -webkit-user-select: none;
13
+ -webkit-touch-callout: none;
12
14
  }
15
+
16
+ button {
17
+ -webkit-appearance: none;
18
+ -moz-appearance: none;
19
+ appearance: none;
20
+ }
21
+
13
22
  .hidden {
14
- display: none !important;
23
+ display: none !important;
15
24
  }
25
+
26
+ .spacer {
27
+ flex-grow: 1;
28
+ }
29
+
16
30
  #ui {
17
- position: fixed;
18
- top: 0;
19
- left: 0;
20
- width: 100%;
21
- height: 100%;
22
- pointer-events: none;
31
+ position: fixed;
32
+ top: 0;
33
+ left: 0;
34
+ width: 100%;
35
+ height: 100%;
36
+ pointer-events: none;
23
37
  }
38
+
24
39
  #ui * {
25
- pointer-events: auto;
40
+ pointer-events: auto;
26
41
  }
27
- #infoPanel {
28
- position: fixed;
29
- top: 0;
30
- left: 0;
31
- width: 100%;
32
- height: 100%;
33
- background-color: rgba(0, 0, 0, 0.3);
34
- }
35
- #infoPanel > #infoPanelContent {
36
- position: absolute;
37
- top: 40px;
38
- left: 50%;
39
- transform: translate(-50%, 0);
40
- min-height: 280px;
41
- min-width: 320px;
42
- padding: 8px;
43
- border-radius: 24px;
44
- color: black;
45
- background-color: #eeed;
46
- display: flex;
47
- flex-direction: column;
48
- }
49
- #infoPanel > #infoPanelContent > #header {
50
- font-size: 24px;
51
- font-weight: bold;
52
- padding-bottom: 16px;
53
- color: #444;
54
- display: none;
55
- }
56
- #infoPanel > #infoPanelContent > #tabs {
57
- display: flex;
58
- gap: 16px;
59
- background-color: #666;
60
- padding: 8px;
61
- border-radius: 22px;
62
- }
63
- #infoPanel > #infoPanelContent > #tabs > .tab {
64
- padding: 8px;
65
- border-radius: 16px;
66
- cursor: pointer;
67
- flex-grow: 1;
68
- text-align: center;
69
- font-weight: bold;
70
- font-size: 14px;
71
- color: #222;
72
- transition: background-color 250ms ease;
73
- }
74
- #infoPanel > #infoPanelContent > #tabs > .tab:hover {
75
- background-color: #eee;
76
- }
77
- #infoPanel > #infoPanelContent > #tabs > .tab.active {
78
- background-color: #eee;
79
- }
80
- #infoPanel > #infoPanelContent > #infoPanels {
81
- padding: 16px;
82
- }
83
- #infoPanel > #infoPanelContent .control-item {
84
- display: flex;
85
- justify-content: space-between;
86
- gap: 32px;
87
- line-height: 1.5;
88
- }
89
- #infoPanel > #infoPanelContent > #infoPanels h1 {
90
- font-size: 14px;
91
- font-weight: bold;
92
- padding: 0 0 6px 0;
93
- }
94
- #infoPanel > #infoPanelContent .control-item > .control-action {
95
- text-align: left;
96
- color: #333;
97
- }
98
- #infoPanel > #infoPanelContent .control-item > .control-key {
99
- text-align: right;
100
- color: #666;
101
- }
102
- #infoPanel > #infoPanelContent .control-spacer {
103
- border-bottom: 1px dashed #666;
104
- margin: 10px 0;
42
+
43
+ /* poster */
44
+ #poster {
45
+ display: none;
46
+ position: absolute;
47
+ top: 0;
48
+ left: 0;
49
+ width: 100%;
50
+ height: 100%;
51
+ background-size: cover;
52
+ background-position: center;
53
+ background-repeat: no-repeat;
105
54
  }
106
55
 
107
56
  /* loadingWrap */
108
-
109
57
  #loadingWrap {
110
- position: fixed;
111
- bottom: 120px;
112
- left: 50%;
113
- transform: translate(-50%, 0);
114
- width: 380px;
115
-
116
- display: flex;
117
- flex-direction: column;
118
-
119
- padding: 16px;
58
+ position: fixed;
59
+ bottom: 120px;
60
+ left: 50%;
61
+ transform: translate(-50%, 0);
62
+ width: 380px;
63
+ display: flex;
64
+ flex-direction: column;
65
+ padding: 16px;
120
66
  }
121
67
  #loadingWrap > #loadingText {
122
- font-size: 18px;
123
- color: white;
124
- text-align: center;
125
- text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
68
+ font-size: 18px;
69
+ color: #fff;
70
+ text-align: center;
71
+ text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
126
72
  }
127
73
  #loadingWrap > #loadingBar {
128
- width: 100%;
129
- height: 10px;
130
- margin-top: 8px;
131
- border-radius: 4px;
132
- overflow: hidden;
74
+ width: 100%;
75
+ height: 10px;
76
+ margin-top: 8px;
77
+ border-radius: 4px;
78
+ overflow: hidden;
133
79
  }
134
80
 
135
81
  /* controlsWrap */
136
-
137
82
  #controlsWrap {
138
- position: absolute;
139
- left: max(16px, env(safe-area-inset-left));
140
- right: max(16px, env(safe-area-inset-right));
141
- bottom: max(16px, env(safe-area-inset-bottom));
142
-
143
- display: flex;
144
- flex-direction: column;
83
+ position: absolute;
84
+ left: max(16px, env(safe-area-inset-left));
85
+ right: max(16px, env(safe-area-inset-right));
86
+ bottom: max(16px, env(safe-area-inset-bottom));
87
+ display: flex;
88
+ flex-direction: column;
145
89
  }
146
-
147
90
  #controlsWrap.faded-in {
148
- visibility: visible;
149
- opacity: 1;
150
- transition: opacity 0.5s ease-out;
91
+ visibility: visible;
92
+ opacity: 1;
93
+ transition: opacity 0.5s ease-out;
151
94
  }
152
95
  #controlsWrap.faded-out {
153
- visibility: hidden;
154
- opacity: 0;
155
- transition: visibility 0s 0.5s, opacity 0.5s ease-out;
96
+ visibility: hidden;
97
+ opacity: 0;
98
+ transition: visibility 0s 0.5s, opacity 0.5s ease-out;
156
99
  }
157
-
158
100
  #controlsWrap > #timelineContainer {
159
- height: 30px;
160
- cursor: pointer;
101
+ height: 30px;
102
+ cursor: pointer;
161
103
  }
162
104
  #controlsWrap > #timelineContainer > #line {
163
- width: 100%;
164
- height: 50%;
165
- border-bottom: 1px solid #8888;
105
+ width: 100%;
106
+ height: 50%;
107
+ border-bottom: 4px solid #d9d9d9;
166
108
  }
167
109
  #controlsWrap > #timelineContainer > #handle {
168
- position: absolute;
169
- top: 15.5px;
170
- width: 10px;
171
- height: 10px;
172
- transform: translate(-50%, -50%);
173
- border: 1px solid black;
174
- border-radius: 50%;
175
- background-color: #fff8;
110
+ position: absolute;
111
+ top: 16.5px;
112
+ width: 12px;
113
+ height: 12px;
114
+ transform: translate(-50%, -50%);
115
+ border: 2px solid #d9d9d9;
116
+ border-radius: 50%;
117
+ background-color: #FFAF50;
176
118
  }
177
119
  #controlsWrap > #timelineContainer > #time {
178
- position: absolute;
179
- top: 0;
180
- padding: 2px 4px;
181
- transform: translate(-50%, -100%);
182
- font-size: 12px;
183
- color: white;
184
- background-color: rgba(0, 0, 0, 0.5);
185
- border-radius: 4px;
186
- }
187
- #controlsWrap > #buttonContainer {
188
- display: flex;
189
- gap: 8px;
190
- }
191
-
192
- /* spacer */
193
-
194
- .spacer {
195
- flex-grow: 1;
120
+ position: absolute;
121
+ top: 0;
122
+ padding: 2px 4px;
123
+ transform: translate(-50%, -100%);
124
+ font-size: 12px;
125
+ border-radius: 4px;
126
+ color: #fff;
127
+ background-color: rgba(40, 40, 40, 0.5);
128
+ }
129
+ #controlsWrap > #buttonsContainer {
130
+ display: flex;
131
+ gap: 8px;
132
+ /* controlButton */
133
+ }
134
+ #controlsWrap > #buttonsContainer .controlButton {
135
+ width: 40px;
136
+ height: 40px;
137
+ padding: 0;
138
+ margin: 0;
139
+ border: 0;
140
+ cursor: pointer;
141
+ color: #E0DCDD;
142
+ background-color: transparent;
143
+ }
144
+ #controlsWrap > #buttonsContainer .controlButton:hover {
145
+ color: #fff;
146
+ }
147
+ #controlsWrap > #buttonsContainer .controlButton {
148
+ /* icon styling */
149
+ }
150
+ #controlsWrap > #buttonsContainer .controlButton > svg {
151
+ display: block;
152
+ margin: auto;
153
+ }
154
+ #controlsWrap > #buttonsContainer .controlButton > svg > g.stroke {
155
+ fill: none;
156
+ stroke: black;
157
+ stroke-width: 2;
158
+ stroke-linejoin: round;
159
+ opacity: 0.4;
160
+ }
161
+ #controlsWrap > #buttonsContainer .controlButton > svg > g.fill {
162
+ fill: currentColor;
163
+ stroke: none;
164
+ }
165
+ #controlsWrap > #buttonsContainer .controlButton {
166
+ /* camera toggle styling */
167
+ }
168
+ #controlsWrap > #buttonsContainer .controlButton.toggle {
169
+ background: linear-gradient(90deg, transparent 0%, transparent 50%, #F60 50%, #F60 100%);
170
+ background-size: 200% 100%;
171
+ background-position: 100% 0%;
172
+ background-repeat: no-repeat;
173
+ transition: background-position 0.1s ease-in-out;
174
+ }
175
+ #controlsWrap > #buttonsContainer .controlButton.toggle.left {
176
+ margin-right: -4px;
177
+ border-radius: 4px 0px 0px 4px;
178
+ }
179
+ #controlsWrap > #buttonsContainer .controlButton.toggle.left:not(.active) {
180
+ background-position: 0% 0%;
181
+ }
182
+ #controlsWrap > #buttonsContainer .controlButton.toggle.right {
183
+ margin-left: -4px;
184
+ margin-right: 20px;
185
+ border-radius: 0px 4px 4px 0px;
186
+ }
187
+ #controlsWrap > #buttonsContainer .controlButton.toggle.right:not(.active) {
188
+ background-position: 200% 0%;
196
189
  }
197
190
 
198
191
  /* settingsPanel */
199
-
200
192
  #settingsPanel {
201
- position: fixed;
202
- right: max(16px, env(safe-area-inset-right));
203
- bottom: calc(max(16px, env(safe-area-inset-bottom)) + 70px);
204
- padding: 10px;
205
- color: #eee;
206
- background-color: rgba(0, 0, 0, 0.3);
207
- border-radius: 8px;
208
-
209
- display: flex;
210
- flex-direction: column;
211
- align-items: flex-end;
212
- gap: 4px;
213
-
214
- font-size: 14px;
193
+ position: fixed;
194
+ right: max(16px, env(safe-area-inset-right));
195
+ bottom: calc(max(16px, env(safe-area-inset-bottom)) + 70px);
196
+ padding: 10px;
197
+ border-radius: 8px;
198
+ display: flex;
199
+ flex-direction: column;
200
+ align-items: flex-end;
201
+ gap: 4px;
202
+ font-size: 14px;
203
+ color: #E0DCDD;
204
+ background-color: #333;
215
205
  }
216
206
  #settingsPanel > .settingsRow {
217
- display: flex;
218
- gap: 4px;
219
- width: 100%;
220
-
207
+ display: flex;
208
+ gap: 4px;
209
+ width: 100%;
221
210
  }
222
- #settingsPanel > .settingsRow > .button {
223
- padding: 10px 0px;
224
- flex-grow: 1;
211
+ #settingsPanel > .settingsRow > button {
212
+ flex-grow: 1;
213
+ padding: 10px 20px;
214
+ border: 0;
215
+ cursor: pointer;
216
+ color: #E0DCDD;
217
+ background-color: #141414;
225
218
  }
226
-
227
- /* toggleWrap */
228
-
229
- .toggleWrap {
230
- position: relative;
231
- background-color: #dddd;
232
- border: 1px solid #888;
233
- border-radius: 8px;
234
- height: 40px;
235
- width: 120px;
236
- }
237
- .toggleWrap > .toggleHighlight {
238
- position: absolute;
239
- left: 0;
240
- width: 50%;
241
- height: 100%;
242
- background-color: #eee;
243
- border-radius: 8px;
244
- transition: left 0.1s ease-out;
245
- }
246
- .toggleWrap > .toggleHighlight.right {
247
- left: 60px;
248
- }
249
- .toggleWrap > button {
250
- position: absolute;
251
- width: 60px;
252
- height: 100%;
253
- border: 0;
254
- border-radius: 8px;
255
-
256
- cursor: pointer;
257
- font-size: 14px;
258
- letter-spacing: -0.25px;
259
-
260
- color: #222;
261
- background-color: transparent;
262
-
263
- appearance: none;
219
+ #settingsPanel > .settingsRow > button:hover {
220
+ color: #fff;
264
221
  }
265
- .toggleWrap > button:hover {
266
- color: black;
222
+ #settingsPanel > .settingsRow > div {
223
+ padding: 8px;
224
+ cursor: pointer;
225
+ color: #AAA;
267
226
  }
268
- .toggleWrap > button.left {
269
- left: 0;
227
+ #settingsPanel > .settingsRow > div.checkMark {
228
+ width: 16px;
270
229
  }
271
- .toggleWrap > button.right {
272
- right: 0;
230
+ #settingsPanel > .settingsRow > div.checkMark:not(.active) {
231
+ color: #333;
232
+ }
233
+ #settingsPanel > .settingsRow > div:hover {
234
+ color: #E0DCDD;
235
+ }
236
+ #settingsPanel > .divider {
237
+ width: 100%;
238
+ height: 1px;
239
+ margin: 8px 0;
240
+ background-color: #666;
273
241
  }
274
242
 
275
- /* button */
276
- .button {
277
- width: 40px;
278
- height: 40px;
279
- padding: 0;
280
- margin: 0;
281
- color: #222;
282
- background-color: #dddd;
283
- border: 1px solid #888;
284
- border-radius: 8px;
285
- cursor: pointer;
286
-
287
- /* font-weight: bold; */
288
- font-size: 14px;
289
- letter-spacing: -0.25px;
243
+ /* infoPanel */
244
+ #infoPanel {
245
+ position: fixed;
246
+ top: 0;
247
+ left: 0;
248
+ width: 100%;
249
+ height: 100%;
250
+ background-color: rgba(0, 0, 0, 0.4);
251
+ backdrop-filter: blur(2px);
252
+ }
253
+ #infoPanel > #infoPanelContent {
254
+ position: absolute;
255
+ top: 40px;
256
+ left: 50%;
257
+ transform: translate(-50%, 0);
258
+ min-height: 280px;
259
+ min-width: 320px;
260
+ padding: 8px;
261
+ border-radius: 24px;
262
+ display: flex;
263
+ flex-direction: column;
264
+ color: #E0DCDD;
265
+ background-color: rgba(51, 51, 51, 0.8);
290
266
  }
291
- .button:hover {
292
- background-color: #eee;
267
+ #infoPanel > #infoPanelContent > #tabs {
268
+ display: flex;
269
+ gap: 16px;
270
+ padding: 8px;
271
+ border-radius: 22px;
272
+ background-color: #282828;
293
273
  }
294
- .button > svg {
295
- display: block;
296
- margin: auto;
274
+ #infoPanel > #infoPanelContent > #tabs > .tab {
275
+ padding: 8px;
276
+ border-radius: 16px;
277
+ cursor: pointer;
278
+ flex-grow: 1;
279
+ text-align: center;
280
+ font-weight: bold;
281
+ font-size: 14px;
282
+ color: #E0DCDD;
283
+ transition: background-color 250ms ease;
297
284
  }
298
- #poster {
299
- display: none;
300
- position: absolute;
301
- top: 0;
302
- left: 0;
303
- width: 100%;
304
- height: 100%;
305
- background-size: cover;
306
- background-position: center;
307
- background-repeat: no-repeat;
285
+ #infoPanel > #infoPanelContent > #tabs > .tab:hover {
286
+ background-color: #444;
308
287
  }
309
- button {
310
- color: #222;
288
+ #infoPanel > #infoPanelContent > #tabs > .tab.active {
289
+ background-color: #444;
311
290
  }
312
- button:active {
313
- outline: none;
291
+ #infoPanel > #infoPanelContent > #infoPanels {
292
+ padding: 16px;
314
293
  }
315
- #joystickBase {
316
- position: absolute;
317
- width: 96px;
318
- height: 96px;
319
- transform: translate(-50%, -50%);
320
- border-radius: 50%;
321
- touch-action: none;
322
-
323
- background: radial-gradient(circle at center, #0000 50%, #000f 100%);
324
- background-color: #0002;
294
+ #infoPanel > #infoPanelContent > #infoPanels h1 {
295
+ font-size: 14px;
296
+ font-weight: bold;
297
+ padding: 0 0 6px 0;
298
+ color: #fff;
299
+ }
300
+ #infoPanel > #infoPanelContent > #infoPanels .control-item {
301
+ display: flex;
302
+ justify-content: space-between;
303
+ gap: 32px;
304
+ line-height: 1.5;
305
+ }
306
+ #infoPanel > #infoPanelContent > #infoPanels .control-item > .control-action {
307
+ text-align: left;
308
+ }
309
+ #infoPanel > #infoPanelContent > #infoPanels .control-item > .control-key {
310
+ text-align: right;
311
+ }
312
+ #infoPanel > #infoPanelContent > #infoPanels .control-spacer {
313
+ border-bottom: 1px dashed #666;
314
+ margin: 10px 0;
325
315
  }
326
316
 
317
+ #joystickBase {
318
+ position: absolute;
319
+ width: 96px;
320
+ height: 96px;
321
+ transform: translate(-50%, -50%);
322
+ border-radius: 50%;
323
+ touch-action: none;
324
+ background: radial-gradient(circle at center, rgba(0, 0, 0, 0) 50%, black 100%);
325
+ background-color: rgba(0, 0, 0, 0.1333333333);
326
+ }
327
327
  #joystickBase > #joystick {
328
- position: absolute;
329
- width: 48px;
330
- height: 48px;
331
- transform: translate(-50%, -50%);
332
- border-radius: 50%;
333
- touch-action: none;
328
+ position: absolute;
329
+ width: 48px;
330
+ height: 48px;
331
+ transform: translate(-50%, -50%);
332
+ border-radius: 50%;
333
+ touch-action: none;
334
+ background-color: rgba(255, 255, 255, 0.5333333333);
335
+ }
334
336
 
335
- background-color: #fff8;
337
+ #tooltip {
338
+ position: absolute;
339
+ border-radius: 4px;
340
+ padding: 4px 4px;
341
+ font-size: 12px;
342
+ color: #E0DCDD;
343
+ background-color: #282828;
336
344
  }