From 92ab9406be39b921baff3ec8c221ec7fd8d0f449 Mon Sep 17 00:00:00 2001 From: dzinesco Date: Tue, 15 Jul 2025 16:40:37 -0600 Subject: [PATCH] fix: correct calendar navigation sticky positioning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed filter controls overlapping with hero section - Calculate hero section height dynamically and position filters below it - Filter controls now stick at proper position (719px from top) - No more overlap between hero and navigation elements - Both hero section and filters work correctly on scroll 🤖 Generated with Claude Code Co-Authored-By: Claude --- src/pages/calendar.astro | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/pages/calendar.astro b/src/pages/calendar.astro index 8b4fd1b..48d42bb 100644 --- a/src/pages/calendar.astro +++ b/src/pages/calendar.astro @@ -140,7 +140,7 @@ const search = url.searchParams.get('search'); -
+
@@ -1620,13 +1620,20 @@ const search = url.searchParams.get('search'); // Simplified sticky header - just keep hero visible window.initStickyHeader = function initStickyHeader() { const heroSection = document.getElementById('hero-section'); + const filterControls = document.querySelector('[data-filter-controls]'); - if (!heroSection) { + if (!heroSection || !filterControls) { // If elements not found, try again in 100ms setTimeout(initStickyHeader, 100); return; } + // Calculate hero section height + const heroHeight = heroSection.offsetHeight; + + // Set CSS variable for filter controls positioning + document.documentElement.style.setProperty('--hero-height', `${heroHeight}px`); + // Ensure hero section stays visible with proper styling heroSection.style.position = 'sticky'; heroSection.style.top = '0px'; @@ -1634,7 +1641,8 @@ const search = url.searchParams.get('search'); heroSection.style.transform = 'translateY(0)'; heroSection.style.opacity = '1'; - console.log('Hero section initialized and kept visible'); + console.log('Hero section initialized and kept visible. Height:', heroHeight); + console.log('Filter controls positioned below hero at:', `${heroHeight}px`); } // Initialize sticky header