Center horizontally for small width videos

This commit is contained in:
Azri Kahar
2022-07-22 18:10:11 +08:00
parent bec3d0e16e
commit 9326399ba6

View File

@@ -1,5 +1,9 @@
<template>
<div v-if="type && !imgError" class="file-preview" :class="{ modal: inModal, small: isSmall, svg: isSVG }">
<div
v-if="type && !imgError"
class="file-preview"
:class="{ modal: inModal, small: isSmall, svg: isSVG, centered: type === 'video' }"
>
<div v-if="type === 'image'" class="image" @click="$emit('click')">
<v-image :src="src" :width="width" :height="height" :alt="title" @error="imgError = true" />
</div>
@@ -65,6 +69,11 @@ const authenticatedSrc = computed(() => addTokenToURL(props.src));
position: relative;
max-width: calc((var(--form-column-max-width) * 2) + var(--form-horizontal-gap));
&.centered {
display: flex;
justify-content: center;
}
img,
video {
width: auto;