From 019b59602f32829cff78f8bda5666e3a62844d85 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Thu, 15 Jan 2026 00:00:45 +0100 Subject: [PATCH] wip --- src/pages/index.astro | 151 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 142 insertions(+), 9 deletions(-) diff --git a/src/pages/index.astro b/src/pages/index.astro index 3f65c73..9929b0e 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -18,8 +18,29 @@ const allTags = [...new Set(allPosts.flatMap(post => post.tags))]; -
-
+
+ +
+ + +
+
+
+ + + + + + + + + +
+
+
+
+ +

Marc Mintel @@ -168,18 +189,35 @@ const allTags = [...new Set(allPosts.flatMap(post => post.tags))]; // Smooth transition to blog post with Framer Motion-style animation const postLinks = document.querySelectorAll('.post-link') as NodeListOf; - + postLinks.forEach(link => { link.addEventListener('click', (e) => { e.preventDefault(); - + const href = link.getAttribute('href'); if (!href || !transitionOverlay) return; - + // Get post data for potential future use const slug = link.getAttribute('data-slug'); const title = link.getAttribute('data-title'); - + + // Capture title position for layout animation + const titleElement = link.querySelector('[data-post-title]') as HTMLElement; + if (titleElement && slug) { + const rect = titleElement.getBoundingClientRect(); + const titleData = { + text: titleElement.textContent || '', + x: rect.left, + y: rect.top, + width: rect.width, + height: rect.height, + fontSize: window.getComputedStyle(titleElement).fontSize, + fontWeight: window.getComputedStyle(titleElement).fontWeight, + color: window.getComputedStyle(titleElement).color + }; + sessionStorage.setItem(`title-position-${slug}`, JSON.stringify(titleData)); + } + // Add click ripple effect to the card const card = link.querySelector('.post-card') as HTMLElement; if (card) { @@ -189,12 +227,12 @@ const allTags = [...new Set(allPosts.flatMap(post => post.tags))]; card.style.transform = 'scale(1)'; }, 150); } - + // Framer Motion-style page transition // 1. Fade in overlay transitionOverlay.style.opacity = '1'; transitionOverlay.style.pointerEvents = 'auto'; - + // 2. Scale down current content const mainContent = document.querySelector('main'); if (mainContent) { @@ -202,7 +240,7 @@ const allTags = [...new Set(allPosts.flatMap(post => post.tags))]; mainContent.style.transform = 'scale(0.95)'; mainContent.style.opacity = '0'; } - + // 3. Navigate after animation setTimeout(() => { window.location.href = href; @@ -396,5 +434,100 @@ const allTags = [...new Set(allPosts.flatMap(post => post.tags))]; transition-duration: 0.01ms !important; } } + + /* Animated gradient shift */ + @keyframes gradient-shift { + 0%, 100% { background-position: 0% 50%; } + 50% { background-position: 100% 50%; } + } + + .animate-gradient-shift { + background-size: 200% 200%; + animation: gradient-shift 20s ease infinite; + } + + /* Floating animations */ + @keyframes float-1 { + 0%, 100% { transform: translateY(0px) rotate(0deg); } + 50% { transform: translateY(-20px) rotate(180deg); } + } + + .animate-float-1 { + animation: float-1 15s ease-in-out infinite; + } + + @keyframes float-2 { + 0%, 100% { transform: translateY(0px) rotate(0deg); } + 50% { transform: translateY(-15px) rotate(90deg); } + } + + .animate-float-2 { + animation: float-2 18s ease-in-out infinite; + } + + @keyframes float-3 { + 0%, 100% { transform: translateY(0px) scale(1); } + 50% { transform: translateY(-10px) scale(1.1); } + } + + .animate-float-3 { + animation: float-3 12s ease-in-out infinite; + } + + @keyframes float-4 { + 0%, 100% { transform: translateY(0px) rotate(0deg); } + 50% { transform: translateY(-25px) rotate(-90deg); } + } + + .animate-float-4 { + animation: float-4 20s ease-in-out infinite; + } + + /* Morphing blob animation */ + @keyframes morph { + 0%, 100% { + border-radius: 50%; + transform: scale(1) rotate(0deg); + } + 25% { + border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; + transform: scale(1.1) rotate(90deg); + } + 50% { + border-radius: 20% 80% 20% 80% / 80% 20% 80% 20%; + transform: scale(0.9) rotate(180deg); + } + 75% { + border-radius: 70% 30% 50% 50% / 50% 70% 30% 50%; + transform: scale(1.05) rotate(270deg); + } + } + + .animate-morph { + animation: morph 25s ease-in-out infinite; + } + + /* Drawing animations */ + @keyframes draw { + to { stroke-dashoffset: 0; } + } + + .animate-draw { + stroke-dasharray: 200; + stroke-dashoffset: 200; + animation: draw 8s ease-in-out infinite alternate; + } + + .animate-draw-delay { + stroke-dasharray: 200; + stroke-dashoffset: 200; + animation: draw 8s ease-in-out infinite alternate 4s; + } + + .animate-draw-reverse { + stroke-dasharray: 200; + stroke-dashoffset: 200; + animation: draw 8s ease-in-out infinite alternate-reverse 2s; + } \ No newline at end of file