@@ -776,6 +776,57 @@ document.addEventListener("DOMContentLoaded", function () {
776776 }
777777 } ) ;
778778 } ) ;
779+ /* ==========================================================
780+ FIX ISSUE #1703
781+ Wire Hero Category Navigation
782+ ========================================================== */
783+
784+ const heroNavButtons = document . querySelectorAll ( ".hero-nav-btn" ) ;
785+
786+ heroNavButtons . forEach ( function ( button ) {
787+
788+ button . addEventListener ( "click" , function ( ) {
789+
790+ const category = button . dataset . category ;
791+
792+ heroNavButtons . forEach ( function ( btn ) {
793+ btn . classList . remove ( "active" ) ;
794+ } ) ;
795+
796+ button . classList . add ( "active" ) ;
797+
798+ syncSidebarTabs ( category ) ;
799+ syncStickyTabs ( category ) ;
800+
801+ if ( category === "playground" ) {
802+
803+ showPlaygroundSection ( ) ;
804+
805+ if ( playgroundSection ) {
806+ playgroundSection . scrollIntoView ( {
807+ behavior : "smooth" ,
808+ block : "start" ,
809+ } ) ;
810+ }
811+
812+ } else {
813+
814+ showProjectsSection ( ) ;
815+ applyCategoryFilter ( category ) ;
816+
817+ if ( projectsSection ) {
818+ projectsSection . scrollIntoView ( {
819+ behavior : "smooth" ,
820+ block : "start" ,
821+ } ) ;
822+ }
823+
824+ }
825+
826+ } ) ;
827+
828+ } ) ;
829+
779830
780831 /* ── Stats Cards ──────────────────────────────────────────── */
781832 var statsCards = document . querySelectorAll ( ".stats-card" ) ;
@@ -877,7 +928,15 @@ if (!pageCategory && projectsSection) {
877928 // Show sidebar when projects section is in view AND we're scrolled past hero
878929 const heroSection = document . querySelector ( '.hero-section' ) ;
879930 const heroBottom = heroSection ? heroSection . getBoundingClientRect ( ) . bottom : 0 ;
880- const showSidebar = rect . top < window . innerHeight && window . scrollY > heroBottom - 100 ;
931+ // FIX ISSUE #1704: Hide the fixed sidebar when the footer enters the viewport
932+ const footer = document . querySelector ( ".footer" ) ;
933+ const isFooterVisible = footer
934+ ? footer . getBoundingClientRect ( ) . top < window . innerHeight
935+ : false ;
936+ const showSidebar =
937+ rect . top < window . innerHeight &&
938+ ! isFooterVisible &&
939+ window . scrollY > heroBottom - 100 ;
881940
882941 document . body . classList . toggle ( "sidebar-active" , showSidebar ) ;
883942 console . log ( 'Sidebar active:' , showSidebar , 'scrollY:' , window . scrollY , 'playgroundActive:' , playgroundActive ) ;
0 commit comments