`; $('body').append(sidebarHTML); syncSidebarUI(); // 2. REVERTED NAVIGATION LOGIC: The version that worked $(document).on('click', '.close-sidebar-btn, #sidebar-toggle', function(e) { var btn = $(this); var isAtHome = $('body').hasClass('home') || window.location.pathname === '/' || window.location.pathname === ''; if (btn.hasClass('close-sidebar-btn')) { if (isAtHome) { e.preventDefault(); $('#custom-sidebar').addClass('is-closed'); syncSidebarUI(); } else { // Force hard refresh only for the Portfolio button when not home e.preventDefault(); window.location.assign('https://shaneoshea.com'); } } else { $('#custom-sidebar').toggleClass('is-closed'); syncSidebarUI(); } }); // KILLS PROJECT GRID LINKS BUT SAVES THE GIF $(document).on('click', '.pg-link, .pg-title-link', function(e) { e.preventDefault(); return false; }); function syncSidebarUI() { var sidebar = $('#custom-sidebar'); var body = $('body'); var toggle = $('#sidebar-toggle'); if (sidebar.hasClass('is-closed')) { toggle.text('→'); body.removeClass('sidebar-open'); } else { toggle.text('←'); if ($(window).width() > 1200) { body.addClass('sidebar-open'); } } } $(window).on('semplice_page_loaded', function() { var isAtHome = $('body').hasClass('home') || window.location.pathname === '/' || window.location.pathname === ''; if (isAtHome && $(window).width() > 1200) { $('#custom-sidebar').removeClass('is-closed'); syncSidebarUI(); } }); // The Status Bar Janitor setInterval(function() { $('.pg-link, .pg-title-link').removeAttr('href'); }, 1000); }); })(jQuery);