Skip to content

Commit 9aa0cfe

Browse files
committed
fix: hide sidebar when footer enters viewport (steam-bell-92#1704)
1 parent a432bdc commit 9aa0cfe

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

web-app/js/main.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,15 @@ if (!pageCategory && projectsSection) {
877877
// Show sidebar when projects section is in view AND we're scrolled past hero
878878
const heroSection = document.querySelector('.hero-section');
879879
const heroBottom = heroSection ? heroSection.getBoundingClientRect().bottom : 0;
880-
const showSidebar = rect.top < window.innerHeight && window.scrollY > heroBottom - 100;
880+
// FIX ISSUE #1704: Hide the fixed sidebar when the footer enters the viewport
881+
const footer = document.querySelector(".footer");
882+
const isFooterVisible = footer
883+
? footer.getBoundingClientRect().top < window.innerHeight
884+
: false;
885+
const showSidebar =
886+
rect.top < window.innerHeight &&
887+
!isFooterVisible &&
888+
window.scrollY > heroBottom - 100;
881889

882890
document.body.classList.toggle("sidebar-active", showSidebar);
883891
console.log('Sidebar active:', showSidebar, 'scrollY:', window.scrollY, 'playgroundActive:', playgroundActive);

0 commit comments

Comments
 (0)