// جافا سكريبت لإضافة أيقونة Pinterest وتجنب التكرار document.addEventListener('DOMContentLoaded', function() { // البحث عن عنصر وسائل التواصل الاجتماعي const socialElement = document.querySelector('salla-social'); if (socialElement) { // التحقق مما إذا كانت أيقونة Pinterest موجودة بالفعل const existingPinterest = socialElement.querySelector('a[href*="pinterest.com"]'); if (!existingPinterest) { // إنشاء عنصر Pinterest جديد const pinterestLink = document.createElement('li'); pinterestLink.className = 's-social-link'; pinterestLink.innerHTML = ` pinterest `; // إضافة أيقونة Pinterest إلى القائمة socialElement.appendChild(pinterestLink); } // إزالة التكرار إذا وجد const allLinks = socialElement.querySelectorAll('.s-social-link'); const seenLinks = new Set(); allLinks.forEach(link => { const href = link.querySelector('a').getAttribute('href'); if (seenLinks.has(href)) { link.remove(); // إزالة الروابط المكررة } else { seenLinks.add(href); } }); } }); // انتظر حتى يتم تحميل DOM بالكامل // انتظر حتى يتم تحميل DOM بالكامل document.addEventListener('DOMContentLoaded', function() { // تحديد العنصر المصدر const sourceElement = document.querySelector('#app > div.app-inner.flex.flex-col.min-h-full > footer > div.store-footer__inner > div > div.lg\\:col-span-2.rtl\\:lg\\:pl-20.ltr\\:lg\\:pr-20 > div'); // تحديد العنصر الهدف الجديد const targetElement = document.querySelector('div.main-content.md\\:sticky.md\\:overflow-hidden.top-24.w-full.md\\:w-2\\/4.md\\:pb-16 > div.flex.whitespace-nowrap.gap-4.items-center'); if (sourceElement && targetElement) { // إنشاء نسخة من العنصر المصدر const clonedElement = sourceElement.cloneNode(true); // إزالة أي تكرار لأيقونة Pinterest const pinterestLinks = clonedElement.querySelectorAll('a[href*="pinterest.com"]'); if (pinterestLinks.length > 1) { for (let i = 1; i < pinterestLinks.length; i++) { pinterestLinks[i].closest('.s-social-link').remove(); } } // إدراج النسخة بعد العنصر الهدف الجديد targetElement.insertAdjacentElement('afterend', clonedElement); console.log('تم نسخ القسم بنجاح وإظهاره تحت العنصر الجديد'); } else { console.error('لم يتم العثور على العنصر المصدر أو الهدف'); } }); // كود لإضافة أيقونة Pinterest إلى قسم وسائل التواصل للجوال function addPinterestToMobileSocial() { // تحديد قسم وسائل التواصل الاجتماعي للجوال const mobileSocialSection = document.querySelector('div.lg\\:hidden.contact-social salla-social'); if (!mobileSocialSection) { console.error('لم يتم العثور على قسم وسائل التواصل للجوال'); return; } // التحقق مما إذا كانت أيقونة Pinterest موجودة بالفعل const existingPinterest = mobileSocialSection.querySelector('a[href*="pinterest.com"]'); if (existingPinterest) { console.log('أيقونة Pinterest موجودة بالفعل'); return; } // إنشاء أيقونة Pinterest جديدة const pinterestIcon = document.createElement('li'); pinterestIcon.className = 's-social-link'; pinterestIcon.innerHTML = ` pinterest `; // إضافة الأيقونة إلى القسم mobileSocialSection.appendChild(pinterestIcon); console.log('تمت إضافة أيقونة Pinterest بنجاح إلى قسم الجوال'); } // تنفيذ الوظيفة عندما تكون الصفحة جاهزة if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', addPinterestToMobileSocial); } else { addPinterestToMobileSocial(); } // إعادة المحاولة بعد تأخير للتأكد من تحميل جميع العناصر setTimeout(addPinterestToMobileSocial, 1000); (function() { 'use strict'; function isIndexPage() { return document.body.classList.contains('index'); } function injectStyles() { const style = document.createElement('style'); style.textContent = ` .nakheel-popup-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); display: none; justify-content: center; align-items: center; z-index: 10000; backdrop-filter: blur(8px); animation: nakheelFadeIn 0.4s ease-out; direction: rtl; } .nakheel-popup-overlay.show { display: flex !important; } .nakheel-popup-content { background: #c6bcb7; border-radius: 25px; padding: 50px 40px; max-width: 550px; width: 90%; text-align: center; position: relative; color: #333; box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4); transform: scale(0.5) rotate(-10deg); opacity: 0; animation: nakheelPopupBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards; } .nakheel-popup-content::before { content: ''; position: absolute; top: -3px; left: -3px; right: -3px; bottom: -3px; background: linear-gradient(45deg, #c6bcb7, #d4ccc7, #c6bcb7, #b8aea9); background-size: 300% 300%; border-radius: 27px; z-index: -1; animation: nakheelBorderFlow 3s ease infinite; } .nakheel-close-btn { position: absolute; top: 15px; right: 15px; background: rgba(255, 255, 255, 0.6); border: none; border-radius: 50%; width: 45px; height: 45px; color: #333; font-size: 28px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; animation: nakheelPulse 2s ease-in-out infinite; } .nakheel-close-btn:hover { background: rgba(255, 255, 255, 0.9); transform: rotate(90deg) scale(1.1); } .nakheel-popup-h2 { font-size: 2.2rem; margin: 0; color: #333; line-height: 1.5; font-weight: bold; animation: nakheelTextSlide 0.8s ease-out 0.3s both; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1); } .nakheel-popup-h2::after { content: '🎁'; display: inline-block; margin-right: 15px; animation: nakheelGiftBounce 1s ease-in-out infinite; } @keyframes nakheelFadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes nakheelPopupBounce { 0% { transform: scale(0.5) rotate(-10deg); opacity: 0; } 50% { transform: scale(1.05) rotate(2deg); } 100% { transform: scale(1) rotate(0deg); opacity: 1; } } @keyframes nakheelBorderFlow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } } @keyframes nakheelPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } } @keyframes nakheelTextSlide { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } } @keyframes nakheelGiftBounce { 0%, 100% { transform: translateY(0) rotate(0deg); } 25% { transform: translateY(-8px) rotate(-10deg); } 75% { transform: translateY(-8px) rotate(10deg); } } @media (max-width: 480px) { .nakheel-popup-content { padding: 35px 25px; margin: 20px; } .nakheel-popup-h2 { font-size: 1.7rem; } } `; document.head.appendChild(style); } function createPopup() { const overlay = document.createElement('div'); overlay.className = 'nakheel-popup-overlay'; overlay.id = 'nakheelPopupOverlay'; const content = document.createElement('div'); content.className = 'nakheel-popup-content'; const closeBtn = document.createElement('button'); closeBtn.className = 'nakheel-close-btn'; closeBtn.innerHTML = '×'; closeBtn.onclick = closePopup; const h2 = document.createElement('h2'); h2.className = 'nakheel-popup-h2'; h2.textContent = 'شحن مجاني للطلبات فوق 250 ريال'; content.appendChild(closeBtn); content.appendChild(h2); overlay.appendChild(content); document.body.appendChild(overlay); return overlay; } function showPopup() { const overlay = document.getElementById('nakheelPopupOverlay') || createPopup(); overlay.classList.add('show'); document.body.style.overflow = 'hidden'; } function closePopup() { const overlay = document.getElementById('nakheelPopupOverlay'); if (overlay) { overlay.classList.remove('show'); document.body.style.overflow = 'auto'; } } function initPopup() { if (!isIndexPage()) { return; } injectStyles(); const overlay = createPopup(); overlay.addEventListener('click', function(e) { if (e.target === this) { closePopup(); } }); document.addEventListener('keydown', function(e) { if (e.key === 'Escape') { closePopup(); } }); setTimeout(function() { showPopup(); }, 1000); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initPopup); } else { initPopup(); } window.nakheelPopup = { show: showPopup, close: closePopup }; })();/* Add custom Js code below */ // إخفاء جميع عناصر li داخل المسار المحدد function hidePaymentProcessItems() { const items = document.querySelectorAll('#payment_process > div > ul > li'); items.forEach(item => { item.style.display = 'none'; }); } // تشغيل عند تحميل الصفحة document.addEventListener('DOMContentLoaded', hidePaymentProcessItems); // وإعادة التشغيل كل ثانية لمدة 5 ثوان (للمحتوى الديناميكي) let attempts = 0; const interval = setInterval(() => { hidePaymentProcessItems(); attempts++; if (attempts >= 5) clearInterval(interval); }, 1000);