@a2f0/skyline 0.2.43 → 0.2.44
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 +1 -1
- package/site/skyline-viewer.js +10 -0
package/package.json
CHANGED
package/site/skyline-viewer.js
CHANGED
|
@@ -51,6 +51,9 @@ export function mount(root, { assets, signal, controls, colour, theme, attributi
|
|
|
51
51
|
// Keep the drawing reachable until the first 3D frame succeeds, even if the scene's
|
|
52
52
|
// markup or code never loads, and again if its graphics context is lost.
|
|
53
53
|
let sceneUnavailable = true;
|
|
54
|
+
// The toolbar's show original waits while the scene boots, until its first frame, a
|
|
55
|
+
// failure to load, or a lost graphics context.
|
|
56
|
+
let booting = true;
|
|
54
57
|
const frames = {};
|
|
55
58
|
const toolbar = navigation ? createToolbar() : null;
|
|
56
59
|
function updateView() {
|
|
@@ -72,6 +75,7 @@ export function mount(root, { assets, signal, controls, colour, theme, attributi
|
|
|
72
75
|
button.setAttribute("aria-pressed", String(showing));
|
|
73
76
|
button.title = showing ? home.title : toggle.title;
|
|
74
77
|
}
|
|
78
|
+
toolbar.querySelector(`#${toggles.original.id}`).hidden = booting;
|
|
75
79
|
}
|
|
76
80
|
}
|
|
77
81
|
function showMode(next) {
|
|
@@ -152,6 +156,8 @@ export function mount(root, { assets, signal, controls, colour, theme, attributi
|
|
|
152
156
|
return new Promise(() => { });
|
|
153
157
|
const message = element(document, "p", { className: "loading", textContent: SCENE_FAILURE }, { role: "status" });
|
|
154
158
|
scene.append(message);
|
|
159
|
+
booting = false;
|
|
160
|
+
updateView();
|
|
155
161
|
throw error;
|
|
156
162
|
}
|
|
157
163
|
if (signal.aborted)
|
|
@@ -187,11 +193,13 @@ export function mount(root, { assets, signal, controls, colour, theme, attributi
|
|
|
187
193
|
onShowOriginal: showOriginal,
|
|
188
194
|
onReady() {
|
|
189
195
|
sceneUnavailable = false;
|
|
196
|
+
booting = false;
|
|
190
197
|
updateView();
|
|
191
198
|
resolve();
|
|
192
199
|
},
|
|
193
200
|
onUnavailable() {
|
|
194
201
|
sceneUnavailable = true;
|
|
202
|
+
booting = false;
|
|
195
203
|
updateView();
|
|
196
204
|
},
|
|
197
205
|
});
|
|
@@ -205,6 +213,8 @@ export function mount(root, { assets, signal, controls, colour, theme, attributi
|
|
|
205
213
|
// press away.
|
|
206
214
|
scene.querySelector("#loading").textContent = SCENE_FAILURE;
|
|
207
215
|
scene.querySelectorAll("button, input").forEach((control) => { control.disabled = true; });
|
|
216
|
+
booting = false;
|
|
217
|
+
updateView();
|
|
208
218
|
throw error;
|
|
209
219
|
}
|
|
210
220
|
}
|