Add canvas container and model preview in spirit overlay
This commit is contained in:
@@ -447,11 +447,18 @@ function showSpiritOverlay(spirit) {
|
|||||||
`;
|
`;
|
||||||
document.body.appendChild(el);
|
document.body.appendChild(el);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- Canvas-Container ---
|
||||||
el.innerHTML = `
|
el.innerHTML = `
|
||||||
<button id="spirit-overlay-close" style="
|
<button id="spirit-overlay-close" style="
|
||||||
position:absolute; right:12px; top:12px; border:none; background:none;
|
position:absolute; right:12px; top:12px; border:none; background:none;
|
||||||
color:#fff; font-size:1.5em; cursor:pointer; padding:0; line-height:1;
|
color:#fff; font-size:1.5em; cursor:pointer; padding:0; line-height:1;
|
||||||
" title="Schließen">×</button>
|
" title="Schließen">×</button>
|
||||||
|
<div id="spirit-model-preview" style="
|
||||||
|
width: 270px; height: 210px; margin:0 auto 10px auto; display: flex; align-items: center; justify-content: center;
|
||||||
|
background: #111; border-radius: 10px; box-shadow: 0 2px 16px #0006;">
|
||||||
|
<!-- Canvas wird hier erzeugt -->
|
||||||
|
</div>
|
||||||
<h2 style='padding:0; margin:0 0 8px 0; font-weight:700; letter-spacing:0.04em;'>${spirit.Name || 'Spirit'}</h2>
|
<h2 style='padding:0; margin:0 0 8px 0; font-weight:700; letter-spacing:0.04em;'>${spirit.Name || 'Spirit'}</h2>
|
||||||
<b>${spirit.Kategorie || ''}</b><br><br>
|
<b>${spirit.Kategorie || ''}</b><br><br>
|
||||||
<b>Mythos:</b> ${spirit["Mythos/Legende"] || ''}<br><br>
|
<b>Mythos:</b> ${spirit["Mythos/Legende"] || ''}<br><br>
|
||||||
@@ -462,10 +469,14 @@ function showSpiritOverlay(spirit) {
|
|||||||
el.style.display = "block";
|
el.style.display = "block";
|
||||||
lastOverlaySpiritData = spirit;
|
lastOverlaySpiritData = spirit;
|
||||||
|
|
||||||
// Close-Button Event
|
|
||||||
el.querySelector("#spirit-overlay-close").onclick = () => {
|
el.querySelector("#spirit-overlay-close").onclick = () => {
|
||||||
el.style.display = "none";
|
el.style.display = "none";
|
||||||
|
destroySpiritModelPreview();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Lade das Model neu für die Vorschau:
|
||||||
|
setupSpiritModelPreview(spirit);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mouse-Picking (zentral)
|
// Mouse-Picking (zentral)
|
||||||
|
|||||||
Reference in New Issue
Block a user