shx-3d-render

main
Jan Umbach 2024-06-13 19:44:04 +02:00
parent d3808bdb58
commit b7a48c39e6
2 changed files with 22 additions and 0 deletions

6
assets/three.module.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -31,6 +31,9 @@
<script type="text/javascript">
const threeJSisLading = false;
const threeJSloaded = false;
let globalInputFormsObjValues = {
"test1": {
"text1": "test"
@ -94,6 +97,19 @@
connectedCallback() {
this.innerHTML = '<div class="shx-input-forms-container"></div>';
this.container = this.querySelector('.shx-input-forms-container');
if(!threeJSisLading && !threeJSloaded) {
// load threejs
let script = document.createElement('script');
script.src = {{ 'three.module.min.js' | asset_url }};
script.id = 'threejs-script';
document.head.appendChild(script);
script.onload = () => {
threeJSloaded = true;
console.log('threejs loaded');
}
}
}
initCurrentVariant(id) {