Added loading throbber
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user