// هذا الكود يمكن دمجه مع الأكواد الأخرى في ملف JS المخصص const VIDEO_CONFIG = { VIDEO_SRC: "https://files.catbox.moe/xt5x5y.mp4", // رابط الفيديو WEBP_SRC: "https://files.catbox.moe/zgr4g8.webp", // صورة بديلة لأجهزة iOS VIDEO_LINK: "#", VIDEO_POSITION: 1, // رقم مكان الفيديو وسط الـ sections }; // ==================================================== (function () { "use strict"; if (!document.body.classList.contains("index")) return; function addVideoStyles() { const style = document.createElement("style"); style.id = "custom-video-banner-styles"; style.textContent = ` .custom-video-banner { font-size: 16px; margin: 0; padding: 0; position: relative; z-index: 1; } .custom-video-banner .container { font-size: 16px; max-width: 100%; padding: 0 20px; margin: 0 auto 15px; } .custom-video-banner .banner { display: block; overflow: hidden; border-radius: 12px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); transition: transform 0.3s ease, box-shadow 0.3s ease; text-decoration: none; position: relative; } .custom-video-banner video, .custom-video-banner img { width: 100%; height: auto; display: block; border-radius: 12px; object-fit: cover; margin: 0 auto; transition: transform 0.3s ease; } `; document.head.appendChild(style); } function createVideoSection() { const section = document.createElement("section"); section.className = "custom-video-banner s-block s-block--video-banner wide-placeholder appear"; const isIOS = /iPhone|iPad|iPod/i.test(navigator.userAgent); section.innerHTML = `
`; return section; } function insertVideoSection() { const videoSection = createVideoSection(); const sections = document.querySelectorAll("section"); if (sections.length >= VIDEO_CONFIG.VIDEO_POSITION) { sections[VIDEO_CONFIG.VIDEO_POSITION - 1].insertAdjacentElement( "afterend", videoSection ); } else { // fallback -> لو مفيش سكشن كفاية نحطه آخر الصفحة document.body.appendChild(videoSection); } } function forcePlayOnIOS(video) { const tryPlay = () => { video.play().catch(() => {}); document.removeEventListener("touchstart", tryPlay); document.removeEventListener("click", tryPlay); document.removeEventListener("scroll", tryPlay); }; document.addEventListener("touchstart", tryPlay); document.addEventListener("click", tryPlay); document.addEventListener("scroll", tryPlay); } document.addEventListener("DOMContentLoaded", () => { const video = document.querySelector(".custom-video-banner video"); if (video) { video.muted = true; video.autoplay = true; video.loop = true; video.setAttribute("playsinline", ""); video.play().catch(() => { forcePlayOnIOS(video); }); } }); function init() { addVideoStyles(); insertVideoSection(); } if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", init); } else { init(); } })(); /* Add custom Js styles below */ // === تشغيل صوت عند الضغط على زر "أضف للسلة" === document.addEventListener("DOMContentLoaded", function () { const addSound = new Audio( "https://res.cloudinary.com/dgpyctx0v/video/upload/v1753155078/Add_to_Cart_SFX_at9ofh.mp3" ); document.body.addEventListener("click", function (e) { const target = e.target.closest("salla-add-product-button"); if (target) { addSound.currentTime = 0; addSound.play().catch((err) => console.warn("الصوت لم يعمل:", err)); } }); }); // === [نهاية] صوت زر الإضافة للسلة === // === تحسين مظهر الناف بار عند التمرير للأسفل === // === [نهاية] تحسين الناف بار عند التمرير === // === [نهاية] أدوات الوصول === // === قسم الأسئلة الشائعة === document.addEventListener("DOMContentLoaded", () => { // إنشاء عنصر الحاوية الرئيسي const faqSection = document.createElement("section"); faqSection.id = "faq-section"; faqSection.style.cssText = ` background-color:transparent; padding: 2rem; margin: 2rem auto; width: 90%; /* العرض 90% من حجم الشاشة */ max-width: 800px; /* أقصى عرض للقسم */ border-radius: 10px; `; // إضافة عنوان القسم const faqTitle = document.createElement("h2"); faqTitle.innerText = "الأسئلة الشائعة"; faqTitle.style.cssText = ` text-align: center; color: var(--main-color); margin-bottom: 1.5rem; font-size: 1.5rem; /* حجم الخط يناسب الشاشات */ `; faqSection.appendChild(faqTitle); // البيانات الخاصة بالأسئلة الشائعة const faqData = [ { question: "ما هي خيارات الدفع المتوفرة؟", answer: "يمكنك الدفع باستخدام مدى، البطاقات الائتمانية، Apple Pay ، Stc Pay ", }, { question: "كم يستغرق توصيل الطلب؟", answer: "عادةً ما يتم توصيل الطلبات خلال 7 - 14 يوم عمل.", }, { question: "هل يمكنني استرجاع المنتجات؟", answer: "نعم، يمكنك استرجاع المنتجات خلال 7 أيام من استلامها وفقًا لسياسة الإرجاع.", }, ]; // إنشاء الأسئلة والإجابات faqData.forEach(({ question, answer }) => { const questionContainer = document.createElement("div"); questionContainer.style.cssText = ` margin-bottom: 1rem; border-bottom: 1px solid #ccc; padding-bottom: 0.5rem; `; const questionEl = document.createElement("h3"); questionEl.innerText = question; questionEl.style.cssText = ` cursor: pointer; margin: 0; color:var(--main-color); font-size: 1.2rem; `; const answerEl = document.createElement("p"); answerEl.innerText = answer; answerEl.style.cssText = ` display: none; margin-top: 0.5rem; color:var(--main-color); font-size: 1rem; `; // إضافة تفاعل النقر questionEl.addEventListener("click", () => { const isVisible = answerEl.style.display === "block"; answerEl.style.display = isVisible ? "none" : "block"; }); questionContainer.appendChild(questionEl); questionContainer.appendChild(answerEl); faqSection.appendChild(questionContainer); }); // إضافة القسم قبل الفوتر const footer = document.querySelector("footer"); footer.parentNode.insertBefore(faqSection, footer); }); // === [نهاية] فقاعات الأسئلة الشائعة === const waveWrapper = document.createElement("div"); waveWrapper.className = "wave-lottie-wrapper"; waveWrapper.innerHTML = `${d.price}