document.addEventListener("DOMContentLoaded", function(){ const container = document.querySelector('.store-footer .container'); const containerchild = `
`; container.insertAdjacentHTML('beforeend', containerchild); const main= document.querySelector('.main-nav-container .container .items-center'); const containerchild2=`
`; main.insertAdjacentHTML('beforeend', containerchild2); const urlParams = new URLSearchParams(window.location.search); const lang = urlParams.get('lang') || "ar"; const ar_src=["/Watering-packages/c1374135222","/Iftar-packages-for-fasting-people/c802975571","/monthly-subscription/c600621751","/Mosque-services/c1333133489"]; var num=0; const titel = document.querySelectorAll('.s-block.container .s-block__title .right-side'); titel.forEach((item)=>{ item.innerHTML=`${item.innerHTML}

${lang=="ar" ? "(داخل حد الحرم)" : "(Within the boundaries of the sanctuary)" }

` num++; }) const body = document.querySelector("body"); body.insertAdjacentHTML('beforeend',``); const backToTopButton = document.getElementById('back-to-top'); function toggleButtonVisibility() { if (window.scrollY > 300) { // إذا تم التمرير لأكثر من 300 بكسل backToTopButton.style.display = 'block'; } else { backToTopButton.style.display = 'none'; } } window.addEventListener('scroll', toggleButtonVisibility); backToTopButton.addEventListener('click', function() { window.scrollTo({ top: 0, behavior: 'smooth' }); }); toggleButtonVisibility(); function toggleButtonWhatsup() { // إعدادات الزر (يمكنك تعديلها حسب رغبتك) const settings = { phoneNumber: '+966553381141', // رقم الهاتف بالصيغة الدولية (بدون + أو صفر) defaultMessage: 'مرحباً، أحتاج إلى مساعدة', // الرسالة الافتراضية // لون الأيقونة }; // إنشاء عنصر الزر const whatsappButton = document.createElement('div'); whatsappButton.id = 'whatsapp-float-button'; // إضافة الأيقونة (SVG بديل عن أي مكتبة خارجية) whatsappButton.innerHTML = ` `; // إضافة حدث النقر whatsappButton.addEventListener('click', function() { let url = `https://wa.me/${settings.phoneNumber}`; if (settings.defaultMessage.trim() !== '') { url += `?text=${encodeURIComponent(settings.defaultMessage)}`; } window.open(url, '_blank'); }); document.body.appendChild(whatsappButton); } toggleButtonWhatsup(); function initToggleOnSelect() { const selector = document.getElementById("option-548273981"); const div_text = document.querySelector("div[data-option-id='1049634248']"); if (!selector || !div_text) return; function toggleDiv() { const selectedOption = selector.options[selector.selectedIndex]; const selectedText = selectedOption.textContent || selectedOption.innerText; const numericValue = parseFloat(selectedText); if (!isNaN(numericValue) && numericValue >= 500) { div_text.style.display = "block"; } else { div_text.style.display = "none"; } } selector.addEventListener("change", toggleDiv); selector.addEventListener("input", toggleDiv); // مهم لبعض المتصفحات toggleDiv(); } const observer = new MutationObserver(function(mutations) { const selectorExists = document.getElementById("option-548273981"); if (selectorExists) { // initToggleOnSelect(); // يعيد ربط الأحداث } }); observer.observe(document.body, { childList: true, subtree: true }); function showwindow() { const STORAGE_KEY = 'tibayan_popup_shown'; if (sessionStorage.getItem(STORAGE_KEY)) { return; } const overlay = document.createElement('div'); overlay.className = 'tibayan-popup-overlay'; const popup = document.createElement('div'); popup.className = 'tibayan-popup-content'; const closeIcon = document.createElement('span'); closeIcon.className = 'tibayan-popup-close-icon'; closeIcon.innerHTML = '×'; const body = document.createElement('div'); body.className = 'tibayan-popup-body'; // إنشاء الصورة فقط const popupImage = document.createElement('img'); popupImage.src = 'https://cdn.files.salla.network/homepage/1035893067/33cbce0f-4005-4fc5-b92f-351006257ff7.webp'; // استبدل هذا الرابط بصورتك popupImage.alt = 'عرض تبيان'; popupImage.style.height = 'auto'; popupImage.style.cursor = 'pointer'; popupImage.style.display = 'block'; popupImage.style.margin = '0 auto'; popupImage.style.borderRadius = '8px'; popupImage.style.boxShadow = '0 5px 15px rgba(0,0,0,0.1)'; popupImage.style.transition = 'transform 0.2s'; popupImage.onmouseover = () => popupImage.style.transform = 'scale(1.02)'; popupImage.onmouseout = () => popupImage.style.transform = 'scale(1)'; body.appendChild(popupImage); popup.appendChild(closeIcon); popup.appendChild(body); overlay.appendChild(popup); document.body.appendChild(overlay); document.body.style.overflow = 'hidden'; function closePopup() { overlay.remove(); document.body.style.overflow = ''; sessionStorage.setItem(STORAGE_KEY, 'true'); } // حدث النقر على الصورة popupImage.addEventListener('click', function() { setTimeout(function() { window.open("https://aouenstore.com/%D8%A8%D8%A7%D9%82%D8%A9-%D8%B3%D9%82%D9%8A%D8%A7-%D8%A7%D9%84%D8%AD%D8%AC%D8%A7%D8%AC-%D8%B9%D9%84%D9%89-%D8%B5%D8%B9%D9%8A%D8%AF-%D8%B9%D8%B1%D9%81%D8%A9/p1322114755", "_self"); }, 500); closePopup(); }); closeIcon.addEventListener('click', closePopup); overlay.addEventListener('click', function(e) { if (e.target === overlay) { closePopup(); } }); } // showwindow(); document.addEventListener('click', function(event) { const addToCartButton = event.target.closest('.s-button-element.s-button-btn.s-button-outline.s-button-wide.s-button-primary-outline.s-button-loader-center'); if (!addToCartButton) return; event.preventDefault(); event.stopPropagation(); const productCard = addToCartButton.closest('custom-salla-product-card'); if (!productCard) return; const productLink = productCard.querySelector('h3.s-product-card-content-title a'); if (productLink && productLink.href) { window.location.href = productLink.href; } }); function insertadresdiv() { const container = document.querySelector('.s-block--bundle-trust-map'); if (container){ const infoDiv = document.createElement('div'); infoDiv.className = 'contact-info'; infoDiv.innerHTML = `

مكتب متجر عون

نتشرف بزيارتك

العنوان :

المملكة العربية السعودية، الطريق الدائري الثالث 24225 مكة الكرمة

مبنى جمعية مراكز الأحياء , الطابق 1 , رقم المكتب 103

أيام العمل:

من الأحد إلى الخميس

من الـ 9 صباحاً إلى 5 مساءً

الرقم :

+966553381141

البريد الإلكتروني :

info@aouenstore.com

`; container.appendChild(infoDiv); } } // insertadresdiv(); // var lite = document.querySelector('lite-youtube'); // if (!lite) return; // var videoId = lite.getAttribute('videoid'); // var params = lite.getAttribute('params') || ''; // if (!videoId) return; // var autoplayParams = 'autoplay=1&mute=1&playsinline=1'; // var finalParams = params + (params ? '&' : '') + autoplayParams; // var iframe = document.createElement('iframe'); // iframe.style.width = '100%'; // iframe.style.height = '100%'; // iframe.style.aspectRatio = '16 / 9'; // يحافظ على نسبة العرض للارتفاع // iframe.style.border = 'none'; // iframe.src = 'https://www.youtube-nocookie.com/embed/' + videoId + '?' + finalParams; // iframe.allow = 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture'; // iframe.allowFullscreen = true; // iframe.referrerPolicy = 'strict-origin-when-cross-origin'; // lite.replaceWith(iframe); // const interceptLinks = true; // اجعلها false إذا أردت عدم اعتراض الروابط const lcpBanner = document.querySelector('img[alt="fixed banner"]'); if (lcpBanner) { lcpBanner.setAttribute('loading', 'eager'); lcpBanner.setAttribute('fetchpriority', 'high'); } }); // (function() { // // ============ الإعدادات ============ // const interceptExternalLinks = true; // كما في الأصل // const STORAGE_KEY = 'exit_popup_last_shown_date'; // let userHasInteracted = false; // // ============ دوال التاريخ ============ // function getTodayString() { // const d = new Date(); // const year = d.getFullYear(); // const month = String(d.getMonth() + 1).padStart(2, '0'); // const day = String(d.getDate()).padStart(2, '0'); // return year + '-' + month + '-' + day; // } // function hasShownToday() { // try { // return localStorage.getItem(STORAGE_KEY) === getTodayString(); // } catch (e) { // return false; // } // } // function markShownToday() { // try { // localStorage.setItem(STORAGE_KEY, getTodayString()); // } catch (e) {} // } // // ============ إذا عُرض اليوم، لا نكمل ============ // if (hasShownToday()) { // return; // } // // ============ دالة التحقق من إمكانية العرض ============ // function canShowPopup() { // if (hasShownToday()) return false; // if (!userHasInteracted) return false; // return true; // } // // ============ إنشاء HTML النافذة ============ // const popupHTML = ` // // `; // // ============ المتغيرات العامة ============ // let popup = null; // let popupShown = false; // let allowLeave = false; // let pendingNavigationUrl = null; // let observer = null; // // ============ دوال مساعدة ============ // function getPopup() { // return document.getElementById('exit-popup'); // } // function ensurePopupExists() { // popup = getPopup(); // if (!popup) { // const tempDiv = document.createElement('div'); // tempDiv.innerHTML = popupHTML; // const popupElement = tempDiv.firstElementChild; // document.body.appendChild(popupElement); // popup = popupElement; // bindPopupEvents(); // } // } // function bindPopupEvents() { // if (!popup) return; // const continueBtn = popup.querySelector('#continueBtn'); // if (continueBtn && !continueBtn.hasAttribute('listener')) { // continueBtn.setAttribute('listener', 'true'); // continueBtn.addEventListener('click', closePopup); // } // const leaveBtn = popup.querySelector('#leaveBtn'); // if (leaveBtn && !leaveBtn.hasAttribute('listener')) { // leaveBtn.setAttribute('listener', 'true'); // leaveBtn.addEventListener('click', forceLeave); // } // popup.querySelectorAll('.options-list a').forEach(link => { // if (!link.hasAttribute('listener')) { // link.setAttribute('listener', 'true'); // link.addEventListener('click', function() { // allowLeave = true; // popupShown = true; // markShownToday(); // window.removeEventListener('beforeunload', beforeUnloadHandler); // }); // } // }); // } // // ============ دوال العرض والإغلاق ============ // function showPopup() { // if (!canShowPopup()) return; // if (hasShownToday()) return; // ensurePopupExists(); // if (popup && !popupShown && !allowLeave) { // popup.style.display = 'flex'; // popupShown = true; // markShownToday(); // window.addEventListener('beforeunload', beforeUnloadHandler); // if (window.history && window.history.pushState) { // history.pushState(null, null, location.href); // } // } // } // function closePopup() { // if (popup) popup.style.display = 'none'; // popupShown = false; // pendingNavigationUrl = null; // markShownToday(); // window.removeEventListener('beforeunload', beforeUnloadHandler); // } // function forceLeave() { // allowLeave = true; // markShownToday(); // window.removeEventListener('beforeunload', beforeUnloadHandler); // if (popup) popup.style.display = 'none'; // if (pendingNavigationUrl) { // window.location.href = pendingNavigationUrl; // } else { // window.close(); // } // } // function beforeUnloadHandler(e) { // if (allowLeave) return; // e.preventDefault(); // e.returnValue = ''; // } // // ============ اعتراض الروابط الخارجية (كما في الأصل) ============ // function handleDocumentClick(e) { // if (e.target.closest('#exit-popup')) return; // const link = e.target.closest('a'); // if (!link) return; // if (link.classList.contains('no-intercept')) return; // const href = link.getAttribute('href'); // if (!href || href.startsWith('mailto:') || href.startsWith('tel:') || href.startsWith('javascript:')) return; // const linkUrl = new URL(link.href, window.location.href); // if (linkUrl.hostname === window.location.hostname) return; // userHasInteracted = true; // if (!canShowPopup()) return; // e.preventDefault(); // pendingNavigationUrl = link.href; // showPopup(); // } // // ============ أحداث الخروج بالماوس — من الأعلى فقط ============ // function handleMouseOut(e) { // if (!userHasInteracted) return; // if (!e.relatedTarget && !e.toElement) { // // ✅ من الأعلى فقط (شريط التبويبات/العنوان) // if (e.clientY <= -10) { // showPopup(); // } // } // } // function handleMouseLeave(e) { // if (!userHasInteracted) return; // // ✅ من الأعلى فقط // if (e.clientY <= -10) { // showPopup(); // } // } // // ============ التعامل مع زر الرجوع (كما في الأصل) ============ // function handlePopState() { // if (!userHasInteracted) return; // if (hasShownToday()) return; // if (!popupShown && !allowLeave) { // showPopup(); // if (window.history && window.history.pushState) { // history.pushState(null, null, location.href); // } // } else { // if (!allowLeave && window.history && window.history.pushState) { // history.pushState(null, null, location.href); // } // } // } // // ============ التهيئة ============ // function init() { // ensurePopupExists(); // if (!window.__exitPopupInitialized) { // window.__exitPopupInitialized = true; // ['mousemove', 'scroll', 'touchstart', 'keydown', 'click'].forEach(function(evt) { // document.addEventListener(evt, function() { // userHasInteracted = true; // }, { once: true, passive: true }); // }); // if (interceptExternalLinks) { // document.addEventListener('click', handleDocumentClick); // } // document.addEventListener('mouseout', handleMouseOut); // document.addEventListener('mouseleave', handleMouseLeave); // window.addEventListener('popstate', handlePopState); // observer = new MutationObserver(function() { // if (!getPopup()) { // ensurePopupExists(); // } // }); // observer.observe(document.body, { childList: true, subtree: true }); // } // if (window.history && window.history.pushState) { // history.pushState(null, null, location.href); // } // } // // ============ بدء التشغيل ============ // if (document.readyState === 'loading') { // document.addEventListener('DOMContentLoaded', init); // } else { // init(); // } // if (!document.body) { // const bodyCheckInterval = setInterval(() => { // if (document.body) { // clearInterval(bodyCheckInterval); // init(); // } // }, 100); // } // })(); (function () { function addCertificate() { const footer = document.querySelector('footer[data-testid="store-footer"]'); if (!footer) return false; // البحث عن الحاوية التي تحتوي على السجل التجاري const container = footer.querySelector('.flex.gap-4'); if (!container) return false; // التأكد من عدم إضافة الكود أكثر من مرة if (container.querySelector('.f_certificates')) return true; // إنشاء حاوية التوثيق const certWrapper = document.createElement('div'); certWrapper.className = 'f_certificates'; // محتوى التوثيق (تمت إزالة التنسيقات الداخلية واعتمادها على CSS) certWrapper.innerHTML = `

موثقين لدى منصة الأعمال

منصة الأعمال `; // إضافة التوثيق بجانب السجل التجاري container.appendChild(certWrapper); return true; } // تنفيذ الكود ومحاولة تطبيقه بشكل مستمر حتى يتم تحميل الفوتر if (!addCertificate()) { const interval = setInterval(() => { if (addCertificate()) clearInterval(interval); }, 300); setTimeout(() => clearInterval(interval), 10000); } })();