From b47b09eb85566e1d1c4d260c05b10dfdaa1f4347 Mon Sep 17 00:00:00 2001 From: Arthur Lefebvre Date: Mon, 13 Apr 2026 15:11:25 +0200 Subject: [PATCH] Collection browser: improve display on mobile --- front/src/CollectionListElement.vue | 77 +++++++++++++++++++++++++---- 1 file changed, 68 insertions(+), 9 deletions(-) diff --git a/front/src/CollectionListElement.vue b/front/src/CollectionListElement.vue index c678d60..22d3359 100644 --- a/front/src/CollectionListElement.vue +++ b/front/src/CollectionListElement.vue @@ -16,11 +16,18 @@ function goToCollection() { router.push(`/collection/${props.id}`) } -function setBookOpacity(index) { - if (props.books.length > 7 && index > 3) { - return 'opacity: ' + (100 - index * 13) + '%;' - } else { +function setBookOpacityClass(index) { + const length = props.books.length + if (length < 5) { return '' + } else if (length < 8) { + if (index < 4) { + return 'opacity-' + index + } else { + return '' + } + } else { + return 'opacity-' + index } } @@ -33,9 +40,14 @@ function setBookOpacity(index) {
-
+
@@ -68,20 +80,67 @@ img { display: flex; justify-content: center; align-items: center; + text-align: center; } .collectionpreviewbooks { flex: 6; display: flex; + align-items: center; +} + +.opacity-1 { + opacity: 100%; +} + +.opacity-2 { + opacity: 100%; +} + +.opacity-3 { + opacity: 100%; +} + +.opacity-4 { + opacity: 70%; +} + +.opacity-5 { + opacity: 40%; +} + +.opacity-6 { + opacity: 20%; +} + +.opacity-7 { + opacity: 10%; } @media (max-width: 1024px) { img { - max-height: 50px; - max-width: 50px; + max-height: 75px; + max-width: 75px; } .collectionpreviewbooks { - flex: 2; + flex: 1; + margin-top: 20px; + justify-content: center; + } + .collectioncontainer { + flex-direction: column; + } + + .opacity-1 { + opacity: 70%; + } + + .opacity-2 { + opacity: 40%; + } + + .opacity-3 { + opacity: 10%; } }