TOPVERSE_Official/components/ImageHover.vue

38 lines
1.3 KiB
Vue
Raw Normal View History

<script setup lang="ts">
$defineProps<{
img: string
topic: string
2023-06-12 16:49:37 +08:00
description?: string
href: string
2024-05-25 14:47:39 +08:00
imgClass?: string
}>()
</script>
<template>
2023-06-01 15:36:34 +08:00
<LocaleNuxtLink
:href="href"
2023-06-12 16:49:37 +08:00
class="group h-min-200px relative block h-full w-full overflow-hidden overflow-hidden rounded-lg bg-primary bg-opacity-35 shadow-lg"
>
2023-05-31 20:43:27 +08:00
<!-- <NuxtImg loading="lazy" :src="img" class="h-full w-full" fit="cover" width="300" height="180" /> -->
2023-06-12 16:49:37 +08:00
<ImageLoading :src="img" :class="imgClass" class="h-full w-full transition-all group-hover:(scale-110 blur)" />
2023-05-16 21:18:46 +08:00
<div class="mask-img h-50px bg-dark-700/70 transition-all group-hover:(h-full)">
2023-06-12 16:49:37 +08:00
<div class="flex-grow text-h6">
2023-05-16 21:18:46 +08:00
<p :title="$t(topic)" class="line-clamp-1 w-full text-white group-hover:(line-clamp-3 h-full)">
{{ $t(topic) }}
</p>
2023-06-12 16:49:37 +08:00
<small v-if="description" class="hidden group-hover:block">
{{ description }}
</small>
</div>
2023-05-16 21:18:46 +08:00
<div i-solar-arrow-right-linear mx-2 stroke-3 font-bold text-white />
</div>
2023-06-01 15:36:34 +08:00
</LocaleNuxtLink>
</template>
<style scoped>
.mask-img{
2023-06-01 15:36:34 +08:00
--uno:'absolute bottom-0 left-0 z-1 flex w-full items-center justify-center border-t-2px border-dark-50/10 p-2 px-10 transition ';
box-shadow: 0 -5px 25px rgba(0,0,0,0.4);
}
</style>