diff --git a/client/src/components/netflix-grid.tsx b/client/src/components/netflix-grid.tsx index b8361ae..021a8b7 100644 --- a/client/src/components/netflix-grid.tsx +++ b/client/src/components/netflix-grid.tsx @@ -270,10 +270,9 @@ function CategoryRow({ category, onVideoClick, hideScrollButtons = false }: Cate const isMobile = window.innerWidth < 768; if (isMobile) { - // On mobile, cards snap to left edge + // On mobile, one full card at a time const cardWidth = containerWidth - 24; // Account for container margins (12px each side) - const gap = 12; - const newIndex = Math.round(scrollLeft / (cardWidth + gap)); + const newIndex = Math.round(scrollLeft / cardWidth); setCurrentIndex(Math.min(newIndex, 9)); // Max 9 for 10 cards (0-indexed) } } @@ -302,10 +301,9 @@ function CategoryRow({ category, onVideoClick, hideScrollButtons = false }: Cate if (scrollRef.current) { const containerWidth = scrollRef.current.clientWidth; const cardWidth = containerWidth - 24; // Account for container margins - const gap = 12; - // Scroll so next card aligns to left edge (accounting for container padding) + // Scroll so only one full card is visible scrollRef.current.scrollTo({ - left: nextIndex * (cardWidth + gap) + 12, // +12 for left container padding + left: nextIndex * cardWidth, behavior: 'smooth' }); setCurrentIndex(nextIndex); @@ -318,10 +316,9 @@ function CategoryRow({ category, onVideoClick, hideScrollButtons = false }: Cate if (scrollRef.current) { const containerWidth = scrollRef.current.clientWidth; const cardWidth = containerWidth - 24; // Account for container margins - const gap = 12; - // Scroll so previous card aligns to left edge (accounting for container padding) + // Scroll so only one full card is visible scrollRef.current.scrollTo({ - left: prevIndex * (cardWidth + gap) + 12, // +12 for left container padding + left: prevIndex * cardWidth, behavior: 'smooth' }); setCurrentIndex(prevIndex); @@ -367,8 +364,8 @@ function CategoryRow({ category, onVideoClick, hideScrollButtons = false }: Cate {/* Scrollable video row - in container */}