Add touch controls for navigating video carousels on mobile devices

Modify `netflix-grid.tsx` to hide desktop scroll buttons on mobile and introduce touch-sensitive areas on the left and right sides of the carousel for 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/P3O2FU7
This commit is contained in:
sebastjanartic 2025-08-29 10:16:40 +00:00
parent 015466d2e7
commit c5cc537586

View File

@ -157,25 +157,29 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
{category.title} {category.title}
</h2> </h2>
<div className="relative px-16"> <div className="relative px-0 md:px-16">
{/* Left scroll button */} {/* Left scroll button - only on desktop */}
<Button <Button
onClick={() => scroll('left')} onClick={() => scroll('left')}
className="absolute -left-2 top-1/2 -translate-y-1/2 z-30 bg-black/80 hover:bg-black/95 text-white border-none w-12 h-12 rounded-full opacity-0 group-hover:opacity-100 transition-all duration-300 flex items-center justify-center shadow-xl" className="hidden md:flex absolute -left-2 top-1/2 -translate-y-1/2 z-30 bg-black/80 hover:bg-black/95 text-white border-none w-12 h-12 rounded-full opacity-0 group-hover:opacity-100 transition-all duration-300 items-center justify-center shadow-xl"
size="sm" size="sm"
> >
<ChevronLeft className="w-5 h-5" /> <ChevronLeft className="w-5 h-5" />
</Button> </Button>
{/* Right scroll button */} {/* Right scroll button - only on desktop */}
<Button <Button
onClick={() => scroll('right')} onClick={() => scroll('right')}
className="absolute -right-2 top-1/2 -translate-y-1/2 z-30 bg-black/80 hover:bg-black/95 text-white border-none w-12 h-12 rounded-full opacity-0 group-hover:opacity-100 transition-all duration-300 flex items-center justify-center shadow-xl" className="hidden md:flex absolute -right-2 top-1/2 -translate-y-1/2 z-30 bg-black/80 hover:bg-black/95 text-white border-none w-12 h-12 rounded-full opacity-0 group-hover:opacity-100 transition-all duration-300 items-center justify-center shadow-xl"
size="sm" size="sm"
> >
<ChevronRight className="w-5 h-5" /> <ChevronRight className="w-5 h-5" />
</Button> </Button>
{/* Mobile touch areas for left/right navigation */}
<div className="md:hidden absolute left-0 top-0 w-1/3 h-full z-20" onClick={() => scroll('left')} />
<div className="md:hidden absolute right-0 top-0 w-1/3 h-full z-20" onClick={() => scroll('right')} />
{/* Scrollable video row */} {/* Scrollable video row */}
<div <div
ref={scrollRef} ref={scrollRef}