diff --git a/client/src/components/video-card.tsx b/client/src/components/video-card.tsx index 584ac6f..7a07aa3 100644 --- a/client/src/components/video-card.tsx +++ b/client/src/components/video-card.tsx @@ -47,11 +47,15 @@ export default function VideoCard({ video, onClick, className = "", hideOverlay const [isHovered, setIsHovered] = useState(false); const [showPreview, setShowPreview] = useState(false); const [isMuted, setIsMuted] = useState(true); + const [showMoreInfo, setShowMoreInfo] = useState(false); const hoverTimeoutRef = useRef(); const videoRef = useRef(null); const hlsRef = useRef(null); const [currentTime, setCurrentTime] = useState(0); const [duration, setDuration] = useState(0); + + // Check if device is mobile + const isMobile = window.innerWidth < 768; // Load mute preference on component mount useEffect(() => { @@ -152,9 +156,9 @@ export default function VideoCard({ video, onClick, className = "", hideOverlay return (
setIsHovered(true)} - onMouseLeave={() => setIsHovered(false)} + className={`video-card transition-transform duration-200 ${isMobile ? '' : 'hover:scale-[1.02]'} ${className}`} + onMouseEnter={() => !isMobile && setIsHovered(true)} + onMouseLeave={() => !isMobile && setIsHovered(false)} > {/* Video preview container */} )} - -
+ {/* Mobile info section - below video */} + {isMobile && ( +
+ {/* Title */} +

+ {video.title.split(' - ')[0] || 'go4.video'} +

+ + {/* Duration and Views in one line */} +
+ {formatViews(video.views || 0)} + {formatDate(video.createdAt)} +
+ + {/* Show More / Show Less button */} + + + {/* Expandable info */} + {showMoreInfo && ( +
+

+ {video.title.split(' - ')[1] || video.title} +

+ {video.description && ( +

+ {video.description} +

+ )} +
+ )} +
+ )} + ); }