From f50830712c773928f588937e7b59da1d18172310 Mon Sep 17 00:00:00 2001 From: rayd1o Date: Thu, 19 Mar 2026 09:49:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=87=AA=E5=8A=A8=E6=97=8B=E8=BD=AC?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=94=B9=E4=B8=BA=E6=92=AD=E6=94=BE/?= =?UTF-8?q?=E6=9A=82=E5=81=9C=E5=9B=BE=E6=A0=87=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/public/earth/js/controls.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/frontend/public/earth/js/controls.js b/frontend/public/earth/js/controls.js index 5cc62806..027a4f0e 100644 --- a/frontend/public/earth/js/controls.js +++ b/frontend/public/earth/js/controls.js @@ -179,11 +179,26 @@ export function resetView(camera) { } function setupRotateControls(camera, earth) { - document.getElementById('rotate-toggle').addEventListener('click', function() { + const rotateBtn = document.getElementById('rotate-toggle'); + const tooltip = rotateBtn?.querySelector('.tooltip'); + + function updateRotateIcon() { + const isRotating = getAutoRotate(); + rotateBtn.innerHTML = isRotating ? '⏸️' : '▶️'; + if (tooltip) { + tooltip.textContent = isRotating ? '暂停旋转' : '开始旋转'; + } + } + + rotateBtn.addEventListener('click', function() { toggleAutoRotate(); - showStatusMessage(autoRotate ? '自动旋转已开启' : '自动旋转已暂停', 'info'); + const isRotating = getAutoRotate(); + updateRotateIcon(); + showStatusMessage(isRotating ? '自动旋转已开启' : '自动旋转已暂停', 'info'); }); + updateRotateIcon(); + document.getElementById('reset-view').addEventListener('click', function() { resetView(camera); });