Enhance MovieCard with hover effects and link handling

This commit is contained in:
vvwn
2026-02-24 16:42:29 +08:00
committed by GitHub
parent e6b84568fb
commit bee91705bd
+7 -1
View File
@@ -77,7 +77,13 @@ export const MovieCard = memo(function MovieCard({ movie, onMovieClick }: MovieC
)}
{movie.rate && parseFloat(movie.rate) > 0 && (
<div
className="absolute top-2 right-2 bg-black/80 px-2.5 py-1.5 flex items-center gap-1.5 rounded-[var(--radius-full)]"
onClick={(e) => {
e.preventDefault();
e.stopPropagation(); // 阻止事件冒泡,防止触发外层卡片的搜索点击
window.open(movie.url, '_blank', 'noopener,noreferrer');
}}
title="在豆瓣中查看"
className="absolute top-2 right-2 bg-black/80 hover:bg-black/90 px-2.5 py-1.5 flex items-center gap-1.5 rounded-[var(--radius-full)] z-20 hover:scale-105 transition-all shadow-md"
>
<Icons.Star size={12} className="text-yellow-400 fill-yellow-400" />
<span className="text-xs font-bold text-white">