document.addEventListener("DOMContentLoaded", function () { /* cite: 74 */ // نشتغل فقط على الكمبيوتر if (window.innerWidth < 992) return; /* cite: 74 */ const headers = document.querySelectorAll('.header-container.container'); /* cite: 74 */ headers.forEach(header => { const computedStyle = window.getComputedStyle(header); /* cite: 74 */ const position = computedStyle.getPropertyValue('position'); /* cite: 74 */ // نجرب نعرف إذا كان فعلاً sticky أو fixed عن طريق top position const rect = header.getBoundingClientRect(); /* cite: 74 */ const isSticky = position === 'fixed' || position === 'sticky' || rect.top === 0; /* cite: 74 */ if (!isSticky) { const menu = document.createElement('div'); /* cite: 74 */ menu.className = 'custom-mega-menu'; /* cite: 74 */ menu.innerHTML = `
`; `; /* cite: 76 */ header.parentNode.insertBefore(menu, header.nextSibling); /* cite: 76 */ } }); const style = document.createElement('style'); /* cite: 77 */ style.innerHTML = ` .custom-mega-menu { background-color: #36564d; /* cite: 78 */ padding: 15px 0; /* cite: 78 */ text-align: center; /* cite: 78 */ z-index: 9999; /* cite: 78 */ } .menu-items { list-style: none; /* cite: 79 */ margin: 0; /* cite: 79 */ padding: 0; /* cite: 79 */ display: flex; /* cite: 79 */ justify-content: center; /* cite: 79 */ gap: 40px; /* cite: 80 */ } .menu-items li { position: relative; /* cite: 81 */ } .menu-items a { color: #ccc; /* cite: 82 */ text-decoration: none; /* cite: 82 */ font-size: 16px; /* cite: 82 */ padding: 8px 12px; /* cite: 83 */ display: inline-block; /* cite: 83 */ transition: color 0.3s; /* cite: 83 */ } .menu-items a:hover { color: #fff; /* cite: 84 */ } .menu-items a::after { content: ""; /* cite: 85 */ position: absolute; /* cite: 85 */ left: 0; /* cite: 85 */ bottom: 0; /* cite: 85 */ width: 100%; /* cite: 85 */ height: 3px; /* cite: 85 */ background-color: #f9ae34; /* cite: 86 */ transform: scaleX(0); /* cite: 86 */ transform-origin: left; /* cite: 86 */ transition: transform 0.3s ease; /* cite: 86 */ } .menu-items a:hover::after { transform: scaleX(1); /* cite: 87 */ } `; document.head.appendChild(style); /* cite: 87 */ // تغيير الألوان برمجياً (مثال - يمكن تعديل القيمة #new-color) document.documentElement.style.setProperty('--primary-color', '#ec6233'); /* cite: 88 */ });