fix: correct calendar navigation sticky positioning
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -140,7 +140,7 @@ const search = url.searchParams.get('search');
|
||||
</section>
|
||||
|
||||
<!-- Premium Filter Controls -->
|
||||
<section class="sticky top-0 z-50 backdrop-blur-xl shadow-2xl" data-filter-controls style="background: var(--glass-bg-lg); border-bottom: 1px solid var(--glass-border);">
|
||||
<section class="sticky backdrop-blur-xl shadow-2xl" data-filter-controls style="background: var(--glass-bg-lg); border-bottom: 1px solid var(--glass-border); top: var(--hero-height, 0px); z-index: 45;">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4">
|
||||
<div class="flex flex-col lg:flex-row items-start lg:items-center justify-between gap-4">
|
||||
<!-- View Toggle - Premium Design -->
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user