diff --git a/client/src/components/netflix-grid.tsx b/client/src/components/netflix-grid.tsx index a4744a7..c33c3f7 100644 --- a/client/src/components/netflix-grid.tsx +++ b/client/src/components/netflix-grid.tsx @@ -133,6 +133,7 @@ interface CategoryRowProps { function CategoryRow({ category, onVideoClick }: CategoryRowProps) { const scrollRef = useRef(null); + const scrollIntervalRef = useRef(null); const scroll = (direction: 'left' | 'right') => { if (scrollRef.current) { @@ -153,39 +154,62 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) { } }; + const startAutoScroll = (direction: 'left' | 'right') => { + if (scrollIntervalRef.current) { + clearInterval(scrollIntervalRef.current); + } + scrollIntervalRef.current = setInterval(() => { + if (scrollRef.current) { + const scrollAmount = direction === 'left' ? -3 : 3; + scrollRef.current.scrollLeft += scrollAmount; + } + }, 16); // ~60fps + }; + + const stopAutoScroll = () => { + if (scrollIntervalRef.current) { + clearInterval(scrollIntervalRef.current); + scrollIntervalRef.current = null; + } + }; + return (

{category.title}

-
- {/* Left scroll button - only on desktop */} - +
+ +
+
- {/* Right scroll button - only on desktop */} - +
+ +
+
{/* Mobile touch areas for left/right navigation */}
scroll('left')} />
scroll('right')} /> - {/* Scrollable video row */} + {/* Scrollable video row - edge to edge */}