@@ -768,6 +768,57 @@ document.addEventListener("DOMContentLoaded", function () {
768768 }
769769 } ) ;
770770 } ) ;
771+ /* ==========================================================
772+ FIX ISSUE #1703
773+ Wire Hero Category Navigation
774+ ========================================================== */
775+
776+ const heroNavButtons = document . querySelectorAll ( ".hero-nav-btn" ) ;
777+
778+ heroNavButtons . forEach ( function ( button ) {
779+
780+ button . addEventListener ( "click" , function ( ) {
781+
782+ const category = button . dataset . category ;
783+
784+ heroNavButtons . forEach ( function ( btn ) {
785+ btn . classList . remove ( "active" ) ;
786+ } ) ;
787+
788+ button . classList . add ( "active" ) ;
789+
790+ syncSidebarTabs ( category ) ;
791+ syncStickyTabs ( category ) ;
792+
793+ if ( category === "playground" ) {
794+
795+ showPlaygroundSection ( ) ;
796+
797+ if ( playgroundSection ) {
798+ playgroundSection . scrollIntoView ( {
799+ behavior : "smooth" ,
800+ block : "start" ,
801+ } ) ;
802+ }
803+
804+ } else {
805+
806+ showProjectsSection ( ) ;
807+ applyCategoryFilter ( category ) ;
808+
809+ if ( projectsSection ) {
810+ projectsSection . scrollIntoView ( {
811+ behavior : "smooth" ,
812+ block : "start" ,
813+ } ) ;
814+ }
815+
816+ }
817+
818+ } ) ;
819+
820+ } ) ;
821+
771822
772823 /* ── Stats Cards ──────────────────────────────────────────── */
773824 var statsCards = document . querySelectorAll ( ".stats-card" ) ;
@@ -865,7 +916,15 @@ document.addEventListener("DOMContentLoaded", function () {
865916 const rect = projectsSection . getBoundingClientRect ( ) ;
866917 const heroSection = document . querySelector ( '.hero-section' ) ;
867918 const heroBottom = heroSection ? heroSection . getBoundingClientRect ( ) . bottom : 0 ;
868- const showSidebar = rect . top < window . innerHeight && window . scrollY > heroBottom - 100 ;
919+ // FIX ISSUE #1704: Hide the fixed sidebar when the footer enters the viewport
920+ const footer = document . querySelector ( ".footer" ) ;
921+ const isFooterVisible = footer
922+ ? footer . getBoundingClientRect ( ) . top < window . innerHeight
923+ : false ;
924+ const showSidebar =
925+ rect . top < window . innerHeight &&
926+ ! isFooterVisible &&
927+ window . scrollY > heroBottom - 100 ;
869928
870929 document . body . classList . toggle ( "sidebar-active" , showSidebar ) ;
871930 console . log ( 'Sidebar active:' , showSidebar , 'scrollY:' , window . scrollY , 'playgroundActive:' , playgroundActive ) ;
0 commit comments