From 3b363cdd58ade4048cd377941173414f38d5c475 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Fri, 29 Aug 2025 16:03:02 +0000 Subject: [PATCH] Adjust video scrolling speed for smoother content browsing Update netflix-grid.tsx to use a fixed scrolling speed (0.8px) regardless of the 'speedMode' state, ensuring consistent and smoother horizontal video navigation. 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/QCN70f2 --- client/src/components/netflix-grid.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/components/netflix-grid.tsx b/client/src/components/netflix-grid.tsx index 2e403fd..4580a00 100644 --- a/client/src/components/netflix-grid.tsx +++ b/client/src/components/netflix-grid.tsx @@ -164,7 +164,9 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) { scrollIntervalRef.current = setInterval(() => { setTranslateX(prev => { - const speed = direction === 'right' ? -baseSpeed : baseSpeed; + // Use current speed mode for toggle function only + const currentSpeed = speedMode === 'fast' ? 1.5 : 0.8; + const speed = direction === 'right' ? -currentSpeed : currentSpeed; const newX = prev + speed; const totalWidth = category.videos.length * videoWidth; @@ -187,8 +189,8 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) { // Start continuous smooth scrolling with variable speed scrollIntervalRef.current = setInterval(() => { setTranslateX(prev => { - // Speed changes based on mode: normal (0.5px) or fast (1.2px) - smooth video by video - const baseSpeed = speedMode === 'fast' ? 1.2 : 0.5; + // Fixed speed for consistent movement - no automatic changes + const baseSpeed = 0.8; // Always same speed on hover const speed = direction === 'right' ? -baseSpeed : baseSpeed; const newX = prev + speed; const totalWidth = category.videos.length * videoWidth;