diff --git a/src/components/VideoCard.tsx b/src/components/VideoCard.tsx index 7424be1..cb9a833 100644 --- a/src/components/VideoCard.tsx +++ b/src/components/VideoCard.tsx @@ -49,13 +49,10 @@ export default function VideoCard({ const isAggregate = from === 'search' && !!items?.length; - // 聚合数据(仅在 search 模式下) const aggregateData = useMemo(() => { if (!isAggregate || !items) return null; - const countMap = new Map(); const episodeCountMap = new Map(); - items.forEach((item) => { if (item.douban_id && item.douban_id !== 0) { countMap.set(item.douban_id, (countMap.get(item.douban_id) || 0) + 1); @@ -121,9 +118,7 @@ export default function VideoCard({ async (e: React.MouseEvent) => { e.preventDefault(); e.stopPropagation(); - if (from === 'douban' || !actualSource || !actualId) return; - try { const newState = await toggleFavorite(actualSource, actualId, { title: actualTitle, @@ -154,9 +149,7 @@ export default function VideoCard({ async (e: React.MouseEvent) => { e.preventDefault(); e.stopPropagation(); - if (from !== 'playrecord' || !actualSource || !actualId) return; - try { await deletePlayRecord(actualSource, actualId); onDelete?.(); @@ -237,119 +230,119 @@ export default function VideoCard({ return (
{/* 海报容器 */} -
- {/* 骨架屏 */} - {!isLoaded && } +
+ {/* 骨架屏 - 添加渐入动画 */} + {!isLoaded && ( + + )} - {/* 图片加载动画 */} + {/* 图片加载动画 - 改进淡入和锐化效果 */} {actualTitle} setIsLoaded(true)} referrerPolicy='no-referrer' priority={false} /> - {/* 悬浮层 */} -
- {config.showPlayButton && ( + {/* 悬浮层 - 改进渐变和元素过渡 */} +
+ + {/* 播放按钮 */} + {config.showPlayButton && ( +
- )} +
+ )} - {/* 已看 / 收藏按钮 */} - {(config.showHeart || config.showCheckCircle) && ( -
- {config.showCheckCircle && ( - - )} + {/* 已看 / 收藏按钮 - 改进延迟和缓动效果 */} + {(config.showHeart || config.showCheckCircle) && ( +
+ {config.showCheckCircle && ( + + )} + {config.showHeart && ( + + )} +
+ )} - {config.showHeart && ( - - )} -
- )} -
- - {/* 评分徽章 */} + {/* 评分徽章 - 添加弹出效果 */} {config.showRating && rate && ( -
+
{rate}
)} - {/* 集数徽章 */} + {/* 集数徽章 - 改进缩放和阴影 */} {actualEpisodes && actualEpisodes > 1 && currentEpisode && ( -
+
{currentEpisode}/{actualEpisodes}
)} - {actualEpisodes && actualEpisodes > 1 && !currentEpisode && ( -
+
{actualEpisodes}
)} - {/* 豆瓣链接按钮 */} + {/* 豆瓣链接按钮 - 改进进入方向和延迟 */} {config.showDoubanLink && actualDoubanId && ( e.stopPropagation()} - className='absolute top-2 left-2 opacity-0 -translate-x-2 group-hover:translate-x-0 group-hover:opacity-100 group-hover:scale-110 transition-all duration-300' + className='absolute top-2 left-2 opacity-0 -translate-x-4 group-hover:translate-x-0 group-hover:opacity-100 transition-all duration-300 ease-out delay-100' > -
+
)}
- {/* 进度条 */} + {/* 进度条 - 添加动画效果 */} {config.showProgress && progress !== undefined && (
)} - {/* 标题与来源信息 */} - + {/* 标题与来源信息 - 改进颜色过渡和延迟 */} + {actualTitle} - {config.showSourceName && source_name && ( - - + + {source_name}