mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-08-19 10:43:43 +08:00
feat: remove content-visibility properties and refactor VideoCard z-index hover effects
This commit is contained in:
+2
-2
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 }) => {
|
||||
|
||||
Reference in New Issue
Block a user