/* Add custom JS code below */ /*mostafa edits*/ document.addEventListener("DOMContentLoaded", function() { // تحديد عنصر الحقوق في الفوتر var copyrightElem = document.querySelector('.site-footer .copyrights, .s-footer-copyrights, footer .copyright, .copyrights, .copyright-text'); if (copyrightElem) { // إنشاء عنصر الحقوق الخاص بك مع الرابط var devCredit = document.createElement('span'); devCredit.innerHTML = ' | تم تصميم وتطوير الموقع بواسطة اكس دراجون لاب شركة تصميم مواقع'; // إضافته بجانب الحقوق الأصلية copyrightElem.appendChild(devCredit); } }); /*end mostafa edits*/ document.addEventListener("DOMContentLoaded", function () { function initAdvertisementSlider() { const container = document.querySelector("salla-advertisement"); if (!container) return; const ads = container.querySelectorAll(".s-advertisement"); if (ads.length <= 1) return; let current = 0; // تجهيز الإعلانات ads.forEach((ad, index) => { ad.style.transition = "opacity .5s ease"; ad.style.position = "absolute"; ad.style.top = "0"; ad.style.left = "0"; ad.style.width = "100%"; if (index === 0) { ad.style.opacity = "1"; ad.style.pointerEvents = "auto"; } else { ad.style.opacity = "0"; ad.style.pointerEvents = "none"; } }); container.style.position = "relative"; container.style.display = "block"; container.style.height = ads[0].offsetHeight + "px"; function showNext() { ads[current].style.opacity = "0"; ads[current].style.pointerEvents = "none"; current = (current + 1) % ads.length; ads[current].style.opacity = "1"; ads[current].style.pointerEvents = "auto"; } setInterval(showNext, 4000); } // لأن مكونات سلة Hydrated const timer = setInterval(() => { if (document.querySelector("salla-advertisement .s-advertisement")) { clearInterval(timer); initAdvertisementSlider(); } }, 300); });