diff --git a/ai_animation/src/main.js b/ai_animation/src/main.js index 31125b2..7415670 100644 --- a/ai_animation/src/main.js +++ b/ai_animation/src/main.js @@ -370,14 +370,6 @@ function createFallbackMap(ownershipMap = null) { const center = new THREE.Vector3(); box.getCenter(center); - // Offset the group's position by subtracting the center: - group.position.sub(center); - textGroup.position.sub(center); - - // ADDED: Lower the map on the screen - const mapOffset = new THREE.Vector3(0, 0, 200); // Move map 200 units down/forward in z-axis - group.position.add(mapOffset); - textGroup.position.add(mapOffset); scene.add(group); scene.add(textGroup); @@ -1652,13 +1644,13 @@ fileInput.addEventListener('change', e => { prevBtn.addEventListener('click', () => { if (currentPhaseIndex > 0) { currentPhaseIndex--; - displayPhase(currentPhaseIndex); + displayPhaseWithAnimation(currentPhaseIndex); } }); nextBtn.addEventListener('click', () => { if (gameData && currentPhaseIndex < gameData.phases.length - 1) { currentPhaseIndex++; - displayPhase(currentPhaseIndex); + displayPhaseWithAnimation(currentPhaseIndex); } }); diff --git a/ai_animation/src/map/mouseMovement.ts b/ai_animation/src/map/mouseMovement.ts index 8546127..5bc7d5b 100644 --- a/ai_animation/src/map/mouseMovement.ts +++ b/ai_animation/src/map/mouseMovement.ts @@ -1,9 +1,14 @@ export const addMapMouseEvents = (mapView: HTMLElement, display: HTMLElement) => { + const isDebugMode = process.env.NODE_ENV === 'development' || localStorage.getItem('debug') === 'true'; + mapView.addEventListener("mousemove", (event) => { const rect = mapView.getBoundingClientRect(); const x = event.clientX - rect.left; const y = event.clientY - rect.top; - display.textContent = `X: ${x.toFixed(2)}, Y: ${y.toFixed(2)}\nrect ${JSON.stringify(rect)}`; + + if (isDebugMode) { + display.textContent = `X: ${x.toFixed(2)}, Y: ${y.toFixed(2)}\nrect ${JSON.stringify(rect)}`; + } }) }