feat: apply global fadeInUp animation to all page transitions
All checks were successful
Deploy Theme / deploy (push) Successful in 16s
All checks were successful
Deploy Theme / deploy (push) Successful in 16s
This commit is contained in:
@@ -20,6 +20,14 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
// Re-run animation and other setup when HTMX settles new content
|
// Re-run animation and other setup when HTMX settles new content
|
||||||
// Use document instead of document.body to persist across boosted navigation
|
// Use document instead of document.body to persist across boosted navigation
|
||||||
document.addEventListener('htmx:afterSettle', (event) => {
|
document.addEventListener('htmx:afterSettle', (event) => {
|
||||||
|
// Global page fade-in animation
|
||||||
|
const mainContent = document.getElementById('main-content');
|
||||||
|
if (mainContent) {
|
||||||
|
mainContent.classList.remove('animate-fadeInUp');
|
||||||
|
void mainContent.offsetWidth; // Force reflow to restart animation
|
||||||
|
mainContent.classList.add('animate-fadeInUp');
|
||||||
|
}
|
||||||
|
|
||||||
// If the settled element is the posts-container or contains grid items
|
// If the settled element is the posts-container or contains grid items
|
||||||
const target = event.detail.target;
|
const target = event.detail.target;
|
||||||
if (target.id === 'posts-container' || target.querySelector('.post-grid-item')) {
|
if (target.id === 'posts-container' || target.querySelector('.post-grid-item')) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{{!< default}}
|
{{!< default}}
|
||||||
|
|
||||||
{{#author}}
|
{{#author}}
|
||||||
<header class="author-header relative w-full mb-12 animate-fadeInUp">
|
<header class="author-header relative w-full mb-12">
|
||||||
{{#if cover_image}}
|
{{#if cover_image}}
|
||||||
<div class="w-full h-64 md:h-96 relative overflow-hidden">
|
<div class="w-full h-64 md:h-96 relative overflow-hidden">
|
||||||
<img class="w-full h-full object-cover opacity-40 grayscale hover:grayscale-0 transition-all duration-700" src="{{img_url cover_image size="xl"}}" alt="{{name}}'s cover image">
|
<img class="w-full h-full object-cover opacity-40 grayscale hover:grayscale-0 transition-all duration-700" src="{{img_url cover_image size="xl"}}" alt="{{name}}'s cover image">
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
{{> header}}
|
{{> header}}
|
||||||
{{> scroll-top}}
|
{{> scroll-top}}
|
||||||
|
|
||||||
<main id="main-content" class="flex-grow">
|
<main id="main-content" class="flex-grow animate-fadeInUp">
|
||||||
{{{body}}}
|
{{{body}}}
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{{!< default}}
|
{{!< default}}
|
||||||
|
|
||||||
<section class="container mx-auto px-4 py-20 md:py-32 flex flex-col items-center justify-center text-center animate-fadeInUp">
|
<section class="container mx-auto px-4 py-20 md:py-32 flex flex-col items-center justify-center text-center">
|
||||||
<h1 class="text-9xl font-bold tracking-tighter text-[var(--brand-primary)] opacity-20 mb-4">404</h1>
|
<h1 class="text-9xl font-bold tracking-tighter text-[var(--brand-primary)] opacity-20 mb-4">404</h1>
|
||||||
<h2 class="text-4xl md:text-6xl font-bold mb-12">Page Not Found</h2>
|
<h2 class="text-4xl md:text-6xl font-bold mb-12">Page Not Found</h2>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{{!< default}}
|
{{!< default}}
|
||||||
|
|
||||||
<header class="container mx-auto px-4 py-16 md:py-24 text-center animate-fadeInUp">
|
<header class="container mx-auto px-4 py-16 md:py-24 text-center">
|
||||||
<h1 class="text-6xl md:text-8xl font-bold tracking-tighter text-[var(--brand-primary)] mb-4">{{@site.title}}</h1>
|
<h1 class="text-6xl md:text-8xl font-bold tracking-tighter text-[var(--brand-primary)] mb-4">{{@site.title}}</h1>
|
||||||
<p class="mt-4 text-xl md:text-2xl text-[var(--text-secondary)] max-w-2xl mx-auto font-serif italic italic opacity-90">{{@site.description}}</p>
|
<p class="mt-4 text-xl md:text-2xl text-[var(--text-secondary)] max-w-2xl mx-auto font-serif italic italic opacity-90">{{@site.description}}</p>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
2
tag.hbs
2
tag.hbs
@@ -1,7 +1,7 @@
|
|||||||
{{!< default}}
|
{{!< default}}
|
||||||
|
|
||||||
{{#tag}}
|
{{#tag}}
|
||||||
<header class="container mx-auto px-4 py-16 md:py-24 text-center animate-fadeInUp">
|
<header class="container mx-auto px-4 py-16 md:py-24 text-center">
|
||||||
<span class="text-xs uppercase tracking-[0.3em] text-[var(--text-tertiary)] mb-4 block">Tag</span>
|
<span class="text-xs uppercase tracking-[0.3em] text-[var(--text-tertiary)] mb-4 block">Tag</span>
|
||||||
<h1 class="text-6xl md:text-8xl font-bold tracking-tighter text-[var(--brand-primary)] mb-4">{{name}}</h1>
|
<h1 class="text-6xl md:text-8xl font-bold tracking-tighter text-[var(--brand-primary)] mb-4">{{name}}</h1>
|
||||||
{{#if description}}
|
{{#if description}}
|
||||||
|
|||||||
Reference in New Issue
Block a user