fix: 首屏转场不再因减少动效偏好被直接跳过

This commit is contained in:
Zhou Weidong committed 2026-11-13 13:29:15 +08:00
1 parent d6da152dec
commit dfa9f311e0
1 file changed
-4
-4
View File
@@ -11,10 +11,6 @@ export function HeroTransition({ data, onDone }) {
if (!data) return undefined;
const node = ref.current;
if (!node) return undefined;
if (window.matchMedia?.('(prefers-reduced-motion: reduce)').matches) {
onDone();
return undefined;
}
const rect = data;
const scale = Math.max(window.innerWidth / rect.width, window.innerHeight / rect.height) * 1.04;
const tx = (window.innerWidth - rect.width * scale) / 2 - rect.left;