diff --git a/js/main.js b/js/main.js index 66a835d..547f98d 100644 --- a/js/main.js +++ b/js/main.js @@ -123,11 +123,10 @@ class App { this.mapInterface.style.display = 'none'; this.mapInterface.style.opacity = '0'; - // 重置UI层和提示文字的状态(确保第二次进入时能正常显示) - this.uiLayer.style.opacity = '0'; + // 重置UI层和提示文字的状态 this.uiLayer.style.display = 'flex'; - this.hint.style.opacity = '0'; this.hint.style.display = 'block'; + // 不设置 opacity,让GSAP的 fromTo() 控制 // 创建场景管理器 this.sceneManager = new SceneManager( diff --git a/js/scene/SceneManager.js b/js/scene/SceneManager.js index 26ef813..1f14d8e 100644 --- a/js/scene/SceneManager.js +++ b/js/scene/SceneManager.js @@ -111,23 +111,35 @@ export class SceneManager { }); // B. UI 淡入 (标题和提示依次出现) - tl.to('.v1-title', { - opacity: 1, - duration: 1.5, - ease: "power2.out" - }, `-=${animConfig.titleDelay}`); + tl.fromTo('.v1-title', + { opacity: 0 }, + { + opacity: 1, + duration: 1.5, + ease: "power2.out" + }, + `-=${animConfig.titleDelay}` + ); - tl.to('.v1-subtitle', { - opacity: 1, - duration: 1.2, - ease: "power2.out" - }, `-=${animConfig.subtitleDelay}`); + tl.fromTo('.v1-subtitle', + { opacity: 0 }, + { + opacity: 1, + duration: 1.2, + ease: "power2.out" + }, + `-=${animConfig.subtitleDelay}` + ); - tl.to('.instruction-hint', { - opacity: 1, - duration: 1.0, - ease: "power2.out" - }, `-=${animConfig.hintDelay}`); + tl.fromTo('.instruction-hint', + { opacity: 0 }, + { + opacity: 1, + duration: 1.0, + ease: "power2.out" + }, + `-=${animConfig.hintDelay}` + ); } // 初始化转场系统