diff --git a/client/src/components/netflix-grid.tsx b/client/src/components/netflix-grid.tsx index 60df29c..1382316 100644 --- a/client/src/components/netflix-grid.tsx +++ b/client/src/components/netflix-grid.tsx @@ -151,12 +151,14 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) { if (targetScroll <= 0) { // Jump to end for infinite loop targetScroll = maxScroll; + console.log('Kroženje LEVO: skok na konec', { currentScroll, maxScroll, targetScroll }); } } else { targetScroll = currentScroll + scrollAmount; if (targetScroll >= maxScroll) { // Jump to beginning for infinite loop targetScroll = 0; + console.log('Kroženje DESNO: skok na začetek', { currentScroll, maxScroll, targetScroll }); } } @@ -184,9 +186,11 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) { if (direction === 'left' && newScroll <= 0) { // Jump to end for infinite loop newScroll = maxScroll; + console.log('Auto-scroll LEVO: skok na konec', { currentScroll, maxScroll, newScroll }); } else if (direction === 'right' && newScroll >= maxScroll) { // Jump to beginning for infinite loop newScroll = 0; + console.log('Auto-scroll DESNO: skok na začetek', { currentScroll, maxScroll, newScroll }); } scrollRef.current.scrollLeft = newScroll; @@ -210,8 +214,14 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
{/* Left scroll area with transparent background - only on desktop */}
startAutoScroll('left')} - onMouseLeave={stopAutoScroll} + onMouseEnter={() => { + setIsFastScrolling(true); + startAutoScroll('left'); + }} + onMouseLeave={() => { + setIsFastScrolling(false); + stopAutoScroll(); + }} onClick={() => { setIsFastScrolling(!isFastScrolling); scroll('left'); @@ -225,8 +235,14 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) { {/* Right scroll area with transparent background - only on desktop */}
startAutoScroll('right')} - onMouseLeave={stopAutoScroll} + onMouseEnter={() => { + setIsFastScrolling(true); + startAutoScroll('right'); + }} + onMouseLeave={() => { + setIsFastScrolling(false); + stopAutoScroll(); + }} onClick={() => { setIsFastScrolling(!isFastScrolling); scroll('right');