document.addEventListener("DOMContentLoaded", function () { const path = window.location.pathname.replace(/\/+$/, ""); if (path !== "" && path !== "/index.html") return; const target = document.querySelector(".s-block.s-block--photos-slider"); if (!target) return; // إنشاء السكشن const section = document.createElement("section"); section.className = "ef-accessories-promo"; section.innerHTML = `

تألقي مع كل إطلالة من شغف

اكتشفي تشكيلتنا الجديدة التي تمنحك أناقة فريدة في كل مناسبة. من القطع الرسمية الرصينة إلى الإطلالات اليومية المريحة — دعِ شغف يلهم أسلوبك ويكمل تفاصيلك بأناقة لا مثيل لها.

مجموعة الإكسسوارات
`; // CSS const style = document.createElement("style"); style.textContent = ` :root { --main-color: #596064; --second-color: #020202; --third-color: #f5f5f5; } .ef-accessories-promo { position: relative; overflow: hidden; color: var(--third-color); padding: 60px 20px; display: flex; justify-content: center; align-items: center; direction: rtl; } /* الخلفية بالنقط */ .ef-bubbles { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; z-index: 0; } .ef-bubbles span { position: absolute; display: block; width: 10px; height: 10px; background: #ffffff; border-radius: 50%; animation: floatBubble 8s infinite ease-in-out; } @keyframes floatBubble { 0% { transform: translateY(0) scale(1); opacity: 0.8; } 50% { transform: translateY(-40px) scale(1.2); opacity: 0.4; } 100% { transform: translateY(0) scale(1); opacity: 0.8; } } .ef-promo-container { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 40px; max-width: 1300px; width: 100%; } .ef-promo-image img { width: 100%; height: auto; border-radius: 16px; } .ef-promo-content h2 { font-size: clamp(26px, 4vw, 42px); color: var(--third-color); margin-bottom: 20px; } .ef-promo-content p { font-size: 18px; line-height: 1.6; margin-bottom: 30px; color: var(--third-color); } .ef-promo-buttons { display: flex; gap: 15px; flex-wrap: wrap; } .ef-btn { text-decoration: none; padding: 12px 24px; border-radius: 30px; font-weight: 600; transition: all 0.3s ease; } .ef-shop-now { background: var(--third-color); color: var(--second-color); } .ef-shop-now:hover { background: var(--third-color); transform: scale(1.05); } .ef-learn-more { border: 2px solid var(--third-color); color: var(--third-color); } .ef-learn-more:hover { background: var(--main-color); color: #fff; } @media (max-width: 992px) { .ef-promo-container { grid-template-columns: 1fr; text-align: center; } .ef-promo-image { order: -1; } .ef-promo-buttons { justify-content: center; } } `; document.head.appendChild(style); // إضافة النقط المتحركة ديناميكيًا const bubblesContainer = section.querySelector(".ef-bubbles"); for (let i = 0; i < 20; i++) { const bubble = document.createElement("span"); bubble.style.left = Math.random() * 100 + "%"; bubble.style.top = Math.random() * 100 + "%"; bubble.style.animationDelay = `${Math.random() * 5}s`; bubble.style.animationDuration = `${6 + Math.random() * 4}s`; bubble.style.width = `${6 + Math.random() * 10}px`; bubble.style.height = bubble.style.width; bubblesContainer.appendChild(bubble); } target.insertAdjacentElement("afterend", section); }); //section document.addEventListener('DOMContentLoaded', function () { const path = window.location.pathname.replace(/\/+$/, ''); if (path !== '' && path !== '/index.html') return; // أول سكشن (SHOP SECTIONS) const fixedBanner = document.querySelector('.s-block.s-block--fixed-banner.wide-placeholder'); if (fixedBanner) addAnimatedHeading(fixedBanner, 'beforebegin', 'SHOP SECTIONS', 'ef-shop-sections-heading', 'blinkShop'); // ثاني سكشن (OUR PRODUCTS) const photosSlider = document.querySelector('.s-block.s-block--photos-slider'); if (photosSlider) addAnimatedHeading(photosSlider, 'afterend', 'OUR PRODUCTS', 'ef-our-products-heading', 'blink'); }); function addAnimatedHeading(target, position, text, className, animName) { const heading = document.createElement('h2'); heading.className = className; document.head.insertAdjacentHTML('beforeend', ` `); target.insertAdjacentElement(position, heading); let i = 0; let isDeleting = false; let widthLocked = false; function typeLoop() { const current = text.substring(0, i); heading.textContent = current; // نثبت العرض بعد أول مرة تتكتب الكلمة كاملة if (!widthLocked && i === text.length) { heading.style.width = heading.offsetWidth + 'px'; widthLocked = true; } if (!isDeleting && i < text.length) { i++; setTimeout(typeLoop, 150); } else if (isDeleting && i > 1) { i--; setTimeout(typeLoop, 100); } else { if (!isDeleting) { isDeleting = true; setTimeout(typeLoop, 1500); } else { isDeleting = false; setTimeout(typeLoop, 800); } } } typeLoop(); } //faq document.addEventListener("DOMContentLoaded", function () { if (window.location.pathname !== "/" && window.location.pathname !== "/index.html") return; const section = document.createElement("section"); section.className = "faq-services-section"; const container = document.createElement("div"); container.className = "faq-services-container"; // ===== بيانات البوكسات بالترتيب المطلوب ===== const data = [ // الصف الأول { question: "ما هي خيارات الدفع المتوفرة؟", answer: "يمكنك الدفع باستخدام مدى، البطاقات الائتمانية، Apple Pay ، Stc Pay", type: "text", }, { media: "https://i.postimg.cc/0jX7Q4HZ/Artboard-4-8.png", type: "image", }, { question: "كم يستغرق توصيل الطلب؟", answer: "عادةً ما يتم توصيل الطلبات خلال 9-14 يوم عمل.", type: "text", }, // الصف الثاني { media: "https://files.catbox.moe/kkr82j.mp4", type: "video", }, { question: "هل يمكنني استرجاع المنتجات؟", answer: "نعم، يمكنك استرجاع المنتجات خلال 7 أيام من استلامها وفقًا لسياسة الإرجاع.", type: "text", }, { media: "https://files.catbox.moe/rl5acx.mp4", type: "video", }, ]; // ====== إنشاء الكروت ====== data.forEach(({ question, answer, media, type }) => { const card = document.createElement("div"); card.className = "faq-service-card"; if (type === "video") { const videoEl = document.createElement("video"); videoEl.src = media; videoEl.autoplay = true; videoEl.loop = true; videoEl.muted = true; videoEl.playsInline = true; videoEl.className = "card-media"; card.appendChild(videoEl); } else if (type === "image") { const imgEl = document.createElement("img"); imgEl.src = media; imgEl.alt = question || ""; imgEl.className = "card-media"; card.appendChild(imgEl); } // لو بوكس نص فقط if (type === "text") { const wrapper = document.createElement("div"); wrapper.className = "card-text-wrapper"; const qEl = document.createElement("div"); qEl.className = "card-question"; qEl.textContent = question; const aEl = document.createElement("div"); aEl.className = "card-answer"; aEl.textContent = answer; wrapper.appendChild(qEl); wrapper.appendChild(aEl); card.appendChild(wrapper); card.classList.add("text-only"); } container.appendChild(card); }); section.appendChild(container); // إدراج قبل آراء العملاء const testimonialsSection = document.querySelector(".s-block--testimonials"); if (testimonialsSection) { testimonialsSection.parentNode.insertBefore(section, testimonialsSection); } else { document.body.appendChild(section); } // ====== CSS ====== const style = document.createElement("style"); style.textContent = ` :root { --text-color: #fff; --radius: 14px; --bg-color: #596064; } .faq-services-section { padding: 50px 20px; } .faq-services-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 1300px; margin: 0 auto; } .faq-service-card { position: relative; border-radius: var(--radius); overflow: hidden; height: 290px; display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; transition: transform 0.4s ease; padding: 15px; } .card-media { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; } .faq-service-card:hover { transform: scale(1.05); } /* بوكسات النص فقط */ .faq-service-card.text-only { background: var(--bg-color); color: var(--text-color); display: flex; align-items: center; justify-content: center; } .card-text-wrapper { text-align: center; } .card-question { font-size: 22px; font-weight: bold; margin-bottom: 8px; } .card-answer { font-size: 18px; line-height: 1.4; } @media (max-width: 992px) { .faq-services-container { grid-template-columns: 1fr 1fr; } } @media (max-width: 600px) { .faq-services-container { grid-template-columns: 1fr; } } `; document.head.appendChild(style); }); /* Add custom Js styles below */ // إضافة مكتبة Font Awesome تلقائياً للهيدر const fa = document.createElement("link"); fa.rel = "stylesheet"; fa.href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css"; fa.crossOrigin = "anonymous"; fa.referrerPolicy = "no-referrer"; document.head.appendChild(fa); //end icons document.addEventListener("DOMContentLoaded", function () { // 1. إضافة أيقونة السلة بجانب السعر const priceElement = document.querySelector('.s-product-card-price'); const iconElement = document.querySelector('.s-button-btn'); if (priceElement && iconElement) { priceElement.parentNode.insertBefore(iconElement, priceElement.nextSibling); } // 2. ستايل عام + ظهور سلس للكرتات const styleTag = document.createElement("style"); styleTag.innerHTML = ` .enhanced-card { opacity: 0; transform: translateY(50px); transition: all 0.6s ease; } .enhanced-card.visible { opacity: 1 !important; transform: translateY(0) !important; } `; document.head.appendChild(styleTag); // 3. دالة لفحص ظهور الكرتات في الشاشة function checkVisibility() { document.querySelectorAll(".s-product-card-entry").forEach(product => { const rect = product.getBoundingClientRect(); if (rect.top < window.innerHeight * 0.9 && rect.bottom >= 0) { product.classList.add("visible"); } else { product.classList.remove("visible"); } }); } // 4. إنشاء النجوم والشارات لكل كرت منتج function enhanceCards() { document.querySelectorAll('.s-product-card-entry').forEach(card => { // منع الازدواجية if (card.querySelector('.stars')) return; // نجوم التقييم const stars = document.createElement('div'); stars.className = 'stars'; const rating = Math.floor(Math.random() * 2) + 4; stars.style.setProperty('--rating', `${(rating / 5) * 100}%`); card.querySelector('.s-product-card-content-main')?.appendChild(stars); // شارة عشوائية const badge = document.createElement('div'); badge.className = 'product-badge'; const badges = [ { text: 'جديد ', bg: '#596064' }, { text: 'حصري ', bg: '#020202' }, { text: 'اشترِ الآن ', bg: '#020202' }, { text: 'حديثًا ', bg: '#596064' } ]; const selected = badges[Math.floor(Math.random() * badges.length)]; badge.textContent = selected.text; badge.style.cssText = ` position: absolute; top: 10px; right: 10px; background-color: ${selected.bg}; color: white; padding: 4px 8px; border-radius: 0.3rem; font-size: 0.7rem; font-weight: bold; z-index: 10; `; card.style.position = 'relative'; card.classList.add('enhanced-card'); card.appendChild(badge); }); } // 5. تكرار المحاولة وتفعيل الفحص والتعزيز let tries = 0; const interval = setInterval(() => { enhanceCards(); checkVisibility(); if (++tries > 10) clearInterval(interval); }, 500); window.addEventListener("scroll", checkVisibility); }); // =========== 👆 BACK TO TOP BUTTON ========= const backToTopButton = document.createElement("div"); backToTopButton.id = "backToTop"; backToTopButton.innerHTML = `
`; document.body.appendChild(backToTopButton); const style = ` #backToTop { position: fixed; bottom: 20px; right: 20px; width: 60px; height: 60px; display: none; z-index: 1000; } #backToTop .icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2; color: var(--second-color); } .circular-chart { width: 100%; height: 100%; transform: rotate(-90deg); } .circle-bg { fill: none; stroke: transparent; stroke-width: 3.8; } .circle { fill: none; stroke: var(--second-color); stroke-width: 3.8; stroke-dasharray: 100, 100; stroke-linecap: round; transition: stroke-dasharray 0.1s linear; } #backToTop:hover .icon { color: var(--main-color); } `; const styleSheet = document.createElement("style"); styleSheet.type = "text/css"; styleSheet.textContent = style; document.head.appendChild(styleSheet); window.addEventListener("scroll", () => { const scrollTop = window.scrollY; const docHeight = document.documentElement.scrollHeight - window.innerHeight; const scrollPercent = (scrollTop / docHeight) * 100; if (scrollPercent > 1) { backToTopButton.style.display = "block"; } else { backToTopButton.style.display = "none"; } const circle = document.querySelector(".circle"); const offset = 100 - scrollPercent; circle.style.strokeDasharray = `${scrollPercent}, 100`; }); backToTopButton.addEventListener("click", () => { window.scrollTo({ top: 0, behavior: "smooth", }); }); // Additional code block // ======== ⚠️ EMPTY LINKS PREVENT DEFAULT========== document.querySelectorAll('a[href=""], a[href="#"]').forEach(link => { link.addEventListener('click', event => { event.preventDefault(); }); }); // Select the salla-product-options element // ============= 📢 PRODUCT OPTION ALERT =========== const sallaProductOptions = document.querySelector('salla-product-options'); // Ensure the element exists before proceeding if (sallaProductOptions) { // Create the alert message const alertMessage = document.createElement('p'); alertMessage.textContent = "الرجاء اختيار أحد هذا الاختيارات للتمكن من اتمام الشراء"; // Apply styles directly to the element alertMessage.style.backgroundColor = '#ffdddd'; alertMessage.style.color = '#a94442'; alertMessage.style.padding = '15px'; alertMessage.style.border = '1px solid #a94442'; alertMessage.style.borderRadius = '5px'; alertMessage.style.marginBottom = '10px'; alertMessage.style.fontWeight = 'bold'; alertMessage.style.textAlign = 'center'; // Insert the alert message at the beginning of the salla-product-options element sallaProductOptions.insertBefore(alertMessage, sallaProductOptions.firstChild); } else { console.error("The 'salla-product-options' element was not found on the page."); } // Apply styles directly to the element // Insert the banner swap (now called banSwiper) const banSwiperHTML = ` `; // Insert the banSwiper as the first element in the body document.body.insertAdjacentHTML('afterbegin', banSwiperHTML); // Create the loader div element // ==================== 🖼️ SCROLL EFFECT FOR BANNERS ==================== function handleScroll() { const elements = document.querySelectorAll('.banner--fixed img'); elements.forEach(element => { const rect = element.getBoundingClientRect(); // إذا العنصر ظهر في نافذة المتصفح if (rect.top <= window.innerHeight && rect.bottom >= 0) { // هنضيف الكلاس visible لتشغيل تأثير الـ Bounce و Zoom if (!element.classList.contains('visible')) { element.classList.add('visible'); } } else { // لو العنصر مش ظاهر، نشيل الكلاس visible علشان التأثير يتكرر لما يظهر تاني if (element.classList.contains('visible')) { element.classList.remove('visible'); } } }); } window.addEventListener('scroll', handleScroll); handleScroll(); // لتنفيذ التأثير أول مرة عند تحميل الصفحة // ==================== 🖼️ SCROLL EFFECT FOR PHOTOS SLIDER ==================== function handleScroll2() { const elements = document.querySelectorAll('salla-slider.photos-slider'); elements.forEach(element => { const rect = element.getBoundingClientRect(); // إذا العنصر ظهر في نافذة المتصفح (مرة واحدة فقط) if (rect.top <= window.innerHeight && rect.bottom >= 0) { if (!element.classList.contains('visible')) { element.classList.add('visible'); // إضافة الكلاس ليحصل التأثير } } }); } window.addEventListener('scroll', handleScroll2); handleScroll2(); // لتنفيذ التأثير عند تحميل الصفحة // ======== 🖼️ SCROLL EFFECT FOR BACKGROUND ========= function handleScroll3() { const elements = document.querySelectorAll('.lazy__bg'); elements.forEach(element => { const rect = element.getBoundingClientRect(); // إذا العنصر ظهر في نافذة المتصفح if (rect.top <= window.innerHeight && rect.bottom >= 0) { // هنضيف الكلاس visible لتشغيل تأثير الـ Bounce و Zoom if (!element.classList.contains('visible')) { element.classList.add('visible'); } } else { // لو العنصر مش ظاهر، نشيل الكلاس visible علشان التأثير يتكرر لما يظهر تاني if (element.classList.contains('visible')) { element.classList.remove('visible'); } } }); } window.addEventListener('scroll', handleScroll3); handleScroll3(); // لتنفيذ التأثير أول مرة عند تحميل الصفحة // ======== 🛍️ BLUR EFFECT ON PRODUCT CARDS ========== function handleScrollBlur() { const elements = document.querySelectorAll('.s-product-card-vertical'); elements.forEach(element => { const rect = element.getBoundingClientRect(); // التحقق إذا كان العنصر داخل نافذة العرض if (rect.top <= window.innerHeight && rect.bottom >= 0) { element.classList.add('visible'); // إضافة كلاس التفعيل } else { element.classList.remove('visible'); // إزالة كلاس التفعيل } }); } // تنفيذ الكود عند التمرير window.addEventListener('scroll', handleScrollBlur); // استدعاء الوظيفة عند تحميل الصفحة handleScrollBlur(); // Create scrolling text dynamically document.addEventListener("DOMContentLoaded", function () { // إنشاء عناصر الواتساب var whatsappFloat = document.createElement('div'); whatsappFloat.className = 'whatsapp-float'; var whatsappPopup = document.createElement('div'); whatsappPopup.className = 'whatsapp-popup'; whatsappPopup.style.display = 'none'; var popupContent = `
`; whatsappPopup.innerHTML = popupContent; whatsappFloat.appendChild(whatsappPopup); var whatsappIcon = document.createElement('img'); whatsappIcon.src = 'https://i.postimg.cc/W1qs7gFw/Cat-playing-animation.gif'; whatsappIcon.alt = 'WhatsApp'; whatsappIcon.className = 'whatsapp-icon'; whatsappFloat.appendChild(whatsappIcon); document.body.appendChild(whatsappFloat); // CSS var style = document.createElement('style'); style.innerHTML = `/* كل ستايلاتك هنا */ .whatsapp-float { position: fixed; bottom: 20px; left: 20px; z-index: 100; } .whatsapp-icon { width: 100px; height: 100px; border-radius: 50%; cursor: pointer; transition: transform 0.3s ease-in-out; } .whatsapp-popup { position: fixed; bottom: 90px; left: 20px; background: linear-gradient(var(--second-color), var(--main-color)); width: 300px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); padding: 15px; color: white; z-index: 101; border-radius: 10px; } .popup-header { display: flex; justify-content: space-between; align-items: center; } .support-text { font-size: 16px; font-weight: bold; } .close-popup { background: none; border: none; font-size: 20px; cursor: pointer; } .whatsapp-button { display: block; width: 100%; text-align: center; background-color: #25d366; color: white; padding: 10px 15px; border-radius: 5px; text-decoration: none; margin-top: 15px; } .whatsapp-button:hover { background-color: #1ebe55; } .adfaz-img { width: 30px; height: 30px; margin-left: 3px; } .adfaz-text { font-size: 12px; color: white; } `; document.head.appendChild(style); // Toggle & Close whatsappIcon.addEventListener('click', function () { whatsappPopup.style.display = (whatsappPopup.style.display === 'none') ? 'block' : 'none'; }); whatsappPopup.querySelector('.close-popup').addEventListener('click', function () { whatsappPopup.style.display = 'none'; }); }); //end whatsapp //hero // Contact Section document.addEventListener("DOMContentLoaded", function () { const contactSection = document.createElement("section"); contactSection.id = "contact-section"; contactSection.style.padding = "3rem 2rem"; contactSection.style.margin = "3rem auto"; contactSection.style.width = "95%"; contactSection.style.maxWidth = "850px"; contactSection.style.borderRadius = "16px"; contactSection.style.background = "#fff"; contactSection.style.boxShadow = "0 8px 25px rgba(0,0,0,0.08)"; contactSection.style.transition = "transform 0.3s ease"; contactSection.innerHTML = `

تواصل معنا

`; // إدخال تأثير Hover & Focus const style = document.createElement("style"); style.innerHTML = ` #contact-section input:focus, #contact-section textarea:focus { border-color: var(--main-color); box-shadow: 0 0 6px rgba(0,0,0,0.08); transform: scale(1.01); } #contact-section button:hover { background: var(--second-color); transform: scale(1.05); } `; document.head.appendChild(style); // إدراج بعد الـ FAQ const faqSection = document.getElementById("faq-section"); faqSection.insertAdjacentElement("afterend", contactSection); // عند الإرسال document.getElementById("contact-form").addEventListener("submit", function(e) { e.preventDefault(); const name = this.from_name.value; const email = this.from_email.value; const message = this.message.value; window.location.href = `mailto:rad80992@gmail.com?subject=رسالة من ${encodeURIComponent(name)}&body=البريد: ${encodeURIComponent(email)}%0A%0Aالرسالة:%0A${encodeURIComponent(message)}`; }); }); //start loading const loader = document.createElement('div'); loader.className = 'custom-loader'; loader.innerHTML = ` Loading `; document.body.appendChild(loader); window.addEventListener("load", () => { // بعد نص ثانية خلي الخلفية تتحول رمادي شفاف setTimeout(() => { loader.classList.add('gray-phase'); }, 500); // بعد 2.5 ثانية اخفي اللودر كله setTimeout(() => { loader.classList.add('hide-loader'); }, 2500); }); //end loading