From e019d1d419b9efe1abba6a87241e343cfe67a632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20P?= Date: Mon, 27 May 2024 22:24:07 +0200 Subject: [PATCH] Some UI nonsense... --- index.html | 6 ++++-- main.js | 4 ++++ ui.js | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 ui.js diff --git a/index.html b/index.html index 2a9e6a4..39dad1a 100644 --- a/index.html +++ b/index.html @@ -11,13 +11,15 @@ "three": "./vendor/three/build/three.module.js", "@thatopen/fragments": "./vendor/@thatopen/fragments/dist/index.mjs", "web-ifc": "./vendor/web-ifc/web-ifc-api.js", - "openbim-components": "./vendor/@thatopen/components/dist/index.mjs" + "openbim-components": "./vendor/@thatopen/components/dist/index.mjs", + "lit": "./vendor/@lit-labs/ssr-dom-shim/index.js" } } -
+
+
\ No newline at end of file diff --git a/main.js b/main.js index 3e9e431..e6859a7 100644 --- a/main.js +++ b/main.js @@ -1,5 +1,6 @@ import * as THREE from 'three'; import * as OBC from 'openbim-components'; +import UI from './ui.js'; document.addEventListener('DOMContentLoaded', () => { const container = document.querySelector('#scene'); @@ -25,4 +26,7 @@ document.addEventListener('DOMContentLoaded', () => { world.scene.setup(); world.camera.controls.setLookAt(3, 3, 3, 0, 0, 0); + + UI.ifcLoader('ui'); + }); \ No newline at end of file diff --git a/ui.js b/ui.js new file mode 100644 index 0000000..9b3a041 --- /dev/null +++ b/ui.js @@ -0,0 +1,18 @@ +/** + * @namespace UI + */ +const UI = {}; + +/** + * @param {string} uiContainer The UI div's id + */ +UI.ifcLoader = function (uiContainer) { + const ui = document.querySelector(`#${uiContainer}`); + const loadBtn = ` + + `; + + ui.innerHTML += loadBtn; +}; + +export default UI; \ No newline at end of file