From 0956bbba7db3b7d8074d59c305ad56cdbaf9c2ec Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Mon, 1 Sep 2025 14:44:58 +0000 Subject: [PATCH] Improve video browsing by allowing users to scroll four videos at a time Update the `CategoryRow` component in `netflix-grid.tsx` to adjust the scroll amount for video navigation buttons. The scroll amount is now calculated to move exactly four cards at a time (312px per card), ensuring a consistent browsing experience. Additionally, navigation arrows are now explicitly styled and positioned for better usability. 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/0CzYEcy --- client/src/components/netflix-grid.tsx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/client/src/components/netflix-grid.tsx b/client/src/components/netflix-grid.tsx index 2e5839d..49b0e63 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) { - // Viewport-based scroll amount for full-width cards - const containerWidth = scrollRef.current.clientWidth; - const scrollAmount = containerWidth * 0.8; // Scroll 80% of visible area + // Scroll exactly 4 cards at a time (300px per card + 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' @@ -278,7 +278,18 @@ function CategoryRow({ category, onVideoClick, hideScrollButtons = false }: Cate ))} - {/* Navigation arrow at the end of each row - small square with arrow */} + {/* Navigation arrows - left and right */} +
+ +