fix(ui): 完整遵守减少动态效果偏好

This commit is contained in:
2026-05-12 00:56:33 +08:00
parent ad32500121
commit 282fdbc2a6
+6 -4
View File
@@ -16,7 +16,7 @@ export function MotionHeader({
return (
<motion.header
initial={{ opacity: 0, y: shouldReduceMotion ? 0 : 10 }}
initial={shouldReduceMotion ? false : { opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5, delay, ease: [0.25, 0.1, 0.25, 1] }}
className={className}
@@ -37,7 +37,7 @@ export function MotionSection({
return (
<motion.section
initial={{ opacity: 0, y: shouldReduceMotion ? 0 : 10 }}
initial={shouldReduceMotion ? false : { opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5, delay, ease: [0.25, 0.1, 0.25, 1] }}
className={className}
@@ -58,7 +58,7 @@ export function MotionDiv({
return (
<motion.div
initial={{ opacity: 0, y: shouldReduceMotion ? 0 : 10 }}
initial={shouldReduceMotion ? false : { opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5, delay, ease: [0.25, 0.1, 0.25, 1] }}
className={className}
@@ -112,9 +112,11 @@ export function MotionTableRow({
className,
...props
}: { children: ReactNode } & ComponentPropsWithoutRef<typeof motion.tr>) {
const { shouldReduceMotion } = useMotionConfig()
return (
<motion.tr
initial={{ opacity: 0 }}
initial={shouldReduceMotion ? false : { opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ duration: 0.3 }}
className={className}