/* Add custom Js styles below */ document.addEventListener("DOMContentLoaded", function () { // جميع العناصر داخل السلايدر const slides = document.querySelectorAll(".swiper-slide .slide--cat-entry"); if (!slides.length) return; // روابط الصور (بدّلها بروابط صورك) const icons = [ "https://i.postimg.cc/CLGKsJtY/Untitled-4.webp", // إدارة الوجهات "https://i.postimg.cc/T3T37gMv/Untitled-2.webp", // النقل والحجوزات "https://i.postimg.cc/BnJnYH9q/Untitled-3-1.webp", // السياحة العلاجية "https://i.postimg.cc/mgTgXCfM/Untitled-1-1.webp" // الفعاليات والمؤتمرات ]; slides.forEach((slide, index) => { if (icons[index]) { // إنشاء صورة جديدة const img = document.createElement("img"); img.src = icons[index]; img.alt = "icon"; img.classList.add("custom-icon"); // إدراجها قبل العنوان const heading = slide.querySelector("h2"); slide.insertBefore(img, heading); } }); }); document.addEventListener("DOMContentLoaded", function () { const cartSummary = document.querySelector(".header .salla-cart-summary"); if (cartSummary) { // إنشاء الحاوية الجديدة للأيقونات const iconsContainer = document.createElement("div"); iconsContainer.classList.add("custom-header-icons"); // إنشاء كل أيقونة const langIcon = document.createElement("span"); langIcon.classList.add("custom-lang-icon"); const searchIcon = document.createElement("span"); searchIcon.classList.add("custom-search-icon"); const loginIcon = document.createElement("span"); loginIcon.classList.add("custom-login-icon"); const cartIcon = document.createElement("span"); cartIcon.classList.add("custom-cart-icon"); // إضافتها بالترتيب الذي تريده iconsContainer.appendChild(langIcon); iconsContainer.appendChild(searchIcon); iconsContainer.appendChild(loginIcon); iconsContainer.appendChild(cartIcon); // وضعها داخل الهيدر (بجانب ملخص السلة) cartSummary.parentNode.insertBefore(iconsContainer, cartSummary); /* 🌐 عند الضغط على أيقونة اللغة/العملة */ langIcon.addEventListener("click", function () { if (typeof salla !== "undefined" && salla.event) { salla.event.dispatch("language::open"); } }); /* 🔍 عند الضغط على أيقونة البحث */ searchIcon.addEventListener("click", function () { if (typeof salla !== "undefined" && salla.event) { salla.event.dispatch("search::open"); } }); /* 👤 عند الضغط على أيقونة تسجيل الدخول */ loginIcon.addEventListener("click", function () { if (typeof salla !== "undefined" && salla.event) { salla.event.dispatch("login::open"); } }); /* 🧾 عند الضغط على أيقونة الفواتير (السلة) */ cartIcon.addEventListener("click", function () { if (typeof salla !== "undefined" && salla.event) { salla.event.dispatch("cart::toggle"); } }); } }); /* ==== Salla: inject-header-menus.js Add this JS to your store's custom JS area (after DOM ready). Adjust arrays below (cities, categories) and url builders if needed. */ document.addEventListener("DOMContentLoaded", function () { setTimeout(() => { const desktopMenu = document.querySelector(".main-menu"); const mobileMenu = document.querySelector("#mobile-menu .main-menu"); if (!desktopMenu || !mobileMenu) return; // 🏙️ قائمة المدن (سطح المكتب) const citiesMenu = `
  • المدن
  • `; // 🧭 قائمة الرحلات (سطح المكتب) const tripsMenu = `
  • الرحلات
  • `; // 🧱 الجوال — قائمة المدن والرحلات (بستايل Accordion) const mobileMenus = `
  • `; // نضيف القوائم لسطح المكتب والجوال desktopMenu.insertAdjacentHTML("beforeend", citiesMenu); desktopMenu.insertAdjacentHTML("beforeend", tripsMenu); mobileMenu.insertAdjacentHTML("beforeend", mobileMenus); // 🔽 وظيفة الأكوردين للجوال mobileMenu.querySelectorAll(".accordion-btn").forEach((btn) => { btn.addEventListener("click", function () { const content = this.nextElementSibling; const arrow = this.querySelector(".arrow"); const isOpen = !content.classList.contains("hidden"); // غلق جميع القوائم الأخرى mobileMenu.querySelectorAll(".accordion-content").forEach((ul) => ul.classList.add("hidden")); mobileMenu.querySelectorAll(".arrow").forEach((a) => a.classList.remove("rotate-180")); // فتح/غلق الحالية if (!isOpen) { content.classList.remove("hidden"); arrow.classList.add("rotate-180"); } }); }); }, 1500); });