Added loading throbber

This commit is contained in:
2026-05-28 23:23:17 +08:00
parent 386aa5958a
commit 578a86b9e9
3 changed files with 43 additions and 0 deletions
+7
View File
@@ -87,6 +87,10 @@ function updateNameText(name) {
const gui = new GUI({ width: 425 }); //New UI
//Loading elements
const loaderContainer = document.getElementById('loader-container');
const loadingText = document.getElementById('loading-text');
//Load Function
function loadModel(modelPath) {
if (currentModel) {
@@ -103,12 +107,15 @@ function loadModel(modelPath) {
});
currentModel = null;
}
loaderContainer.style.display = 'flex';
console.log(`Loaded: ${modelPath}`);
loader.load(modelPath, (glb) => {
currentModel = glb.scene;
scene.add(glb.scene);
loaderContainer.style.display = 'none'; // Hide Loading Throbber
});
}
function startApp() {
// 1. Create an object to hold the currently selected values