Improve video display and navigation on various screen sizes

Adjusts card aspect ratios and scroll amounts in `netflix-grid.tsx` and `video-card.tsx` to enhance responsiveness. Updates scroll logic in `CategoryRow.tsx` for better mobile/desktop handling and resizes the "Top 10" overlay text.

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/xF0EUqR
This commit is contained in:
sebastjanartic 2025-08-29 08:45:52 +00:00
parent 76a669d88b
commit e2bb137f56
2 changed files with 8 additions and 6 deletions

View File

@ -73,8 +73,8 @@ export default function NetflixGrid({ videos, isLoading }: NetflixGridProps) {
<div className="h-6 bg-bunny-gray rounded w-48 animate-pulse"></div>
<div className="flex space-x-4 overflow-hidden">
{Array.from({ length: 6 }).map((_, index) => (
<div key={index} className="flex-shrink-0 w-56 animate-pulse">
<div className="bg-bunny-gray aspect-[9/16] rounded-xl mb-3"></div>
<div key={index} className="flex-shrink-0 w-56 md:w-80 animate-pulse">
<div className="bg-bunny-gray aspect-[9/16] md:aspect-[16/9] rounded-xl mb-3"></div>
<div className="space-y-2">
<div className="h-4 bg-bunny-gray rounded w-3/4"></div>
<div className="h-3 bg-bunny-gray rounded w-1/2"></div>
@ -136,7 +136,9 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
const scroll = (direction: 'left' | 'right') => {
if (scrollRef.current) {
const scrollAmount = 240; // Width of card + gap
// Responsive scroll amount - wider cards on desktop
const isMobile = window.innerWidth < 768;
const scrollAmount = isMobile ? 240 : 336; // Mobile: 224px + gap, Desktop: 320px + gap
const currentScroll = scrollRef.current.scrollLeft;
const targetScroll = direction === 'left'
? currentScroll - scrollAmount
@ -181,10 +183,10 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
style={{ scrollbarWidth: 'none', msOverflowStyle: 'none' }}
>
{category.videos.map((video, index) => (
<div key={video.id} className="flex-shrink-0 w-56 relative group">
<div key={video.id} className="flex-shrink-0 w-56 md:w-80 relative group">
{/* Top 10 Number overlay for first category */}
{category.title.includes("Top 10") && index < 10 && (
<div className="absolute top-2 left-2 z-20 text-white font-black text-7xl drop-shadow-2xl"
<div className="absolute top-2 left-2 z-20 text-white font-black text-5xl md:text-7xl 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)'

View File

@ -49,7 +49,7 @@ export default function VideoCard({ video, onClick, className = "" }: VideoCardP
>
{/* Simple thumbnail with fallback - no HLS loading until needed */}
<div
className="relative gradient-card rounded-xl overflow-hidden mb-4 aspect-[9/16] cursor-pointer group"
className="relative gradient-card rounded-xl overflow-hidden mb-4 aspect-[9/16] md:aspect-[16/9] cursor-pointer group"
onClick={() => onClick?.(video)}
>
<img