From a5e8f95f83c03f50b5c9927d15b45935d1419b4c Mon Sep 17 00:00:00 2001 From: SongPro Date: Wed, 2 Jul 2025 00:59:51 +0800 Subject: [PATCH] =?UTF-8?q?perf(components):=20=E4=BC=98=E5=8C=96=E5=8D=A1?= =?UTF-8?q?=E7=89=87=E7=BB=84=E4=BB=B6=E7=9A=84=E5=8A=A8=E7=94=BB=E8=BF=87?= =?UTF-8?q?=E6=B8=A1=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 统一调整多个卡片组件的动画持续时间,将较长的过渡时间缩短以提升交互响应速度 --- src/components/AggregateCard.tsx | 16 ++++++++-------- src/components/DemoCard.tsx | 18 +++++++++--------- src/components/VideoCard.tsx | 26 +++++++++++++------------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/components/AggregateCard.tsx b/src/components/AggregateCard.tsx index 5a889bd..2fe1025 100644 --- a/src/components/AggregateCard.tsx +++ b/src/components/AggregateCard.tsx @@ -121,24 +121,24 @@ const AggregateCard: React.FC = ({ year ? `&year=${encodeURIComponent(year)}` : '' }&type=${mostFrequentEpisodes > 1 ? 'tv' : 'movie'}`} > -
+
{/* 封面图片 2:3 */} -
+
{first.title} {/* Hover 效果层 */} -
+
{/* 播放按钮 */}
= ({ target='_blank' rel='noopener noreferrer' onClick={(e) => e.stopPropagation()} - className='absolute top-2 left-2 scale-90 group-hover:scale-100 opacity-0 group-hover:opacity-100 transition-all duration-500 cubic-bezier(0.4,0,0.2,1)' + className='absolute top-2 left-2 scale-90 group-hover:scale-100 opacity-0 group-hover:opacity-100 transition-all duration-300 cubic-bezier(0.4,0,0.2,1)' > -
+
@@ -187,7 +187,7 @@ const AggregateCard: React.FC = ({
{/* 标题 */} - + {first.title}
diff --git a/src/components/DemoCard.tsx b/src/components/DemoCard.tsx index a8dee60..be4b6db 100644 --- a/src/components/DemoCard.tsx +++ b/src/components/DemoCard.tsx @@ -54,23 +54,23 @@ const DemoCard = ({ id, title, poster, rate, type }: DemoCardProps) => { return (
{/* 海报图片区域 */} -
+
{title} {/* 评分徽章 */} {rate && ( -
+
{rate} @@ -78,11 +78,11 @@ const DemoCard = ({ id, title, poster, rate, type }: DemoCardProps) => { )} {/* 悬浮层 - 搜索按钮 */} -
+
setHover(true)} onMouseLeave={() => setHover(false)} - className={`transition-all duration-500 cubic-bezier(0.4, 0, 0.2, 1) ${ + className={`transition-all duration-300 cubic-bezier(0.4, 0, 0.2, 1) ${ hover ? 'scale-110 rotate-12' : 'scale-90' }`} > @@ -96,16 +96,16 @@ const DemoCard = ({ id, title, poster, rate, type }: DemoCardProps) => { target='_blank' rel='noopener noreferrer' onClick={(e) => e.stopPropagation()} - className='absolute top-2 left-2 scale-90 group-hover:scale-100 opacity-0 group-hover:opacity-100 transition-all duration-500 cubic-bezier(0.4, 0, 0.2, 1)' + className='absolute top-2 left-2 scale-90 group-hover:scale-100 opacity-0 group-hover:opacity-100 transition-all duration-300 cubic-bezier(0.4, 0, 0.2, 1)' > -
+
{/* 信息层 */} - + {title}
diff --git a/src/components/VideoCard.tsx b/src/components/VideoCard.tsx index dc84051..093be76 100644 --- a/src/components/VideoCard.tsx +++ b/src/components/VideoCard.tsx @@ -161,17 +161,17 @@ export default function VideoCard({ )}${year ? `&year=${year}` : ''}${from ? `&from=${from}` : ''}`} >
{/* 海报图片容器 */} -
+
{title} @@ -182,12 +182,12 @@ export default function VideoCard({ alwaysShowHeart ? 'opacity-50 group-hover:opacity-100' : 'opacity-0 group-hover:opacity-100' - } transition-all duration-500 cubic-bezier(0.4,0,0.2,1) flex items-center justify-center overflow-hidden`} + } transition-all duration-300 cubic-bezier(0.4,0,0.2,1) flex items-center justify-center overflow-hidden`} > {/* 播放按钮 */}
{/* 右侧操作按钮组 */} -
+
{!hideCheckCircle && ( @@ -224,7 +224,7 @@ export default function VideoCard({ title={favorited ? '移除收藏' : '加入收藏'} className={`inline-flex items-center justify-center ${ alwaysShowHeart ? 'opacity-100' : 'opacity-70' - } hover:opacity-100 transition-opacity duration-300`} + } hover:opacity-100 transition-opacity duration-200`} > e.stopPropagation()} - className='absolute top-2 left-2 scale-90 group-hover:scale-100 opacity-0 group-hover:opacity-100 transition-all duration-500 cubic-bezier(0.4,0,0.2,1)' + className='absolute top-2 left-2 scale-90 group-hover:scale-100 opacity-0 group-hover:opacity-100 transition-all duration-300 cubic-bezier(0.4,0,0.2,1)' > -
+
@@ -270,20 +270,20 @@ export default function VideoCard({ {progress !== undefined && (
)} {/* 信息层 */} - + {title} {/* 来源信息 */} {source && ( - + {source_name}