From 1d5d9c0904d644bc5bc91de1777a8bb61033e752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sat, 21 Feb 2026 20:12:26 +0100 Subject: [PATCH] feat: apply global fadeInUp animation to all page transitions --- assets/js/main.js | 8 ++++++++ author.hbs | 2 +- default.hbs | 2 +- error-404.hbs | 2 +- index.hbs | 2 +- tag.hbs | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/assets/js/main.js b/assets/js/main.js index a0d65ee..40676eb 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -20,6 +20,14 @@ document.addEventListener('DOMContentLoaded', () => { // Re-run animation and other setup when HTMX settles new content // Use document instead of document.body to persist across boosted navigation 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 const target = event.detail.target; if (target.id === 'posts-container' || target.querySelector('.post-grid-item')) { diff --git a/author.hbs b/author.hbs index eb2fccb..b1f1094 100644 --- a/author.hbs +++ b/author.hbs @@ -1,7 +1,7 @@ {{!< default}} {{#author}} -
+
{{#if cover_image}}
{{name}}'s cover image diff --git a/default.hbs b/default.hbs index 4d128fb..d0a206c 100644 --- a/default.hbs +++ b/default.hbs @@ -59,7 +59,7 @@ {{> header}} {{> scroll-top}} -
+
{{{body}}}
diff --git a/error-404.hbs b/error-404.hbs index 4c0b73e..83c3dd8 100644 --- a/error-404.hbs +++ b/error-404.hbs @@ -1,6 +1,6 @@ {{!< default}} -
+

404

Page Not Found

diff --git a/index.hbs b/index.hbs index 65d202f..8deba51 100644 --- a/index.hbs +++ b/index.hbs @@ -1,6 +1,6 @@ {{!< default}} -
+

{{@site.title}}

{{@site.description}}

diff --git a/tag.hbs b/tag.hbs index 99b1a3c..55c9426 100644 --- a/tag.hbs +++ b/tag.hbs @@ -1,7 +1,7 @@ {{!< default}} {{#tag}} -
+
Tag

{{name}}

{{#if description}}