Arrange videos into two rows on desktop screens

Modify the NetflixGrid component to display videos in a two-row grid layout on desktop (md:block) while maintaining a single scrollable row on mobile (md:hidden). This change ensures better use of screen real estate for larger displays.

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:24:52 +00:00
parent c14082c300
commit f0a8358043

View File

@ -182,36 +182,72 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
<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 */}
<div
ref={scrollRef}
className="flex space-x-2 md:space-x-3 overflow-x-auto scrollbar-hide pb-4 scroll-smooth"
style={{
scrollbarWidth: 'none',
msOverflowStyle: 'none',
scrollBehavior: 'smooth',
WebkitOverflowScrolling: 'touch'
}}
>
{category.videos.map((video, index) => (
<div key={video.id} className="flex-shrink-0 w-28 md:w-52 relative group">
{/* Top 10 Number overlay for first category */}
{category.title.includes("Top 10") && index < 10 && (
<div className="absolute top-1 left-1 z-20 text-white font-black text-3xl md:text-5xl drop-shadow-2xl"
style={{
textShadow: '4px 4px 8px rgba(0,0,0,0.8), -2px -2px 4px rgba(0,0,0,0.6)',
WebkitTextStroke: '2px rgba(0,0,0,0.8)'
}}>
{index + 1}
</div>
)}
<VideoCard
video={video}
onClick={onVideoClick}
className="w-full hover:scale-105 hover:z-10 transition-all duration-300 group-hover:shadow-xl rounded-md overflow-hidden"
/>
</div>
))}
{/* Mobile: Single scrollable row */}
<div className="md:hidden">
<div
ref={scrollRef}
className="flex space-x-2 overflow-x-auto scrollbar-hide pb-4 scroll-smooth"
style={{
scrollbarWidth: 'none',
msOverflowStyle: 'none',
scrollBehavior: 'smooth',
WebkitOverflowScrolling: 'touch'
}}
>
{category.videos.map((video, index) => (
<div key={video.id} className="flex-shrink-0 w-28 relative group">
{/* Top 10 Number overlay for first category */}
{category.title.includes("Top 10") && index < 10 && (
<div className="absolute top-1 left-1 z-20 text-white font-black text-3xl drop-shadow-2xl"
style={{
textShadow: '4px 4px 8px rgba(0,0,0,0.8), -2px -2px 4px rgba(0,0,0,0.6)',
WebkitTextStroke: '2px rgba(0,0,0,0.8)'
}}>
{index + 1}
</div>
)}
<VideoCard
video={video}
onClick={onVideoClick}
className="w-full hover:scale-105 hover:z-10 transition-all duration-300 group-hover:shadow-xl rounded-md overflow-hidden"
/>
</div>
))}
</div>
</div>
{/* Desktop: Two rows grid */}
<div className="hidden md:block">
<div
ref={scrollRef}
className="grid grid-rows-2 grid-flow-col gap-3 overflow-x-auto scrollbar-hide pb-4 scroll-smooth auto-cols-[208px]"
style={{
scrollbarWidth: 'none',
msOverflowStyle: 'none',
scrollBehavior: 'smooth',
WebkitOverflowScrolling: 'touch'
}}
>
{category.videos.map((video, index) => (
<div key={video.id} className="w-52 relative group">
{/* Top 10 Number overlay for first category */}
{category.title.includes("Top 10") && index < 10 && (
<div className="absolute top-1 left-1 z-20 text-white font-black text-5xl drop-shadow-2xl"
style={{
textShadow: '4px 4px 8px rgba(0,0,0,0.8), -2px -2px 4px rgba(0,0,0,0.6)',
WebkitTextStroke: '2px rgba(0,0,0,0.8)'
}}>
{index + 1}
</div>
)}
<VideoCard
video={video}
onClick={onVideoClick}
className="w-full hover:scale-105 hover:z-10 transition-all duration-300 group-hover:shadow-xl rounded-md overflow-hidden"
/>
</div>
))}
</div>
</div>
</div>
</div>