feat: remove content-visibility properties and refactor VideoCard z-index hover effects

This commit is contained in:
kuekhaoyang
2025-12-01 09:14:24 +08:00
parent fd8b78362d
commit b12c09b578
3 changed files with 6 additions and 11 deletions
+2 -2
View File
@@ -96,10 +96,10 @@ nav:where(.sticky, .fixed),
transform: translateZ(0);
}
[class*="grid"]>* {
/* [class*="grid"]>* {
content-visibility: auto;
contain-intrinsic-size: auto 400px;
}
} */
[class*="grid"]>a {
animation: fadeInUp 0.2s ease-out;
+4 -8
View File
@@ -28,9 +28,11 @@ export const VideoCard = memo<VideoCardProps>(({
return (
<div
style={{
// contain: 'layout style paint', // Removed to fix z-index stacking context
contentVisibility: 'auto',
position: 'relative',
zIndex: 1,
}}
onMouseEnter={(e) => (e.currentTarget.style.zIndex = '100')}
onMouseLeave={(e) => (e.currentTarget.style.zIndex = '1')}
>
<Link
key={cardId}
@@ -40,12 +42,6 @@ export const VideoCard = memo<VideoCardProps>(({
aria-label={`${video.vod_name}${video.vod_remarks ? ` - ${video.vod_remarks}` : ''}`}
prefetch={false}
className="group cursor-pointer hover:translate-y-[-2px] transition-transform duration-200 ease-out block h-full"
style={{
position: 'relative',
zIndex: 1,
}}
onMouseEnter={(e) => (e.currentTarget.style.zIndex = '100')}
onMouseLeave={(e) => (e.currentTarget.style.zIndex = '1')}
>
<Card
className="p-0 flex flex-col h-full bg-[var(--bg-color)]/50 backdrop-blur-none saturate-100 shadow-sm border-[var(--glass-border)] hover:shadow-lg transition-shadow"
-1
View File
@@ -86,7 +86,6 @@ export const VideoGrid = memo(function VideoGrid({ videos, className = '' }: Vid
// Optimize rendering performance
// willChange: 'auto', // Removed to let browser decide
// contain: 'layout style paint', // Removed to fix z-index stacking context
contentVisibility: 'auto',
}}
>
{visibleItems.map(({ video, videoUrl, cardId }) => {