web / components /VodCard.vue
hanbinsite's picture
feat: implement all web pages with player, search, favorites, auth, useApi composable
dfa6264
Raw History Blame Contribute Delete
1.23 kB
<template>
<NuxtLink :to="`/vod/${vod.id}`" class="group block cursor-pointer">
<div class="aspect-[2/3] rounded-lg overflow-hidden bg-gray-800 relative">
<img
v-if="vod.cover"
:src="vod.cover"
:alt="vod.name"
loading="lazy"
class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"
/>
<div v-else class="w-full h-full flex items-center justify-center text-gray-600 text-xs">
{{ vod.name }}
</div>
<span
v-if="vod.remarks"
class="absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent px-2 py-1 text-xs text-white truncate"
>
{{ vod.remarks }}
</span>
</div>
<div class="mt-2 px-0.5">
<p class="text-sm text-white truncate group-hover:text-emerald-400 transition">{{ vod.name }}</p>
<p class="text-xs text-gray-500 mt-0.5">
<span v-if="vod.score" class="text-amber-400">{{ vod.score }}分</span>
<span v-if="vod.year" class="ml-1">{{ vod.year }}</span>
</p>
</div>
</NuxtLink>
</template>
<script setup lang="ts">
import type { VodUserItem } from '~/types/vod'
defineProps<{ vod: VodUserItem }>()
</script>