Line data Source code
1 : <template>
2 309 : <BaseThumbnail :hover-zoom="hoverZoom" :is-hovered="isHovered">
3 : <LazyImage
4 : :src="src"
5 : :alt="alt"
6 : :image-class="[
7 : 'transform-gpu transition-transform duration-300 ease-out',
8 : isVideoType
9 : ? 'w-full h-full object-cover'
10 : : 'max-w-full max-h-64 object-contain'
11 : ]"
12 : :image-style="
13 : isHovered ? { transform: `scale(${1 + hoverZoom / 100})` } : undefined
14 : "
15 : />
16 : </BaseThumbnail>
17 : </template>
18 :
19 : <script setup lang="ts">
20 : import LazyImage from '@/components/common/LazyImage.vue'
21 : import BaseThumbnail from '@/platform/workflow/templates/components/thumbnails/BaseThumbnail.vue'
22 :
23 : const { src, isVideo } = defineProps<{
24 : src: string
25 : alt: string
26 : hoverZoom: number
27 : isHovered?: boolean
28 : isVideo?: boolean
29 : }>()
30 :
31 295 : const isVideoType = isVideo ?? (src?.toLowerCase().endsWith('.webp') || false)
32 : </script>
|