(function() { // عنوان وفقرة قبل سكشن العدادات const countersSectionHeader = `

خبرة موثوقة… نتائج ملموسة

فرق محترفة تقدم حلول تنظيف ومكافحة آفات بثبـــــــــات وجودة تُثبتهـــــــــا أرقامنا ورضـــــــا عملائنا

`; const featuresHTML = `
عدد المواعيد
+0
عدد المواعيد
المدن المتاحة
+0
المدن المتاحة
عدد العمال
+0
عدد العمال
الشهادات
0
الشهادات
`; const partnersHTML = `

الشركاء

معًا، نحقق النجاح ونفتح آفاقًا جديدة للابتكار والنمو المستدام

Partner 1
Partner 2
Partner 3
Partner 4
Partner 5
`; const faqHTML = `

الأسئلة الشائعة

قسم الأسئلة الشائعة لدينا يجيب على جميع تساؤلاتك

كم يستغرق وقت الخدمة؟
من 20 إلى 45 دقيقة حسب المساحة ونوع الخدمة
هل المواد آمنة؟
نعم، نستخدم مواد مرخصة وآمنة على الأطفال والحيوانات الأليفة
هل الرش له رائحة؟
معظم المواد رائحتها خفيفة وتزول بسرعة.
هل الرش يضر بالأثاث؟
لا، المواد لا تترك آثاراً ولا تؤثر على الأسطح
متى تظهر النتائج؟
عادةً خلال 24–48 ساعة الأولى.
كم أقل عدد ساعات للحجز؟
عادةً يبدأ الحد الأدنى من 4 إلى 8 ساعات.
`; function animateCounter(el) { const target = parseInt(el.getAttribute('data-target')); const hasPlus = el.textContent.includes('+'); let current = 0; const step = target / 125; const timer = setInterval(() => { current += step; if (current >= target) { el.textContent = hasPlus ? `+${target}` : target; clearInterval(timer); } else { el.textContent = hasPlus ? `+${Math.floor(current)}` : Math.floor(current); } }, 16); } function startCounters() { const counters = document.querySelectorAll('.counter'); counters.forEach(c => { c.textContent = c.textContent.includes('+') ? '+0' : '0'; animateCounter(c); }); } function initSwiper() { if (typeof Swiper !== 'undefined') { new Swiper('.partners-swiper', { slidesPerView: 2, spaceBetween: 30, loop: true, autoplay: { delay: 3000, disableOnInteraction: false, }, speed: 800, pagination: { el: '.swiper-pagination', clickable: true, dynamicBullets: false, }, breakpoints: { 640: { slidesPerView: 3, spaceBetween: 40, }, 1024: { slidesPerView: 5, spaceBetween: 50, }, }, }); } else { setTimeout(initSwiper, 200); } } function initFAQ() { const faqItems = document.querySelectorAll('.faq-item'); faqItems.forEach(item => { item.addEventListener('click', function() { const answer = this.querySelector('.faq-answer'); const icon = this.querySelector('.faq-icon svg'); const isOpen = answer.style.maxHeight && answer.style.maxHeight !== '0px'; // إغلاق جميع الأسئلة الأخرى faqItems.forEach(otherItem => { if (otherItem !== item) { const otherAnswer = otherItem.querySelector('.faq-answer'); const otherIcon = otherItem.querySelector('.faq-icon svg'); otherAnswer.style.maxHeight = '0'; otherIcon.style.transform = 'rotate(0deg)'; } }); // فتح أو إغلاق السؤال الحالي if (isOpen) { answer.style.maxHeight = '0'; icon.style.transform = 'rotate(0deg)'; } else { answer.style.maxHeight = answer.scrollHeight + 'px'; icon.style.transform = 'rotate(180deg)'; } }); }); } function insertSections() { // البحث عن السكشن بناءً على الصورة أو data-bg لقسم "من نحن" const allSections = document.querySelectorAll('body.index section.s-block.s-block--fixed-banner.wide-placeholder'); let aboutUsTarget = null; allSections.forEach(section => { // البحث بـ img src const img = section.querySelector('img[src*="3ae91129-6c36-4f9c-908a-f3b75060cda1"]'); // البحث بـ data-bg const bgDiv = section.querySelector('[data-bg*="3ae91129-6c36-4f9c-908a-f3b75060cda1"]'); // البحث بـ background-image في style const hasBackgroundImage = section.innerHTML.includes('3ae91129-6c36-4f9c-908a-f3b75060cda1'); if (img || bgDiv || hasBackgroundImage) { aboutUsTarget = section; } }); // إضافة "من نحن" قبل السكشن اللي فيه الصورة if (aboutUsTarget) { const aboutUsHeader = `

من نحن

نحن نقدم مجموعة من الخدمات المتميزة التي تلبي احتياجاتك

`; aboutUsTarget.insertAdjacentHTML('beforebegin', aboutUsHeader); } // البحث عن السكشن بناءً على data-bg داخل div لقسم "الخدمات" const targetDiv = document.querySelector('body.index section.s-block--banners div[data-bg*="5918cf98-9377-40c2-acab-d6bcf5e2aea5"]'); const servicesTarget = targetDiv ? targetDiv.closest('section') : null; if (servicesTarget) { const servicesHeader = `

الخدمات

نحن نقدم مجموعة من الخدمات المتميزة التي تلبي احتياجاتك

`; servicesTarget.insertAdjacentHTML('beforebegin', servicesHeader); } // إضافة باقي الأقسام قبل الفوتر const footer = document.querySelector('body.index .store-footer'); if (footer) { footer.insertAdjacentHTML('beforebegin', countersSectionHeader + featuresHTML + partnersHTML + faqHTML); document.querySelector('section[style*="background-image"]').classList.add('custom-features-section'); setTimeout(() => { startCounters(); initSwiper(); initFAQ(); }, 100); setInterval(startCounters, 4000); } else { setTimeout(insertSections, 500); } } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', insertSections); } else { insertSections(); } })(); // Function to add LinkedIn to a social list function addLinkedIn(socialList) { if (!socialList) return; // Check if LinkedIn already exists const existingLinkedIn = socialList.querySelector('a[href*="linkedin"]'); if (existingLinkedIn) return; const linkedinItem = document.createElement('li'); linkedinItem.className = 's-social-link'; linkedinItem.innerHTML = ` linkedin `; socialList.appendChild(linkedinItem); } // Add LinkedIn to all social lists (desktop and mobile) document.querySelectorAll('.s-social-list').forEach(list => { addLinkedIn(list); }); // Watch for dynamically loaded content (for mobile) const observer = new MutationObserver(() => { document.querySelectorAll('.s-social-list').forEach(list => { addLinkedIn(list); }); }); observer.observe(document.body, { childList: true, subtree: true });