Improved mobile artist carousels

This commit is contained in:
lucast committed 2026-10-06 04:00:14 +02:00
1 parent f202f07585
commit 1fce02ad84
4 files changed
+95 -9

No files matched your search

+14 -1
View File
@@ -4,13 +4,14 @@ import type { Album } from "@/utils/types"
type AlbumProps = Omit<Omit<Album, "genre">, "artists"> & {
artists: Array<Omit<Artist, "file">>
genre?: Genre
carousel?: boolean
}
const props = defineProps<AlbumProps>()
</script>
<template>
<article class="card">
<article class="card" :class="{ carousel: props.carousel }">
<NuxtLink :to="`/album/${props._id}`">
<NuxtImg
:src="props.file"
@@ -48,4 +49,16 @@ const props = defineProps<AlbumProps>()
}
}
}
@media (max-width: 767px) {
.card.carousel {
min-width: 0;
max-width: none;
flex: 0 0 calc(45.455% - 9.091px);
& > a > img {
width: 100%;
}
}
}
</style>
+1
View File
@@ -49,6 +49,7 @@ onMounted(async () => {
:file="GET_FILE(album.file)"
:artists="album.artists"
:_id="album._id"
carousel
/>
</Slider>
</template>
+13
View File
@@ -126,4 +126,17 @@ onMounted(() => {
.right {
right: -48px;
}
@media (max-width: 767px) {
.left,
.right {
display: none;
}
.slider {
-webkit-overflow-scrolling: touch;
overscroll-behavior-x: contain;
scroll-padding-inline: 0.25rem;
}
}
</style>