Commit 33017cb4 authored by Cantuerk's avatar Cantuerk
Browse files

Update public/index.html, public/style.css

1 merge request!180Update public/index.html, public/style.css
Showing with 24 additions and 16 deletions
+24 -16
...@@ -308,6 +308,7 @@ ...@@ -308,6 +308,7 @@
function highlightSelectedModel() { function highlightSelectedModel() {
if (selectedPlacedModel) { if (selectedPlacedModel) {
removeHighlightFromAllModels();
selectedPlacedModel.traverse((child) => { selectedPlacedModel.traverse((child) => {
if (child.isMesh) { if (child.isMesh) {
child.material.emissive.setHex(0xff0000); // Rote Hervorhebung child.material.emissive.setHex(0xff0000); // Rote Hervorhebung
...@@ -324,6 +325,14 @@ ...@@ -324,6 +325,14 @@
} }
} }
function removeHighlightFromAllModels() {
scene.traverse((child) => {
if (child.isMesh && child.material && child.material.emissive) {
child.material.emissive.setHex(0x000000); // Markierung entfernen
}
});
}
function deleteModel() { function deleteModel() {
if (!selectedPlacedModel) { if (!selectedPlacedModel) {
console.log("Kein Modell ausgewählt. Bitte wählen Sie ein Modell aus, bevor Sie es löschen."); console.log("Kein Modell ausgewählt. Bitte wählen Sie ein Modell aus, bevor Sie es löschen.");
...@@ -427,6 +436,7 @@ ...@@ -427,6 +436,7 @@
let moveDelta = 0.1; // Standardwert für die Verschiebungsgröße, kann mit dem Slider geändert werden let moveDelta = 0.1; // Standardwert für die Verschiebungsgröße, kann mit dem Slider geändert werden
function openMoveMenu() { function openMoveMenu() {
if (!selectedPlacedModel) { if (!selectedPlacedModel) {
console.log("Kein Modell ausgewählt. Bitte wählen Sie ein Modell aus, bevor Sie es bewegen."); console.log("Kein Modell ausgewählt. Bitte wählen Sie ein Modell aus, bevor Sie es bewegen.");
...@@ -441,19 +451,16 @@ ...@@ -441,19 +451,16 @@
<div id="position-info"> <div id="position-info">
<p>Aktuelle Position: X=${selectedPlacedModel.position.x.toFixed(2)}, Z=${selectedPlacedModel.position.z.toFixed(2)}</p> <p>Aktuelle Position: X=${selectedPlacedModel.position.x.toFixed(2)}, Z=${selectedPlacedModel.position.z.toFixed(2)}</p>
</div> </div>
<div> <label>Verschiebungsgröße: <span id="move-delta-display">${moveDelta.toFixed(2)}</span></label>
<p>Verschiebungsgröße: <span id="move-delta-display">${moveDelta.toFixed(2)}</span></p> <input type="range" min="0.01" max="1.0" step="0.01" value="${moveDelta}" onchange="updateMoveDelta(this.value)">
<input type="range" min="0.01" max="1.0" step="0.01" value="${moveDelta}" <div style="display: flex; flex-direction: column; align-items: center;">
onchange="updateMoveDelta(this.value)">
</div>
<div style="display: flex; flex-direction: column; align-items: center; gap: 10px;">
<div> <div>
<button onclick="moveModel('x', -moveDelta)">← X</button> <button onclick="moveModelDynamic('x', -1)">← X</button>
<button onclick="moveModel('x', moveDelta)">→ X</button> <button onclick="moveModelDynamic('x', 1)">→ X</button>
</div> </div>
<div> <div>
<button onclick="moveModel('z', -moveDelta)">- Z</button> <button onclick="moveModelDynamic('z', -1)">- Z</button>
<button onclick="moveModel('z', moveDelta)">+ Z</button> <button onclick="moveModelDynamic('z', 1)">+ Z</button>
</div> </div>
</div> </div>
<button onclick="closeDynamicMenu()">Zurück</button> <button onclick="closeDynamicMenu()">Zurück</button>
...@@ -468,11 +475,12 @@ ...@@ -468,11 +475,12 @@
} }
} }
function moveModel(axis, delta) { function moveModelDynamic(axis, direction) {
if (selectedPlacedModel) { if (selectedPlacedModel) {
selectedPlacedModel.position[axis] += delta; // Bewegung durchführen const delta = direction * moveDelta; // Dynamischer Wert basierend auf Slider
selectedPlacedModel.position[axis] += delta;
// Positionsanzeige im Dynamic-Menü aktualisieren // Position im Menü aktualisieren
const positionInfo = document.getElementById("position-info"); const positionInfo = document.getElementById("position-info");
if (positionInfo) { if (positionInfo) {
positionInfo.innerHTML = ` positionInfo.innerHTML = `
......
...@@ -170,17 +170,17 @@ body { ...@@ -170,17 +170,17 @@ body {
#dynamic-menu { #dynamic-menu {
position: absolute; position: absolute;
bottom: 80px; bottom: 90px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 20px; gap: 10px;
background: #1e1e1e; background: #1e1e1e;
box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.8); box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.8);
color: white; color: white;
width: 100vw; width: 100vw;
height: 200px; height: 250px;
z-index: 20; z-index: 20;
overflow-y: auto; overflow-y: auto;
border-radius: 8px; border-radius: 8px;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment