Files
Cloud-Blog/components/archive/card.vue
nurRiyad 6f6eb242eb Update design fix
Signed-off-by: nurRiyad <asadnurriyad@gmail.com>
2023-09-02 23:43:53 +06:00

64 lines
1.8 KiB
Vue

<script lang="ts" setup>
interface Props {
path?: string
title?: string
date?: string
description?: string
image?: string
alt?: string
ogImage?: string
tags?: Array<string>
published?: boolean
}
withDefaults(defineProps<Props>(), {
path: '/',
title: 'no-title',
date: 'no-date',
description: 'no-description',
image: '/nuxt-blog/no-image_cyyits.png',
alt: 'no-alt',
ogImage: '/nuxt-blog/no-image_cyyits.png',
tags: () => [],
published: false,
})
</script>
<template>
<article class="group border m-2 rounded-2xl overflow-hidden shadow-sm text-zinc-700">
<NuxtLink :to="path" class="grid grid-cols-1 sm:grid-cols-10 gap-1">
<div class="sm:col-span-3">
<NuxtImg
class="h-full w-full object-cover object-center rounded-t-2xl sm:rounded-l-2xl sm:rounded-t-none shadow-lg group-hover:scale-[1.02] transition-all duration-500"
:src="image"
:alt="alt"
/>
</div>
<div class="sm:col-span-7 p-5">
<h2 class="text-xl font-semibold text-black pb-1 group-hover:text-sky-700">
{{ title }}
</h2>
<p class="text-ellipsis line-clamp-2">
{{ description }}
</p>
<div class="text-black text-sm mt-2 mb-1 md:flex md:space-x-6">
<div class="flex items-center">
<LogoDate />
<p> {{ date }}</p>
</div>
<div class="flex items-center gap-1 flex-wrap">
<LogoTag />
<p v-for="tag in tags" :key="tag">
{{ tag }}
</p>
</div>
</div>
<div class="flex group-hover:underline text-sky-700 items-center pt-2">
<p>Read More</p>
<LogoArrow />
</div>
</div>
</NuxtLink>
</article>
</template>