/* Add custom Js styles below */ /* Add custom Js styles below */ /* Add custom Js styles below */ /* Add custom Js code below */ /* Add custom Js code below */ (function() { // إنشاء عنصر الواتساب العائم مع أعلى أولوية const whatsappContainer = document.createElement('div'); whatsappContainer.className = 'ws-float-container'; whatsappContainer.style.cssText = ` position: fixed !important; bottom: 20px !important; left: 20px !important; z-index: 2147483647 !important; display: block!important; `; // إنشاء نافذة الدردشة const whatsappPanel = document.createElement('div'); whatsappPanel.className = 'ws-chat-panel'; whatsappPanel.style.cssText = ` display: none !important; position: fixed !important; bottom: 90px !important; left: 20px !important; z-index: 2147483647 !important; `; // محتوى النافذة المعدل whatsappPanel.innerHTML = `
الدعم الفني الدعم الفني

مرحباً بك، نحن متواجدون لخدمتك

برجاء اختيار أحد الخيارات:

تواصل عبر واتساب
حلول تقنية من أدفاز
`; whatsappContainer.appendChild(whatsappPanel); // إنشاء أيقونة الواتساب المعدلة const whatsappBtn = document.createElement('img'); whatsappBtn.src = 'https://upload.wikimedia.org/wikipedia/commons/6/6b/WhatsApp.svg'; whatsappBtn.alt = 'واتساب'; whatsappBtn.className = 'ws-main-btn'; whatsappBtn.style.cssText = ` width: 60px !important; height: 60px !important; border-radius: 50% !important; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important; cursor: pointer !important; transition: transform 0.3s ease-in-out !important; display: block !important; `; whatsappContainer.appendChild(whatsappBtn); // إضافة الأنماط المعدلة const wsStyle = document.createElement('style'); wsStyle.innerHTML = ` .ws-float-container { position: fixed !important; bottom: 20px !important; left: 20px !important; z-index: 2147483647 !important; } .ws-main-btn { width: 60px !important; height: 60px !important; border-radius: 50% !important; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important; cursor: pointer !important; transition: transform 0.3s ease-in-out !important; } .ws-main-btn:hover { transform: scale(1.1) !important; } .ws-chat-panel { position: fixed !important; bottom: 90px !important; left: 20px !important; background-color: #252525; width: 300px !important; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important; padding: 15px !important; color: white !important; border-radius: 10px !important; z-index: 2147483647 !important; } .ws-panel-header { display: flex !important; justify-content: space-between !important; align-items: center !important; margin-bottom: 15px !important; } .ws-avatar-wrapper { display: flex !important; align-items: center !important; } .ws-avatar-img { width: 40px !important; height: 40px !important; border-radius: 50% !important; margin-left: 10px !important; } .ws-support-text { font-size: 16px !important; font-weight: bold !important; } .ws-close-btn { background: none !important; border: none !important; font-size: 20px !important; cursor: pointer !important; color: white !important; } .ws-options-list { list-style-type: none !important; padding: 0 !important; margin: 15px 0 !important; } .ws-options-list li { margin-bottom: 8px !important; padding-right: 10px !important; } .ws-chat-btn { display: block !important; width: 100% !important; text-align: center !important; background-color: #25d366 !important; color: white !important; padding: 10px 15px !important; border-radius: 5px !important; text-decoration: none !important; margin: 20px 0 15px !important; transition: background-color 0.3s !important; } .ws-chat-btn:hover { background-color: #1ebe55 !important; } .ws-credits { display: flex !important; justify-content: center !important; margin-top: 10px !important; } .ws-dev-link { display: flex !important; align-items: center !important; text-decoration: none !important; } .ws-dev-logo { width: 30px !important; height: 30px !important; margin-left: 5px !important; } .ws-dev-text { font-size: 12px !important; color: white !important; } `; document.head.appendChild(wsStyle); // أحداث النقر المعدلة whatsappBtn.addEventListener('click', function() { whatsappPanel.style.display = whatsappPanel.style.display === 'none' ? 'block' : 'none'; }); document.querySelector('.ws-close-btn')?.addEventListener('click', function() { whatsappPanel.style.display = 'none'; }); // إضافة العنصر إلى body مع تأخير setTimeout(function() { document.body.appendChild(whatsappContainer); console.log('تم تحميل عنصر واتساب بنجاح'); }, 500); })(); function enhanceCards() { const cards = document.querySelectorAll('.s-product-card-entry'); if (cards.length === 0) return; cards.forEach((card, index) => { if (card.querySelector('.product-rating')) return; // نجوم التقييم const stars = document.createElement('div'); stars.className = 'product-rating'; const rating = Math.floor(Math.random() * 2) + 4; for (let i = 0; i < 5; i++) { const star = document.createElement('span'); star.innerHTML = i < rating ? '★' : '☆'; stars.appendChild(star); } stars.style.display = 'flex'; stars.style.justifyContent = 'center'; stars.style.color = '#FFD700'; stars.style.fontSize = '18px'; stars.style.margin = '10px 0'; card.querySelector('.s-product-card-content-main')?.appendChild(stars); // بادج (جديد أو خصم) const badge = document.createElement('div'); badge.className = 'product-badge'; badge.textContent = index % 2 === 0 ? 'جديد' : 'حصري'; badge.style.cssText = ` position: absolute; top: 8px; right: 8px; background-color: var(--color-primary); color: white; padding: 4px 10px; border-radius: 6px; font-size: 13px; font-weight: bold; z-index: 10; `; card.style.position = 'relative'; card.appendChild(badge); }); } let tryCount = 0; const interval = setInterval(() => { enhanceCards(); tryCount++; if (tryCount > 10) clearInterval(interval); }, 1000) /* Add custom Js code below */ document.querySelectorAll('a[href=""]').forEach(x=>{x.addEventListener('click',e => {e.preventDefault();});}); (() => { const CONFIG = { selector : '.store-header', gradient : 'var(--background-gradient)', // استخدام التدرج من :root interval : 5000, fadeTime : 400, msgs : [ " 🛒💥 عروض حصرية تنتظرك الآن", "⏳💰 لا تفوت فرص التوفير اليوم", "🔥 عروض حصرية تنتظرك الآن", "🔥 خصومات لن تجدها إلا هنا", "💥💵 أسعار تبدأ من المستحيل", ] }; if (localStorage.getItem('tickerClosed')) return; const waitFor = s => new Promise(res => { if (document.querySelector(s)) return res(document.querySelector(s)); new MutationObserver((_, o) => { if (document.querySelector(s)) { o.disconnect(); res(document.querySelector(s)); } }).observe(document.documentElement, { childList: true, subtree: true }); }); const makeTicker = header => { if (document.querySelector('.clr-ticker')) return; const bar = Object.assign(document.createElement('div'), { className: 'clr-ticker', role: 'region', ariaLabel: 'إعلانات المتجر', innerHTML: ` ` }); header.parentNode.insertBefore(bar, header); const textBox = bar.querySelector('.clr-ticker-static'); const closeBtn = bar.querySelector('.clr-ticker-close'); let current = 0; const updateMessage = () => { textBox.classList.add('fade-out'); setTimeout(() => { textBox.textContent = CONFIG.msgs[current]; textBox.classList.remove('fade-out'); textBox.classList.add('fade-in'); setTimeout(() => textBox.classList.remove('fade-in'), CONFIG.fadeTime); current = (current + 1) % CONFIG.msgs.length; }, CONFIG.fadeTime); }; updateMessage(); const interval = setInterval(updateMessage, CONFIG.interval); closeBtn.onclick = () => { clearInterval(interval); bar.remove(); localStorage.setItem('tickerClosed', '1'); }; // ✅ الأنماط باستخدام متغيرات الألوان فقط const style = document.createElement('style'); style.textContent = ` .clr-ticker { --h: 42px; position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: var(--h); padding-inline: 18px; background: ${CONFIG.gradient}; color: var(--color-primary, #000); font: 700 .9rem "Cairo", sans-serif; box-shadow: 0 3px 8px var(37,61,85,0.1, rgba(0,0,0,0.1)); z-index: 9999; } .clr-ticker-static { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl; text-align: center; transition: opacity ${CONFIG.fadeTime}ms ease; } .fade-out { opacity: 0; } .fade-in { opacity: 1; } .clr-ticker-close { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: inherit; font-size: 1.3rem; cursor: pointer; line-height: 1; padding: 0 4px; } @media(max-width: 767px) { .clr-ticker { --h: 40px; font-size: .85rem; } } `; document.head.appendChild(style); }; waitFor(CONFIG.selector).then(makeTicker); })(); const style = document.createElement("style"); style.textContent = ` .custom-section-heading { color: #fff; background: var(--color-primary); padding: 14px 28px; border-radius: 16px; font-size: 1.8rem; font-weight: 900; box-shadow: 0 4px 12px rgba(0,0,0,.15); margin: 0; transition: transform 0.35s ease, box-shadow 0.35s ease; font-family: 'Cairo', sans-serif; display:none; } .custom-section-wrapper { display: flex; justify-content: center; margin-bottom: 40px; } .custom-section-heading:hover { transform: scale(1.05); box-shadow: 0 8px 20px rgba(0,0,0,0.3); } `; document.head.appendChild(style); function insertStyledSectionHeading(text, sectionIndex) { const wrapper = document.createElement("div"); const heading = document.createElement("h2"); heading.textContent = text; heading.className = "custom-section-heading"; wrapper.className = "custom-section-wrapper"; wrapper.appendChild(heading); const container = document.querySelector(`section:nth-of-type(${sectionIndex}) .container`); if (container) { container.insertBefore(wrapper, container.firstChild); } } insertStyledSectionHeading('أبرز المنتجات', 2); insertStyledSectionHeading('الأقسام', 4 ); const logo = document.querySelector('.navbar-brand img'); if (logo) { logo.src = 'https://cdn.salla.sa/cdn-cgi/image/fit=scale-down,width=400,height=400,onerror=redirect,format=auto/bRYQea/qVy0GYVFdqn39J2pXT17pg8vFZd7keCVfoDyCDCA.png'; } document.querySelectorAll('a[href=""]').forEach(a => a.addEventListener("click", e => e.preventDefault()) ); const fontLink = document.createElement("link"); fontLink.rel = "stylesheet"; fontLink.href = "https://fonts.googleapis.com/css2?family=Alexandria:wght@400;700&family=Cairo:wght@400;700&display=swap"; document.head.appendChild(fontLink); const progressDiv = document.createElement('div'); progressDiv.id = 'progress'; const progressSpan = document.createElement('span'); progressSpan.id = 'progress-value'; progressSpan.innerHTML = '↑'; progressDiv.appendChild(progressSpan); document.body.appendChild(progressDiv); let calcScrollValue = () => { let scrollProgress = document.getElementById("progress"); let progressValue = document.getElementById("progress-value"); let pos = document.documentElement.scrollTop; let calcHeight = document.documentElement.scrollHeight - document.documentElement.clientHeight; let scrollValue = Math.round((pos * 100) / calcHeight); if (pos > 100) { scrollProgress.style.display = "grid"; } else { scrollProgress.style.display = "none"; } scrollProgress.addEventListener("click", () => { document.documentElement.scrollTop = 0; }); scrollProgress.style.background = `conic-gradient(var(--color-primary) ${scrollValue}%,var(--color-light) ${scrollValue}%)`; }; window.onscroll = calcScrollValue; window.onload = calcScrollValue; document.addEventListener("DOMContentLoaded", () => { const features = [ { title: "خدمة عملاء لخدمتك وراحتك", icon: "https://i.postimg.cc/4xMzCTq0/customer-service.png" }, { title: "جودة ممتازة", icon: "https://i.postimg.cc/GhdJdTvD/quality-1.png" }, { title: "عروض وخصومات مميزة", icon: "https://i.postimg.cc/QCpPw9vK/hot-deal-1.png" } ]; const featSec = document.createElement("section"); featSec.style.cssText = ` max-width: 1000px; margin: 40px auto 60px; padding: 20px; font-family: 'Cairo', sans-serif; `; const headingWrapper = document.createElement("div"); headingWrapper.style.cssText = "display: flex; justify-content: center; margin-bottom: 40px;"; const heading = document.createElement("h2"); heading.textContent = "مميزات المتجر"; heading.style.cssText = ` color: var(--color-primary-reverse); background: var(--color-primary); padding: 12px 28px; border-radius: 16px; font-size: 1.8rem font-weight: 900; box-shadow: 0 4px 12px var(--color-primary); margin: 0; `; headingWrapper.appendChild(heading); featSec.appendChild(headingWrapper); const featStyle = document.createElement("style"); featStyle.textContent = ` .features-grid { display: grid; gap: 24px; grid-template-columns: repeat(1, minmax(0, 1fr)); } @media (min-width: 600px) { .features-grid { grid-template-columns: repeat(2, 1fr); } } @media (min-width: 992px) { .features-grid { grid-template-columns: repeat(3, 1fr); } } .feature-card { background: var(--background-gradient); border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 28px; padding: 56px 32px 44px; text-align: center; color: var(--color-primary); box-shadow: 0 6px 26px var(--color-rgba); transition: transform 0.45s cubic-bezier(.22,1,.36,1), background 0.4s ease; backdrop-filter: blur(8px); } .feature-card:hover { transform: translateY(-12px) scale(1.03); background: var(--color-light); } .feature-icon { width: 110px; height: 110px; margin: 0 auto 24px; display: block; border-radius: 50%; padding: 18px; object-fit: contain; background: var(--color-primary); border: 3px solid var(--color-secondary); box-shadow: 0 0 10px rgba(0,0,0,0.2), inset 0 0 6px rgba(255,255,255,0.2); transition: transform 0.35s ease; } .feature-card:hover .feature-icon { transform: scale(1.08) rotate(3deg); } .feature-title { font-weight: 900; font-size: 1.5rem; margin: 0; line-height: 1.3; color: var(--color-primary); text-shadow: 0 1px 2px rgba(255,255,255,0.6); } `; document.head.appendChild(featStyle); const featGrid = document.createElement("div"); featGrid.className = "features-grid"; features.forEach(f => { featGrid.insertAdjacentHTML("beforeend", `
${f.title}
${f.title}
`); }); featSec.appendChild(featGrid); const footer = document.querySelector("footer"); footer ? footer.parentNode.insertBefore(featSec, footer) : document.body.appendChild(featSec); }); document.addEventListener("DOMContentLoaded", () => { const section = document.createElement('section'); section.style.display = 'flex'; section.style.flexDirection = 'column'; section.style.alignItems = 'center'; section.style.justifyContent = 'center'; section.style.backgroundColor = 'transparent'; section.style.height = 'fit-content'; section.style.padding = '60px 20px'; section.style.fontFamily = 'Alexandria, sans-serif'; document.body.style.margin = '0'; document.body.appendChild(section); const title = document.createElement('h2'); title.innerText = 'آراء العملاء'; title.style.textAlign = 'center'; title.style.fontSize = '1.5rem'; title.style.fontWeight = 'bold'; title.style.color = '#fff'; title.style.marginBottom = '1.8rem'; title.style.padding = '15px 30px'; title.style.borderRadius = '16px'; title.style.boxShadow = '0 4px 12px rgba(0, 0, 0, 0.1)'; title.style.background = 'var(--color-primary)'; section.appendChild(title); const slider = document.createElement('div'); slider.id = 'testimonial-slider'; slider.style.width = '100%'; slider.style.maxWidth = '550px'; slider.style.background = 'var(--color-light)'; slider.style.borderRadius = '16px'; slider.style.boxShadow = '0 8px 24px rgba(0,0,0,0.1)'; slider.style.padding = '32px'; slider.style.textAlign = 'center'; slider.style.position = 'relative'; slider.style.overflow = 'hidden'; slider.style.minHeight = '250px'; section.appendChild(slider); // ⭐ بيانات محدثة تشمل rating و date const data = [ { name: 'ليان - القصيم', text: 'التعامل راقٍ والموقع واضح جدًا', gender: 'female', rating: 5 }, { name: 'جود - الخبر', text: 'التصنيفات مرتبة وسهلة في التصفح', gender: 'female', rating: 5 }, { name: 'رند - حائل', text: 'الطلب تم بسهولة وكل شيء واضح', gender: 'female', rating: 5 }, { name: 'سلمان - الأحساء', text: 'الأسعار مناسبة والتنوع جيد', gender: 'male', rating: 5 }, { name: 'غادة - أبها', text: 'المنتجات جميلة وتشجع على التكرار', gender: 'female', rating: 5 }, { name: 'نواف - نجران', text: 'الموقع بسيط والتنقل فيه سهل', gender: 'male', rating: 5 }, { name: 'تالا - ينبع', text: 'أحببت التصميم وسهولة الوصول للأقسام', gender: 'female', rating: 5 }, { name: 'خالد - الطائف', text: 'تجربة مريحة وسريعة في الاستخدام', gender: 'male', rating: 5 } ]; const avatars = { male: 'https://cdn-icons-png.flaticon.com/512/3135/3135715.png', female: 'https://cdn-icons-png.flaticon.com/512/4140/4140047.png', default: 'https://cdn-icons-png.flaticon.com/512/847/847969.png' }; data.forEach((item, index) => { const testimonial = document.createElement('div'); testimonial.className = 'testimonial'; testimonial.style.position = 'absolute'; testimonial.style.top = '0'; testimonial.style.left = '0'; testimonial.style.right = '0'; testimonial.style.bottom = '0'; testimonial.style.opacity = index === 0 ? '1' : '0'; testimonial.style.transition = 'opacity 0.6s ease-in-out'; testimonial.style.display = 'flex'; testimonial.style.flexDirection = 'column'; testimonial.style.justifyContent = 'center'; testimonial.style.alignItems = 'center'; testimonial.style.padding = '10px 20px'; const img = document.createElement('img'); img.src = avatars[item.gender] || avatars.default; img.alt = 'avatar'; img.style.width = '64px'; img.style.height = '64px'; img.style.borderRadius = '50%'; img.style.marginBottom = '12px'; img.style.border = '2px solid #eee'; testimonial.appendChild(img); const name = document.createElement('div'); name.textContent = item.name; name.style.fontWeight = 'bold'; name.style.color = 'var(--color-primary)'; name.style.marginTop = '6px'; const text = document.createElement('div'); text.textContent = item.text; text.style.color = 'var(--color-secondary)'; text.style.fontSize = '15px'; text.style.marginTop = '10px'; // ⭐ تقييم النجوم const stars = document.createElement('div'); stars.style.marginTop = '10px'; stars.style.color = '#fbc02d'; // لون النجوم stars.style.fontSize = '18px'; stars.innerHTML = '⭐'.repeat(item.rating) + '☆'.repeat(5 - item.rating); testimonial.appendChild(name); testimonial.appendChild(text); testimonial.appendChild(stars); slider.appendChild(testimonial); }); const testimonials = document.querySelectorAll('.testimonial'); let current = 0; function updateDots() { dots.forEach((dot, i) => { dot.style.backgroundColor = i === current ? 'var(--color-primary)' : 'var(--color-secondary)'; }); } function showNext(n = 1) { testimonials[current].style.opacity = '0'; current = (current + n + testimonials.length) % testimonials.length; testimonials[current].style.opacity = '1'; updateDots(); } let interval = setInterval(() => showNext(1), 5000); let startX = 0; slider.addEventListener('touchstart', e => startX = e.touches[0].clientX); slider.addEventListener('touchend', e => { const diff = e.changedTouches[0].clientX - startX; if (Math.abs(diff) > 50) { clearInterval(interval); showNext(diff < 0 ? 1 : -1); interval = setInterval(() => showNext(1), 5000); } }); // Dots const dotsContainer = document.createElement('div'); dotsContainer.style.display = 'flex'; dotsContainer.style.justifyContent = 'center'; dotsContainer.style.marginTop = '20px'; dotsContainer.style.gap = '8px'; const dots = []; data.forEach((_, index) => { const dot = document.createElement('div'); dot.style.width = '10px'; dot.style.height = '10px'; dot.style.borderRadius = '50%'; dot.style.cursor = 'pointer'; dot.style.backgroundColor = index === 0 ? 'var(--color-primary)' : 'var(--color-secondary)'; dot.style.transition = 'background-color 0.3s ease'; dot.addEventListener('click', () => { clearInterval(interval); testimonials[current].style.opacity = '0'; current = index; testimonials[current].style.opacity = '1'; updateDots(); interval = setInterval(() => showNext(1), 5000); }); dotsContainer.appendChild(dot); dots.push(dot); }); section.appendChild(dotsContainer); // Arrows const arrowLeft = document.createElement('button'); arrowLeft.innerText = '←'; const arrowRight = document.createElement('button'); arrowRight.innerText = '→'; [arrowLeft, arrowRight].forEach(btn => { btn.style.background = 'transparent'; btn.style.border = 'none'; btn.style.fontSize = '20px'; btn.style.cursor = 'pointer'; btn.style.color = 'var(--color-secondary)'; }); arrowLeft.style.position = arrowRight.style.position = 'absolute'; arrowLeft.style.left = '10px'; arrowRight.style.right = '10px'; arrowLeft.style.top = arrowRight.style.top = '50%'; arrowLeft.style.transform = arrowRight.style.transform = 'translateY(-50%)'; arrowLeft.onclick = () => { clearInterval(interval); showNext(1); interval = setInterval(() => showNext(1), 5000); }; arrowRight.onclick = () => { clearInterval(interval); showNext(-1); interval = setInterval(() => showNext(1), 5000); }; slider.appendChild(arrowLeft); slider.appendChild(arrowRight); const footer = document.querySelector("footer"); if (footer) { footer.parentNode.insertBefore(section, footer); } else { document.body.appendChild(section); } }); document.addEventListener("DOMContentLoaded", () => { const faqSection = document.createElement("section"); faqSection.id = "faq-section"; faqSection.style.cssText = ` background-color: var(--color-primary); padding: 2rem; margin: 2rem auto; width: 90%; max-width: 900px; border-radius: 15px; box-shadow: 0 6px 10px var(--color-primary); overflow: hidden; `; const faqTitle = document.createElement("h2"); faqTitle.innerText = "الأسئلة الشائعة"; faqTitle.style.cssText = ` text-align: center; color: var(--color-light); margin-bottom: 2rem; font-size: 1.2rem; font-weight: 800; border-bottom: 2px solid var(--color-secondary); padding-bottom: 0.5rem; `; faqSection.appendChild(faqTitle); const faqData = [ { question: "ما هي خيارات الدفع المتوفرة؟؟", answer: "يمكنك الدفع باستخدام مدى، البطاقات الائتمانية، Apple Pay، Stc Pay.." }, { question: " هل يمكنني استرجاع المنتجات؟؟", answer: "🔁 نعم، يمكنك استرجاع أو استبدال المنتج خلال 7 أيام بشرط أن يكون بحالته الأصلية وضمن سياسة المتجر." }, { question: "كم يستغرق التوصيل ؟", answer: "🚚 التوصيل عادة يتم خلال 8 إلى 12 أيام عمل داخل المملكة ." }, { question: "كيف يمكنني التواصل مع الدعم؟", answer: "فريق خدمة العملاء متوفر دائماً في خدمتك." } ]; const faqContainer = document.createElement("div"); faqContainer.style.cssText = ` display: flex; flex-direction: column; gap: 1rem; `; faqSection.appendChild(faqContainer); faqData.forEach(({ question, answer }, index) => { const faqItem = document.createElement("div"); faqItem.className = `faq-item-${index}`; faqItem.style.cssText = ` background-color:var(--color-secondary); border-radius: 10px; color:var(--color-light); overflow: hidden; transition: all 0.3s ease; `; const questionHeader = document.createElement("div"); questionHeader.style.cssText = ` display: flex; justify-content: space-between; align-items: center; padding: 1rem; background-color: var(--color-secondary);; cursor: pointer; color: var(--color-light); font-size: 1.1rem; font-weight: 600; `; const questionText = document.createElement("span"); questionText.innerText = question; const toggleIcon = document.createElement("span"); toggleIcon.innerText = "+"; toggleIcon.style.cssText = ` font-size: 1.5rem; transition: transform 0.3s ease; `; questionHeader.appendChild(questionText); questionHeader.appendChild(toggleIcon); faqItem.appendChild(questionHeader); const answerContent = document.createElement("div"); answerContent.style.cssText = ` padding: 2rem; color: #0D2C40; font-size: 1rem; display: none; background-color: #fff; `; answerContent.innerText = answer; faqItem.appendChild(answerContent); questionHeader.addEventListener("click", () => { const isOpen = answerContent.style.display === "block"; answerContent.style.display = isOpen ? "none" : "block"; toggleIcon.innerText = isOpen ? "+" : "-"; toggleIcon.style.transform = isOpen ? "rotate(0deg)" : "rotate(0deg)"; faqItem.style.boxShadow = isOpen ? "0 6px 12px rgba(0, 0, 0, 0.1)" : "0 10px 20px rgba(0, 0, 0, 0.2)"; }); faqContainer.appendChild(faqItem); }); const footer = document.querySelector("footer"); if (footer) { footer.parentNode.insertBefore(faqSection, footer); } else { document.body.appendChild(faqSection); } }); document.addEventListener("DOMContentLoaded", function() { const style = document.createElement('style'); style.innerHTML = ` section { opacity: 0; transform: translateY(30px) scale(0.9); transition: opacity 0.7s ease-out, transform 0.7s ease-out; /* Increased duration for smoother transition */ } section.visible { opacity: 1; transform: translateY(0) scale(1); /* Normal size and position when visible */ } `; document.head.appendChild(style); const sections = document.querySelectorAll('section'); let isChecking = false; function checkVisibility() { if (isChecking) return; isChecking = true; requestAnimationFrame(() => { sections.forEach(section => { const position = section.getBoundingClientRect(); if (position.top < window.innerHeight && position.bottom >= 0) { section.classList.add('visible'); } else { section.classList.remove('visible'); } }); isChecking = false; }); } window.addEventListener("scroll", checkVisibility); checkVisibility(); }); const sallaProductOptions = document.querySelector('salla-product-options'); const alertMessage = document.createElement('p'); alertMessage.textContent = "الرجاء اختيار أحد هذا الاختيارات للتمكن من اتمام الشراء"; alertMessage.style.backgroundColor = 'var(--color-light)'; alertMessage.style.color = 'var(--color-primary)'; alertMessage.style.padding = '15px'; alertMessage.style.border = '1px solid var(--color-primary)'; alertMessage.style.borderRadius = '5px'; alertMessage.style.marginBottom = '10px'; alertMessage.style.fontWeight = 'bold'; alertMessage.style.textAlign = 'center'; sallaProductOptions.insertBefore(alertMessage, sallaProductOptions.firstChild);