feat(list): add header text swap effect

This commit is contained in:
Kim, Jimin 2025-03-22 22:06:34 +09:00
parent a5fce32e78
commit 7ef199ec0e
Signed by: pomp
GPG key ID: D3932F82A0667A3B
2 changed files with 34 additions and 10 deletions

View file

@ -7,12 +7,15 @@ type Item = {
const items: Item[] = [
{
name: "Content Creators",
name: "Content creators",
href: "/content-creators",
thumbnail: "content-creators",
},
]
const highlight = ref("anything")
// https://www.lichter.io/articles/nuxt3-vue3-dynamic-images/
const glob = import.meta.glob("~/assets/thumbnail/*", { eager: true })
const thumbnails = Object.fromEntries(
Object.entries(glob).map(([key, value]) => [
@ -23,12 +26,14 @@ const thumbnails = Object.fromEntries(
</script>
<template>
<Header highlight="anything" />
<Header :highlight="highlight" />
<Main>
<div class="flex gap-6">
<Card
v-for="(item, _index) in items"
@mouseenter="highlight = item.name"
@mouseleave="highlight = 'anything'"
:key="item.href"
:href="item.href"
:name="item.name"