shx-3d-render

main
Jan Umbach 2024-06-13 16:51:01 +02:00
parent 0f868fb606
commit a66016ab1a
1 changed files with 17 additions and 4 deletions

View File

@ -37,7 +37,7 @@
}
};
function genTextInput(inputID, labelText, inputName, inputVal) {
function SHX_IFC_genTextInput(inputID, labelText, inputName, inputVal) {
return `
<label class="form__label custom" for="${inputID}-label">${labelText}</label>
<div class="field custom">
@ -46,6 +46,13 @@
`;
}
function SHX_IFC_genRenderButton() {
return `
<button class="btn" onclick="document.querySelector('shx-input-forms').renderView()">Vorschau generieren</button>
`;
}
const defaultStyle = `<style>.custom.form__label{margin-bottom: 0.6rem}.field.custom{margin-top: 0.6rem}.custom .field__input{padding-top:0.8rem}</style>`;
let globalInputFormsObj = {
@ -53,7 +60,8 @@
"renderHTML": () => {
let html = defaultStyle;
html += genTextInput('custom-text-1', 'Custom Text 1', 'Custom Text 1', globalInputFormsObjValues['test1']['text1']);
html += SHX_IFC_genTextInput('custom-text-1', 'Custom Text 1', 'Custom Text 1', globalInputFormsObjValues['test1']['text1']);
html += SHX_IFC_genRenderButton();
return html;
}
@ -61,8 +69,9 @@
"renderHTML": () => {
let html = defaultStyle;
html += genTextInput('custom-text-1', 'Custom Text 1', 'Custom Text 1', globalInputFormsObjValues['test2']['text1']);
html += genTextInput('custom-text-2', 'Custom Text 2', 'Custom Text 2', globalInputFormsObjValues['test2']['text2']);
html += SHX_IFC_genTextInput('custom-text-1', 'Custom Text 1', 'Custom Text 1', globalInputFormsObjValues['test2']['text1']);
html += SHX_IFC_genTextInput('custom-text-2', 'Custom Text 2', 'Custom Text 2', globalInputFormsObjValues['test2']['text2']);
html += SHX_IFC_genRenderButton();
return html;
}
@ -94,6 +103,10 @@
// Clean up the element when it is removed from the DOM.
}
renderView() {
console.log('renderView');
}
reloadCurrentVariant(id, openAnimation = false) {
this.currentVariant = id;
let container = this.container;