feat(gallery): improve responsivity

This commit is contained in:
2026-01-03 21:56:37 +01:00
parent ae2239d17e
commit cc2e312108
3 changed files with 51 additions and 15 deletions

View File

@@ -35,3 +35,7 @@
body { body {
background: #000000; background: #000000;
} }
@theme {
--breakpoint-xs: 30rem;
}

View File

@@ -37,11 +37,12 @@ const getPlaceholder = (image: InternalApi["/api/gallery"]["get"][number]) => {
<template #body> <template #body>
<div class="relative flex flex-col items-center justify-center"> <div class="relative flex flex-col items-center justify-center">
<UCarousel <UCarousel
ref="carousel"
v-slot="{ item, index }" v-slot="{ item, index }"
:start-index="props.initialIndex" :start-index="props.initialIndex"
:items="images" :items="images"
:ui="{ :ui="{
item: 'flex-shrink-0 h-screen flex flex-col items-center justify-center select-none', item: 'relative flex-shrink-0 h-screen flex flex-col items-center justify-center select-none',
}" }"
arrows arrows
:prev="{ :prev="{
@@ -65,13 +66,12 @@ const getPlaceholder = (image: InternalApi["/api/gallery"]["get"][number]) => {
:src="item.url" :src="item.url"
:width="1920" :width="1920"
:placeholder="getPlaceholder(item)" :placeholder="getPlaceholder(item)"
:fetchpriority="index === currentIndex ? 'high' : 'low'" class="xs:max-w-[95vw] sm:max-w-[90vw] md:h-[80vh] object-contain rounded-sm"
class="max-w-[90vw] h-[80vh] object-contain rounded-sm"
/> />
<!-- metadata --> <!-- metadata -->
<div <p
class="px-4 py-2 text-sm font-mono text-white flex flex-wrap items-center justify-center gap-2" class="font-[JetBrains_Mono] text-xs lg:text-sm bottom-13 absolute invisible md:visible"
> >
<span>{{ new Date(item.exif.date).toLocaleDateString() }}</span> <span>{{ new Date(item.exif.date).toLocaleDateString() }}</span>
<span class="text-white/50"> | </span> <span class="text-white/50"> | </span>
@@ -79,11 +79,44 @@ const getPlaceholder = (image: InternalApi["/api/gallery"]["get"][number]) => {
<span class="text-white/50"> | </span> <span class="text-white/50"> | </span>
<span>{{ item.exif.lens }}</span> <span>{{ item.exif.lens }}</span>
<span class="text-white/50"> | </span> <span class="text-white/50"> | </span>
<span>{{ item.exif.settings.aperture }}</span> <span
<span>{{ item.exif.settings.shutter }}</span> >{{ item.exif.settings.aperture }}
<span>ISO {{ item.exif.settings.iso }}</span> {{ item.exif.settings.shutter }} ISO {{ item.exif.settings.iso }}
<span>{{ item.exif.settings.focalLength }}</span> {{ item.exif.settings.focalLength }}</span
</div> >
</p>
<p
class="font-[JetBrains_Mono] text-xs bottom-16 absolute sm:invisible text-center"
>
<span>- {{ new Date(item.exif.date).toLocaleDateString() }} -</span>
<br />
<span>{{ item.exif.camera }}</span>
<br />
<span>{{ item.exif.lens }}</span>
<br />
<span
>{{ item.exif.settings.aperture }}
{{ item.exif.settings.shutter }} ISO {{ item.exif.settings.iso }}
{{ item.exif.settings.focalLength }}</span
>
</p>
<p
class="font-[JetBrains_Mono] text-xs bottom-13 absolute invisible sm:visible md:invisible text-center"
>
<span>{{ new Date(item.exif.date).toLocaleDateString() }}</span>
<span class="text-white/50"> | </span>
<span>{{ item.exif.camera }}</span>
<span class="text-white/50"> | </span>
<span>{{ item.exif.lens }}</span>
<br />
<span
>{{ item.exif.settings.aperture }}
{{ item.exif.settings.shutter }} ISO {{ item.exif.settings.iso }}
{{ item.exif.settings.focalLength }}</span
>
</p>
</UCarousel> </UCarousel>
<UButton <UButton
@@ -91,7 +124,7 @@ const getPlaceholder = (image: InternalApi["/api/gallery"]["get"][number]) => {
color="neutral" color="neutral"
variant="link" variant="link"
size="xl" size="xl"
class="absolute top-6 right-6" class="absolute top-2 right-2 lg:top-4 lg:right-4 xl:top-6 xl:rizght-6"
aria-label="Close modal" aria-label="Close modal"
@click="emit('close', currentIndex)" @click="emit('close', currentIndex)"
/> />

View File

@@ -224,7 +224,6 @@ onMounted(() => {
:src="image.url" :src="image.url"
:width="600" :width="600"
:custom="true" :custom="true"
:fetchpriority="isModalOpen ? 'low' : 'auto'"
> >
<img <img
v-if="isLoaded" v-if="isLoaded"