From 3baeabcbc7c0b242fa4b02765c62de82a213f982 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Fri, 29 Aug 2025 16:50:30 +0000 Subject: [PATCH] Improve video carousel scrolling and spacing for better user experience Refactor CategoryRow component in netflix-grid.tsx to adjust scrolling step, remove redundant logic for auto-scroll and speed toggle, and update spacing and overflow properties for the video grid. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 2eb1084e-b728-4449-9231-f1665924c8d5 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2eb1084e-b728-4449-9231-f1665924c8d5/yexZbDm --- client/src/components/netflix-grid.tsx | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/client/src/components/netflix-grid.tsx b/client/src/components/netflix-grid.tsx index 21b9067..7ce8c6a 100644 --- a/client/src/components/netflix-grid.tsx +++ b/client/src/components/netflix-grid.tsx @@ -144,8 +144,8 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) { const videoWidth = 120; // Width including spacing const scroll = (direction: 'left' | 'right') => { - // Only move one step when clicked (no speed change here) - const step = direction === 'right' ? -videoWidth : videoWidth; + // Simple step movement + const step = direction === 'right' ? -200 : 200; setTranslateX(prev => prev + step); }; @@ -250,12 +250,7 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) { onClick={(e) => { e.preventDefault(); e.stopPropagation(); - // If already scrolling, toggle speed, otherwise start scrolling - if (isScrolling) { - toggleSpeed('left'); - } else { - startAutoScroll('left'); - } + scroll('left'); }} onMouseEnter={(e) => { e.stopPropagation(); @@ -276,12 +271,7 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) { onClick={(e) => { e.preventDefault(); e.stopPropagation(); - // If already scrolling, toggle speed, otherwise start scrolling - if (isScrolling) { - toggleSpeed('right'); - } else { - startAutoScroll('right'); - } + scroll('right'); }} onMouseEnter={(e) => { e.stopPropagation(); @@ -338,14 +328,12 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) { {/* Continuous flowing carousel - videos flow across entire width */} -