Fix modal to always be 16:9 aspect ratio

This commit is contained in:
Michael Winter 2026-03-08 18:21:45 +01:00
parent 96e81b12c3
commit e5e4dca8e4
3 changed files with 20 additions and 25 deletions

View file

@ -1,15 +1,12 @@
<template>
<div class="flex flex-col h-full">
<div class="flex flex-col h-full w-full">
<div class="flex-1 flex items-center justify-center min-h-0">
<div class="w-full max-w-[80vw] aspect-video" style="height: 50vh;">
<!-- Image -->
<NuxtImg
v-if="gallery[currentIndex]"
:src="'/' + bucket + '/' + gallery[currentIndex].image"
class="w-full h-full object-contain"
/>
</div>
</div>
<!-- Dots indicator -->
<div v-if="gallery.length > 1" class="flex-none flex gap-2 py-2 justify-center">

View file

@ -7,7 +7,7 @@
<!-- Modal Panel -->
<div class="fixed inset-0 flex items-center justify-center pointer-events-none">
<div
class="bg-white rounded-lg shadow-xl max-w-[80vw] max-h-[85vh] overflow-hidden relative pointer-events-auto"
class="bg-white rounded-lg shadow-xl w-[80vw] aspect-video max-h-[85vh] overflow-hidden relative pointer-events-auto"
:style="{ maxHeight }"
>
<!-- Content -->

View file

@ -87,8 +87,7 @@
<iframe :src="modalStore.soundcloudUrl" class="w-64" height="20px" scrolling="no" frameborder="no" allow="autoplay"></iframe>
</ClientOnly>
</div>
<div v-if="modalStore.type === 'video'" class="flex-1 flex items-center justify-center min-h-0">
<div class="w-full max-w-[80vw] aspect-video" style="height: 50vh;">
<div v-if="modalStore.type === 'video'" class="w-full h-full flex items-center justify-center">
<ClientOnly>
<iframe
:src="'https://player.vimeo.com/video/' + modalStore.vimeo_trackid"
@ -102,7 +101,6 @@
></iframe>
</ClientOnly>
</div>
</div>
<div v-if="modalStore.type === 'document'" class="w-full flex flex-col h-[70vh]">
<ClientOnly>
<iframe :src="modalStore.iframeUrl" width="100%" height="100%" frameborder="0" class="flex-grow"></iframe>