From 7969211351fde700a19d7cd0b2aea44711799b98 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Mon, 1 Sep 2025 15:25:30 +0000 Subject: [PATCH] Improve video grid navigation and display for better user experience Update the Netflix grid component to display videos in groups of four with updated card widths, container max-width, and implemented click-based scrolling for navigation arrows. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 8e9f2b36-ec9c-4acc-b19b-5304fa9790c5 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/8e9f2b36-ec9c-4acc-b19b-5304fa9790c5/fyyFszO --- client/src/components/netflix-grid.tsx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/client/src/components/netflix-grid.tsx b/client/src/components/netflix-grid.tsx index 5b30b46..1551933 100644 --- a/client/src/components/netflix-grid.tsx +++ b/client/src/components/netflix-grid.tsx @@ -188,9 +188,9 @@ function CategoryRow({ category, onVideoClick, hideScrollButtons = false }: Cate const scroll = (direction: 'left' | 'right') => { if (scrollRef.current) { - // Responsive scroll amount based on viewport - const containerWidth = scrollRef.current.clientWidth; - const scrollAmount = containerWidth * 0.85; // Scroll 85% of visible area + // Scroll exactly 4 cards (300px + 12px gap = 312px per card) + const cardWidth = 300 + 12; // card width + gap + const scrollAmount = cardWidth * 4; // 4 cards at once const currentScroll = scrollRef.current.scrollLeft; const targetScroll = direction === 'left' @@ -249,7 +249,7 @@ function CategoryRow({ category, onVideoClick, hideScrollButtons = false }: Cate ref={scrollRef} className="flex gap-3 overflow-x-auto scrollbar-hide pb-0 pl-4 pr-4" style={{ - maxWidth: '1200px', + maxWidth: '1300px', margin: '0 auto', scrollbarWidth: 'none', msOverflowStyle: 'none' @@ -258,7 +258,7 @@ function CategoryRow({ category, onVideoClick, hideScrollButtons = false }: Cate {category.videos.map((video, index) => (
setClickedVideoId(video.id)} > {/* Top 10 Number overlay for first category */} @@ -286,8 +286,7 @@ function CategoryRow({ category, onVideoClick, hideScrollButtons = false }: Cate {/* Navigation arrows - black circles */}