Created
November 24, 2023 01:49
-
-
Save Braunson/35bc660599fbb768a3ccc6ddef420b3b to your computer and use it in GitHub Desktop.
OBC IFC loader, on IFC loaded, show a disappearing 'Loaded the component' modal -- For https://github.com/IFCjs/components/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ifcLoader = new OBC.FragmentIfcLoader(component) | |
ifcLoader.onIfcLoaded.add(() => { | |
// Create a new div element with the desired content | |
const messageDiv: HTMLDivElement = document.createElement('div'); | |
messageDiv.textContent = 'Loaded the component'; | |
messageDiv.style.position = 'fixed'; | |
messageDiv.style.bottom = '10px'; | |
messageDiv.style.left = '10px'; | |
messageDiv.style.backgroundColor = 'lightgreen'; | |
messageDiv.style.padding = '10px'; | |
messageDiv.style.borderRadius = '5px'; | |
messageDiv.style.zIndex = '1000'; | |
// Append the div to the body | |
document.body.appendChild(messageDiv); | |
// Remove the div after 10 seconds | |
setTimeout(() => { | |
messageDiv.remove(); | |
}, 10000); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment