diff --git a/client/src/components/video-card.tsx b/client/src/components/video-card.tsx index 418b7e1..9d5b924 100644 --- a/client/src/components/video-card.tsx +++ b/client/src/components/video-card.tsx @@ -47,7 +47,9 @@ export default function VideoCard({ video, onClick, className = "", hideOverlay const [isHovered, setIsHovered] = useState(false); const [showPreview, setShowPreview] = useState(false); const [isMuted, setIsMuted] = useState(true); + const [showHint, setShowHint] = useState(false); const hoverTimeoutRef = useRef(); + const hintTimeoutRef = useRef(); const videoRef = useRef(null); const hlsRef = useRef(null); const [currentTime, setCurrentTime] = useState(0); @@ -84,18 +86,27 @@ export default function VideoCard({ video, onClick, className = "", hideOverlay // Enable video preview on hover for desktop devices useEffect(() => { if (isHovered) { - // Enable preview for desktop devices after delay + // Show hint after short delay if (window.innerWidth >= 768) { + hintTimeoutRef.current = setTimeout(() => { + setShowHint(true); + }, 300); + const delay = 800; hoverTimeoutRef.current = setTimeout(() => { setShowPreview(true); + setShowHint(false); // Hide hint when preview starts }, delay); } } else { if (hoverTimeoutRef.current) { clearTimeout(hoverTimeoutRef.current); } + if (hintTimeoutRef.current) { + clearTimeout(hintTimeoutRef.current); + } setShowPreview(false); + setShowHint(false); // Clean up HLS when not hovering if (hlsRef.current) { hlsRef.current.destroy(); @@ -107,6 +118,9 @@ export default function VideoCard({ video, onClick, className = "", hideOverlay if (hoverTimeoutRef.current) { clearTimeout(hoverTimeoutRef.current); } + if (hintTimeoutRef.current) { + clearTimeout(hintTimeoutRef.current); + } if (hlsRef.current) { hlsRef.current.destroy(); } @@ -268,6 +282,18 @@ export default function VideoCard({ video, onClick, className = "", hideOverlay )} + {/* Preview hint animation */} + {showHint && !showPreview && ( +
+
+
+ + Hover to preview +
+
+
+ )} + {/* Modern gradient overlay with title */} {!showPreview && !hideOverlay && (
@@ -279,6 +305,13 @@ export default function VideoCard({ video, onClick, className = "", hideOverlay {video.title.split(' - ')[1] || video.title}

+ + {/* Subtle hover indicator in corner */} +
+
+ +
+
)}