diff --git a/frontend/app.js b/frontend/app.js index 9ab857b..54b510e 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -1482,6 +1482,30 @@ function startCameraAnimation() { idleAnimationId = requestAnimationFrame(animate); } +function stopAnimation() { + if (idleAnimationId) { + cancelAnimationFrame(idleAnimationId); + idleAnimationId = null; + } + currentPathIndex = 0; + cameraTime = 0; // Reset camera animation + lastFrameTime = null; // Reset frame time tracking + const animProgress = document.getElementById('animProgress'); + if (animProgress) { + animProgress.textContent = '0%'; + } +} + +function cycleViewMode() { + // Don't cycle if no route is set yet + if (!panorama || !masterPath || masterPath.length === 0) { + console.log('Cannot cycle view mode: no route set'); + return; + } + viewMode = (viewMode + 1) % 3; + updateViewMode(); +} + // ======================================== // User Profile Logic // ========================================