Spaces:
Running
Running
Update index_sans_gif.js
Browse files- index_sans_gif.js +6 -6
index_sans_gif.js
CHANGED
@@ -64,7 +64,7 @@
|
|
64 |
|
65 |
// Inject CSS styles into the document head, scoped with the unique id.
|
66 |
var styleEl = document.createElement('style');
|
67 |
-
styleEl.textContent =
|
68 |
/* Widget container styling */
|
69 |
#ply-widget-container-${instanceId} {
|
70 |
position: relative;
|
@@ -165,13 +165,13 @@
|
|
165 |
display: inline-block;
|
166 |
transform: translateY(-3px);
|
167 |
}
|
168 |
-
|
169 |
document.head.appendChild(styleEl);
|
170 |
|
171 |
// Create the widget container and set its inner HTML.
|
172 |
var widgetContainer = document.createElement('div');
|
173 |
widgetContainer.id = 'ply-widget-container-' + instanceId;
|
174 |
-
widgetContainer.innerHTML =
|
175 |
<!-- Viewer Container (displayed directly) -->
|
176 |
<div id="viewer-container-${instanceId}">
|
177 |
<canvas id="canvas-${instanceId}"></canvas>
|
@@ -189,7 +189,7 @@
|
|
189 |
- Translate with left click
|
190 |
</div>
|
191 |
</div>
|
192 |
-
|
193 |
document.currentScript.parentNode.appendChild(widgetContainer);
|
194 |
|
195 |
// Grab element references using the unique IDs.
|
@@ -291,7 +291,7 @@
|
|
291 |
progressDialog.style.display = 'none';
|
292 |
} catch (error) {
|
293 |
console.error("Error loading PLY file:", error);
|
294 |
-
progressDialog.innerHTML =
|
295 |
}
|
296 |
|
297 |
const frame = () => {
|
@@ -311,4 +311,4 @@
|
|
311 |
|
312 |
// Initialize the viewer immediately.
|
313 |
initializeViewer();
|
314 |
-
})();
|
|
|
64 |
|
65 |
// Inject CSS styles into the document head, scoped with the unique id.
|
66 |
var styleEl = document.createElement('style');
|
67 |
+
styleEl.textContent = `
|
68 |
/* Widget container styling */
|
69 |
#ply-widget-container-${instanceId} {
|
70 |
position: relative;
|
|
|
165 |
display: inline-block;
|
166 |
transform: translateY(-3px);
|
167 |
}
|
168 |
+
`;
|
169 |
document.head.appendChild(styleEl);
|
170 |
|
171 |
// Create the widget container and set its inner HTML.
|
172 |
var widgetContainer = document.createElement('div');
|
173 |
widgetContainer.id = 'ply-widget-container-' + instanceId;
|
174 |
+
widgetContainer.innerHTML = `
|
175 |
<!-- Viewer Container (displayed directly) -->
|
176 |
<div id="viewer-container-${instanceId}">
|
177 |
<canvas id="canvas-${instanceId}"></canvas>
|
|
|
189 |
- Translate with left click
|
190 |
</div>
|
191 |
</div>
|
192 |
+
`;
|
193 |
document.currentScript.parentNode.appendChild(widgetContainer);
|
194 |
|
195 |
// Grab element references using the unique IDs.
|
|
|
291 |
progressDialog.style.display = 'none';
|
292 |
} catch (error) {
|
293 |
console.error("Error loading PLY file:", error);
|
294 |
+
progressDialog.innerHTML = `<p style="color: red">Error loading model: ${error.message}</p>`;
|
295 |
}
|
296 |
|
297 |
const frame = () => {
|
|
|
311 |
|
312 |
// Initialize the viewer immediately.
|
313 |
initializeViewer();
|
314 |
+
})();
|