add animated hero text to index page (#13)

This commit is contained in:
Troy 2025-01-05 18:49:48 +00:00 committed by GitHub
parent fe60d3846f
commit 4079f9e872
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 141 additions and 87 deletions

View file

@ -18,43 +18,43 @@ const prev = items[(index - 1 + items.length) % items.length];
const next = items[(index + 1) % items.length];
---
<div
class="mx-auto mt-8 flex max-w-prose flex-col justify-between gap-4 md:flex-row md:gap-0"
>
<div class="group flex w-fit flex-row items-center justify-between gap-6">
<a
href={`/${prev.collection}/${prev.slug}`}
class="animate-reveal rounded-full bg-secondary p-1 opacity-0 transition-colors group-hover:bg-tertiary"
>
<Icon
name="mdi:arrow-left"
title="All projects"
class="h-4 w-auto text-primary"
/>
</a>
<a href={`/${prev.collection}/${prev.slug}`}>
<p class="animate-reveal break-words text-xl font-medium opacity-0">
{prev.data.title}
</p>
</a>
</div>
<div
class="group flex w-fit flex-row items-center justify-between gap-6 self-end"
>
<a href={`/${next.collection}/${next.slug}`}>
<p class="animate-reveal break-words text-xl font-medium opacity-0">
{next.data.title}
</p>
</a>
<a
href={`/${next.collection}/${next.slug}`}
class="animate-reveal rounded-full bg-secondary p-1 opacity-0 transition-colors group-hover:bg-tertiary"
>
<Icon
name="mdi:arrow-right"
title="All projects"
class="h-4 w-auto text-primary"
/>
</a>
</div>
</div>
{
items.length > 1 ? (
<div class="mx-auto mt-8 flex max-w-prose justify-between gap-4 md:gap-0">
<div class="group flex w-fit flex-row items-center justify-between gap-2">
<a
href={`/${prev.collection}/${prev.slug}`}
class="animate-reveal opacity-0"
>
<Icon
name="mdi:arrow-left"
title="All projects"
class="h-4 w-auto text-tertiary transition-colors duration-300 group-hover:text-accent"
/>
</a>
<a href={`/${prev.collection}/${prev.slug}`}>
<p class="animate-reveal break-words text-xl font-medium text-tertiary opacity-0 transition-colors duration-300 group-hover:text-accent">
{prev.data.title}
</p>
</a>
</div>
<div class="group flex w-fit flex-row items-center justify-between gap-2 self-end">
<a href={`/${next.collection}/${next.slug}`}>
<p class="animate-reveal break-words text-xl font-medium text-tertiary opacity-0 transition-colors duration-300 group-hover:text-accent">
{next.data.title}
</p>
</a>
<a
href={`/${next.collection}/${next.slug}`}
class="animate-reveal opacity-0"
>
<Icon
name="mdi:arrow-right"
title="All projects"
class="h-4 w-auto text-tertiary transition-colors duration-300 group-hover:text-accent"
/>
</a>
</div>
</div>
) : null
}