/* Add custom Js styles below */ document.addEventListener("DOMContentLoaded", function () { // لا يظهر في الصفحة الرئيسية فقط if (window.location.pathname !== "/") { const helpBtn = document.createElement('div'); helpBtn.id = 'floating-help-btn'; helpBtn.innerHTML = ``; helpBtn.style.cssText = ` position: fixed; bottom: 90px; left: 20px; /* ← هنا التغيير */ width: 50px; height: 50px; background-color: #f97316; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 99999; box-shadow: 0 4px 12px rgba(0,0,0,0.25); transition: transform 0.3s ease; `; helpBtn.onmouseover = () => { helpBtn.style.transform = 'scale(1.1)'; }; helpBtn.onmouseout = () => { helpBtn.style.transform = 'scale(1)'; }; // عند الضغط عليه يفتح نافذة التسجيل helpBtn.onclick = () => { if (typeof salla !== 'undefined' && salla.event) { salla.event.dispatch('login::open'); } else { alert("حدث خطأ، تأكد من تحميل مكتبة سلة."); } }; document.body.appendChild(helpBtn); } }); // إنشاء زر الواتساب ديناميكيًا (منع التكرار) if (!document.getElementById('whatsapp-btn')) { const whatsappButton = document.createElement('div'); whatsappButton.id = 'whatsapp-btn'; whatsappButton.innerHTML = ` WhatsApp `; // فتح واتساب عند النقر whatsappButton.onclick = function () { window.open('https://wa.me/+9660557042514', '_blank'); }; // إضافة الزر إلى الصفحة document.body.appendChild(whatsappButton); } // إنشاء عنصر الديف const footerText = document.createElement('div'); footerText.className = 'custom-footer-text'; footerText.innerHTML = 'تصميم وإدارة شوكفات'; // إضافته إلى نهاية البودي أو أي عنصر آخر مناسب document.addEventListener("DOMContentLoaded", function() { document.body.appendChild(footerText); }); document.addEventListener("DOMContentLoaded", function() { let buttons = document.querySelectorAll('.s-add-product-button-mini-checkout-content'); buttons.forEach(btn => { let emoji = document.createElement('span'); emoji.className = 'floating-emoji-inline'; emoji.textContent = '🔥'; // يمكنك تغييره إلى 🎮 أو 💥 أو 🔥 حسب رغبتك btn.appendChild(emoji); }); }); document.addEventListener("DOMContentLoaded", function () { const anchor = document.querySelector('.product__description'); if (!anchor) return; if (document.getElementById('nd95-window')) return; const COUPON_CODE = 'ND95'; // إنشاء النافذة const box = document.createElement('div'); box.id = 'nd95-window'; const subtleFlag = document.createElement('div'); subtleFlag.className = 'nd95-flag'; const closeBtn = document.createElement('button'); closeBtn.className = 'nd95-close'; closeBtn.setAttribute('aria-label', 'إغلاق النافذة'); closeBtn.textContent = '×'; const head = document.createElement('div'); head.className = 'nd95-head'; head.innerHTML = ` 🇸🇦 عروض شري - اليوم الوطني 95 🎉 `; const msg = document.createElement('div'); msg.className = 'nd95-msg'; msg.innerHTML = ` 💚 بمناسبة اليوم الوطني 95
احصل على خصم 10٪ عند استخدام الكوبون التالي: `; const codeWrap = document.createElement('div'); codeWrap.className = 'nd95-code'; const input = document.createElement('input'); input.className = 'nd95-input'; input.type = 'text'; input.value = COUPON_CODE; input.readOnly = true; const copyBtn = document.createElement('button'); copyBtn.className = 'nd95-copy'; copyBtn.textContent = '📋 نسخ الكود'; copyBtn.addEventListener('click', async () => { try { await navigator.clipboard.writeText(COUPON_CODE); const old = copyBtn.textContent; copyBtn.textContent = '✅ تم النسخ!'; setTimeout(() => (copyBtn.textContent = old), 1800); } catch (e) { alert('انسخ الكود يدويًا: ' + COUPON_CODE); } }); closeBtn.addEventListener('click', () => { sessionStorage.setItem('nd95_dismissed', '1'); box.remove(); }); if (sessionStorage.getItem('nd95_dismissed') === '1') return; codeWrap.appendChild(input); codeWrap.appendChild(copyBtn); box.appendChild(subtleFlag); box.appendChild(closeBtn); box.appendChild(head); box.appendChild(msg); box.appendChild(codeWrap); anchor.parentNode.insertBefore(box, anchor); requestAnimationFrame(() => { box.classList.add('nd95--in'); }); });