1document.addEventListener("DOMContentLoaded", () => { 2 const menuAnimations = { 3 show: "slide-in-right", 4 hide: "slide-out-right", 5 }; 6 7 const menu = document.querySelector(".menu"); 8 const openMenuBtn = document.querySelector(".open-menu-btn"); 9 const closeMenuBtn = document.querySelector(".close-menu-btn"); 10 11 // Search and user container 12 const header = document.getElementById("header"); 13 const headerContainer = document.getElementById("headerContainer"); 14 const headerC = document.getElementById("header-c"); 15 16 function handleResize() { 17 setTimeout(() => { 18 if (window.innerWidth < 1024) { 19 if (!headerContainer.contains(header)) { 20 headerContainer.appendChild(header); 21 headerC.innerHTML = ""; 22 } 23 } else { 24 if (!headerC.contains(header)) { 25 headerC.appendChild(header); 26 } 27 } 28 }, 10); 29 } 30 31 // Initial check 32 handleResize(); 33 34 window.addEventListener("resize", handleResize); 35 36 [openMenuBtn, closeMenuBtn].forEach((btn) => { 37 btn.addEventListener("click", () => { 38 menu.classList.toggle("open"); 39 if (window.innerWidth < 1024) { 40 showCloseMenuMobile(); 41 } 42 menu.style.transition = "transform 0.5s ease"; 43 }); 44 }); 45 46 function showCloseMenuMobile() { 47 if (!menu.classList.contains(menuAnimations.show)) { 48 menu.classList.add(menuAnimations.show); 49 menu.classList.remove(menuAnimations.hide); 50 } else { 51 menu.classList.add(menuAnimations.hide); 52 menu.classList.remove(menuAnimations.show); 53 } 54 } 55}); 56
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.