From e9172e83e68dd935f28957914c188574b68996a8 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Fri, 29 Aug 2025 23:26:37 +0000 Subject: [PATCH] Improve video display with responsive grid layout Refactors the SimpleCarousel component to use a flex-wrap container, removing horizontal scroll buttons and implementing responsive styling for video posters based on screen size. Adds CSS for the new layout and adjusts the "Top 10" number overlay positioning. 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/kdQ95gE --- client/src/components/simple-carousel.tsx | 75 ++++++----------------- client/src/index.css | 24 ++++++++ 2 files changed, 44 insertions(+), 55 deletions(-) diff --git a/client/src/components/simple-carousel.tsx b/client/src/components/simple-carousel.tsx index 8c1a567..b93d165 100644 --- a/client/src/components/simple-carousel.tsx +++ b/client/src/components/simple-carousel.tsx @@ -101,62 +101,27 @@ export default function SimpleCarousel({ category, onVideoClick }: SimpleCarouse {category.title} -
- {/* Left scroll button */} - - - {/* Right scroll button */} - - - {/* Scroll container */} -
-
- {/* Create many copies for infinite feel */} - {Array.from({ length: 20 }).map((_, copyIndex) => - category.videos.map((video, videoIndex) => ( -
- {/* Top 10 Number overlay for first category */} - {category.title.includes("Top 10") && ( -
- {videoIndex + 1} -
- )} - -
- )) - ).flat()} + {/* Container z flex wrap */} +
+ {category.videos.map((video, videoIndex) => ( +
+ {/* Top 10 Number overlay for first category */} + {category.title.includes("Top 10") && ( +
+ {videoIndex + 1} +
+ )} +
-
+ ))}
); diff --git a/client/src/index.css b/client/src/index.css index a689e01..44ad051 100644 --- a/client/src/index.css +++ b/client/src/index.css @@ -401,6 +401,30 @@ input[data-testid*="search"]::placeholder { font-display: swap; } +/* Container flex wrap styles */ +.container { + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: 10px; /* Razmik med slikami */ + padding: 10px; +} + +.poster { + width: 150px; /* Velikost slike */ + height: auto; /* Ohranja razmerje */ +} + +@media (max-width: 768px) { + .container { + flex-direction: column; /* Slike ena pod drugo */ + align-items: center; + } + .poster { + width: 120px; /* Manjša velikost za mobilne naprave */ + } +} + /* Hide picture-in-picture button on all video elements */ video::-webkit-media-controls-picture-in-picture-button { display: none !important;