feat(list): add thumbnail

This commit is contained in:
Kim, Jimin 2025-03-22 20:55:51 +09:00
parent be68a14777
commit a5fce32e78
Signed by: pomp
GPG key ID: 2B516173EDD492EB
3 changed files with 34 additions and 6 deletions

View file

@ -1,13 +1,39 @@
<script setup lang="ts">
type Item = {
name: string
href: string
thumbnail: string
}
const items: Item[] = [
{
name: "Content Creators",
href: "/content-creators",
thumbnail: "content-creators",
},
]
const glob = import.meta.glob("~/assets/thumbnail/*", { eager: true })
const thumbnails = Object.fromEntries(
Object.entries(glob).map(([key, value]) => [
key.split("/").pop().split(".")[0],
value.default,
]),
)
</script>
<template>
<Header highlight="anything" />
<Main>
<div class="flex gap-6">
<Card href="/content-creators" name="Content Creators">
<Icon name="logos:twitch" size="48" />
<span class="mx-2 text-3xl">/</span>
<Icon name="logos:youtube-icon" size="48" />
</Card>
<Card
v-for="(item, _index) in items"
:key="item.href"
:href="item.href"
:name="item.name"
:thumbnail="thumbnails[item.thumbnail]"
/>
</div>
</Main>
</template>