Enable video previews on hover for desktop users

Re-enable video preview functionality on hover for desktop devices (screens >= 768px) with a delay, reverting a previous performance optimization.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1/d05DGZF
This commit is contained in:
sebastjanartic 2025-09-02 15:25:38 +00:00
parent c26d16da3d
commit ba4d45db96

View File

@ -52,16 +52,16 @@ export default function VideoCard({ video, onClick, className = "", hideOverlay
const [currentTime, setCurrentTime] = useState(0);
const [duration, setDuration] = useState(0);
// Disable video preview for better performance - just keep hover effects
// Enable video preview on hover for desktop devices
useEffect(() => {
if (isHovered) {
// Disable preview completely for performance
// if (window.innerWidth >= 768) {
// const delay = 800;
// hoverTimeoutRef.current = setTimeout(() => {
// setShowPreview(true);
// }, delay);
// }
// Enable preview for desktop devices after delay
if (window.innerWidth >= 768) {
const delay = 800;
hoverTimeoutRef.current = setTimeout(() => {
setShowPreview(true);
}, delay);
}
} else {
if (hoverTimeoutRef.current) {
clearTimeout(hoverTimeoutRef.current);