fix: show exactly 5 content cards per row on desktop across all tabs
Cards used a fixed 280px width which showed ~6 on most desktops. Algorithm filter tabs used a 5-column grid. This mismatch caused layout jumping when switching tabs. Now uses calc((100vw - 12rem) / 5) so exactly 5 cards are visible on desktop for all scroll rows (Films, My List, Rentals, etc.), matching the 5-column grid in filter views. Mobile stays at 200px. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -20,7 +20,7 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
args:
|
args:
|
||||||
CACHEBUST: "17"
|
CACHEBUST: "18"
|
||||||
VITE_USE_MOCK_DATA: "false"
|
VITE_USE_MOCK_DATA: "false"
|
||||||
VITE_CONTENT_ORIGIN: ${FRONTEND_URL}
|
VITE_CONTENT_ORIGIN: ${FRONTEND_URL}
|
||||||
VITE_INDEEHUB_API_URL: /api
|
VITE_INDEEHUB_API_URL: /api
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<div
|
<div
|
||||||
v-for="content in contents"
|
v-for="content in contents"
|
||||||
:key="content.id"
|
:key="content.id"
|
||||||
class="content-card flex-shrink-0 w-[200px] md:w-[280px] group/card cursor-pointer"
|
class="content-card flex-shrink-0 w-[200px] card-desktop-5 group/card cursor-pointer"
|
||||||
@click="$emit('content-click', content)"
|
@click="$emit('content-click', content)"
|
||||||
>
|
>
|
||||||
<div class="glass-card rounded-lg p-1.5 transition-all duration-300 relative">
|
<div class="glass-card rounded-lg p-1.5 transition-all duration-300 relative">
|
||||||
@@ -184,6 +184,17 @@ onUnmounted(() => {
|
|||||||
transform: translateY(-4px);
|
transform: translateY(-4px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Show exactly 5 cards on desktop.
|
||||||
|
Total horizontal padding: section px-4 (32px) + slider px-4 (32px) = 64px.
|
||||||
|
Gaps between 5 cards: 4 × 2rem (gap-8) = 128px.
|
||||||
|
Card width = (viewport - 64px padding - 128px gaps) / 5 */
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.card-desktop-5 {
|
||||||
|
width: calc((100vw - 12rem) / 5);
|
||||||
|
max-width: 360px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.social-badge {
|
.social-badge {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
<div
|
<div
|
||||||
v-for="item in continueWatching"
|
v-for="item in continueWatching"
|
||||||
:key="item.content.id"
|
:key="item.content.id"
|
||||||
class="content-card flex-shrink-0 w-[200px] md:w-[280px] group/card cursor-pointer"
|
class="content-card flex-shrink-0 w-[200px] card-desktop-5 group/card cursor-pointer"
|
||||||
@click="handleContentClick(item.content)"
|
@click="handleContentClick(item.content)"
|
||||||
>
|
>
|
||||||
<div class="glass-card rounded-lg p-1.5 transition-all duration-300 relative">
|
<div class="glass-card rounded-lg p-1.5 transition-all duration-300 relative">
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
<div
|
<div
|
||||||
v-for="content in myListContent"
|
v-for="content in myListContent"
|
||||||
:key="content.id"
|
:key="content.id"
|
||||||
class="content-card flex-shrink-0 w-[200px] md:w-[280px] group/card cursor-pointer"
|
class="content-card flex-shrink-0 w-[200px] card-desktop-5 group/card cursor-pointer"
|
||||||
@click="handleContentClick(content)"
|
@click="handleContentClick(content)"
|
||||||
>
|
>
|
||||||
<div class="glass-card rounded-lg p-1.5 transition-all duration-300">
|
<div class="glass-card rounded-lg p-1.5 transition-all duration-300">
|
||||||
@@ -142,7 +142,7 @@
|
|||||||
<div
|
<div
|
||||||
v-for="content in rentedContent"
|
v-for="content in rentedContent"
|
||||||
:key="content.id"
|
:key="content.id"
|
||||||
class="content-card flex-shrink-0 w-[200px] md:w-[280px] group/card cursor-pointer"
|
class="content-card flex-shrink-0 w-[200px] card-desktop-5 group/card cursor-pointer"
|
||||||
@click="handleContentClick(content)"
|
@click="handleContentClick(content)"
|
||||||
>
|
>
|
||||||
<div class="glass-card rounded-lg p-1.5 transition-all duration-300 relative">
|
<div class="glass-card rounded-lg p-1.5 transition-all duration-300 relative">
|
||||||
@@ -584,4 +584,12 @@ watch(() => searchSelection.pendingContent, (content) => {
|
|||||||
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 255, 255, 0.05);
|
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 255, 255, 0.05);
|
||||||
transform: translateY(-4px);
|
transform: translateY(-4px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Show exactly 5 cards on desktop (matches ContentRow) */
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.card-desktop-5 {
|
||||||
|
width: calc((100vw - 12rem) / 5);
|
||||||
|
max-width: 360px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user