/* Add custom JS code below */ // /* // // adding gif vedio to banners // document.addEventListener("DOMContentLoaded", function () { // if (!document.body.classList.contains("index")) return; // const banners = document.querySelectorAll('.s-block--fixed-banner .banner--fixed'); // if (banners[0]) { // banners[0].innerHTML = ` // // `; // } // if (banners[2]) { // banners[2].innerHTML = ` // // `; // } // }); // // adding giv vedio to slider // document.addEventListener("DOMContentLoaded", function () { // if (!document.body.classList.contains("index")) return; // const videoUrl = "https://res.cloudinary.com/dieoptjji/video/upload/v1773227817/%D8%A8%D9%86%D8%B1_%D8%B4%D8%AD%D9%86_%D9%85%D8%AC%D8%A7%D9%86%D9%8A_%D9%84%D8%AC%D9%85%D9%8A%D8%B9_%D8%B7%D9%84%D8%A8%D8%A7%D8%AA%D9%83_%D8%B9%D9%86_%D8%A7%D9%84%D8%AA%D8%B3%D9%88%D9%82_%D8%A8%D9%82%D9%8A%D9%85%D8%A9_250_%D8%B1%D9%8A%D8%A7%D9%84_kqfcn5.mp4"; // function replaceSecondSlideWithVideo() { // const slider = document.querySelector("section.s-block--photos-slider"); // if (!slider) return; // const slides = slider.querySelectorAll( // ".swiper-wrapper > .swiper-slide:not(.swiper-slide-duplicate)" // ); // if (!slides.length || !slides[1]) return; // const secondSlide = slides[1]; // if (secondSlide.querySelector(".custom-slider-video")) return; // const oldLink = secondSlide.querySelector("a"); // const href = oldLink ? oldLink.getAttribute("href") : "#"; // secondSlide.innerHTML = ` // // // // `; // const video = secondSlide.querySelector(".custom-slider-video"); // if (video) { // video.controls = false; // video.muted = true; // video.playsInline = true; // video.setAttribute("draggable", "false"); // video.play().catch(() => {}); // } // } // function initVideoSlide() { // replaceSecondSlideWithVideo(); // setTimeout(replaceSecondSlideWithVideo, 500); // setTimeout(replaceSecondSlideWithVideo, 1000); // setTimeout(replaceSecondSlideWithVideo, 2000); // setTimeout(replaceSecondSlideWithVideo, 3000); // } // initVideoSlide(); // window.addEventListener("load", initVideoSlide); // const slider = document.querySelector("section.s-block--photos-slider"); // if (slider) { // const observer = new MutationObserver(() => { // replaceSecondSlideWithVideo(); // }); // observer.observe(slider, { // childList: true, // subtree: true // }); // } // }); // */ // 🔄 1. تحويل عنوان السيكشن من h1 إلى h2 // 🔄 2. تحويل أسماء العملاء من h2 إلى p // 🎨 3. جعل أسماء العملاء بخط بولد (function () { function fixReviewsTags() { // العنوان الرئيسي "آراء العملاء" const sectionTitle = document.querySelector('.s-reviews-header'); if (sectionTitle && sectionTitle.tagName !== 'H2') { const newTitle = document.createElement('h2'); newTitle.className = sectionTitle.className; newTitle.innerHTML = sectionTitle.innerHTML; sectionTitle.replaceWith(newTitle); } // أسماء العملاء const nameElements = document.querySelectorAll('.s-reviews-testimonial__info h2'); nameElements.forEach(function (el) { const newP = document.createElement('p'); newP.className = el.className; newP.innerHTML = el.innerHTML; el.replaceWith(newP); }); } fixReviewsTags(); const observer = new MutationObserver(fixReviewsTags); observer.observe(document.body, { childList: true, subtree: true }); // 🎨 4. حقن ستايل البولد لأسماء العملاء const styleId = 'reviews-name-bold-style'; if (!document.getElementById(styleId)) { const style = document.createElement('style'); style.id = styleId; style.textContent = ` .s-reviews-testimonial__info p { font-weight: bold; } `; document.head.appendChild(style); } })(); // 🛠️ 5. إصلاح: التأكد من وجود العنصر قبل استخدامه لمنع Error في الكونسول بباقي الصفحات document.addEventListener('DOMContentLoaded', function () { let picF = document.querySelector(".cart footer"); if (!picF) return; // ✅ لو العنصر مش موجود (في غير صفحة الكارت) يوقف من غير Error let newFeat = document.createElement("section"); newFeat.setAttribute("class", "s-block s-block--testimonials container overflow-hidden"); newFeat.innerHTML = `

آراء العملاء

عبدالله الحميدي

رائع المنتجات والاهم دقه التصنيع وجمال الاخراج وسرعه التوصيل مبهرررررر ❤️❤️❤️

عبدالله الحميدي

Asem Shenauy

حلوه الطريقه ومريحه عجبت الكل واخدوا حسابكم

Asem Shenauy

Ebtihal Ibrahim

تعامل جدا ممتاز و السكر متقن و يواجه ماشاءلله راح اطلب زياده👍🏻

Ebtihal Ibrahim

هياء محمد

حبيت سرعة التوصيل

هياء محمد

وفاء المالكي

كمنظر جميله جدا لسى ماستخدمتها لاني مخليتها لنفاسي ان شاءالله قد الثقه

وفاء المالكي

مهره العسيري

شكرا جزيلا جميييييل

مهره العسيري

بدرية عويس

المتجر أكثر من رائع خاصة أن القائمة عليه من بناتنا اللاتي نفتخر فيهم ذوق وتعامل ورقي والمنتج يمثلها بمافيه من جمالية وأناقة الله يبارك لها

بدرية عويس

مشعل العتيبي

جميل مررره و بسرعه وصلني واكيد مو اخر تعامل

مشعل العتيبي

مريم البوعينين

جميل جداً ومرتب كل حبه مغلفه لحالها الصراحه شي يواجه للضيوف وحجمها مناسب انصح فيه صراحه للعيد وشكرا من القلب وتسلم الأيادي ❤️❤️❤️❤️❤️🌹🌹🌹🌹🌹🌹🌹

مريم البوعينين

شريفةً حسن

المعاملة ممتازة
للان لم استخدم المنتج بس الشكل والرائحة ممتازة

شريفةً حسن

عبدالله الشهراني

الله يبارك لك 👍🏻

عبدالله الشهراني

هاجر عمر

متجر يستحق الثناء والشكر على الترتيب والإتقان وسرعة التوصيل

هاجر عمر

نوره الحميدانى

خدمه سريعه
والمنتج رائع وانيق من ناحيه الشكل
ولذيذ الطعم

نوره الحميدانى

انهار الشريدي

وصلني السكر مره يجنن و الشغل جداً مرتب تسلم يدينك انصحكم يستحق التجربه و البكج مرتب و وصلتني بسرعه ، يعطيك العافييه 🤩👏🏻♥️♥️♥️♥️.

انهار الشريدي

هيا احمد

ما شالله تبارك الله الي سواهم فنان
حسفه استعمله بحطهم زينه🤣😍🌹❤️🥰

هيا احمد

ابتسام محمد

ابتسام محمد

ام فهد الحربي

اشكرهم صراحة ذوق في التعامل وسرعة في التوصيل والمنتج جميل وراقي

ام فهد الحربي

Othman Ajeebi

ممتاز و اشكرك على خدمة التوصيل السريعه

Othman Ajeebi

صالحه الزهراني

طلبت الاستاند اثنين وجدا ممتازه 👍🏼

صالحه الزهراني

يزيد العقيلي

متجر ممتاز وشغل مرتب يعطيكم العافيه

يزيد العقيلي

`; picF.before(newFeat); }); /********شريط متحرك**********/ /* ========================================== PROMO BANNER SCRIPT - بانر إعلاني متحرك ========================================== الوصف: سكريبت لإضافة بانر إعلاني متحرك في أعلى الموقع المميزات: - بانر متحرك بشكل مستمر (نفس الحركة بالضبط) - يثبت عند التمرير للأسفل - زر إغلاق مع حفظ الحالة - متجاوب مع جميع الأجهزة ========================================== */ (function() { 'use strict'; /* ============================================================ ⚙️ الإعدادات - SETTINGS غير الإعدادات هنا بسهولة ============================================================ */ const CONFIG = { /* 📝 النص الإعلاني - PROMO MESSAGE */ message: 'شحن مجاني للطلبات فوق 300 ريال', /* 🔗 الرابط - BANNER LINK */ url: 'https://sweetensugar.com/%D8%A7%D9%84%D8%B9%D8%B1%D9%88%D8%B6/c1159290053', /* 🎨 الألوان - COLORS */ backgroundColor: '#FFFFFF', // لون الخلفية (أزرق غامق) textColor: '#FF0000', // لون النص (أبيض) /* ⚡ إعدادات الحركة - ANIMATION SETTINGS */ animationSpeed: '50s', // سرعة الحركة (50s = بطيء، 30s = سريع) /* 📏 الأبعاد - DIMENSIONS */ bannerHeight: '40px', // ارتفاع البانر على الكمبيوتر bannerHeightMobile: '35px', // ارتفاع البانر على الموبايل /* 💾 حفظ حالة الإغلاق - SAVE CLOSE STATE */ rememberClose: true, // true = يحفظ الإغلاق، false = يظهر دائماً storageKey: 'rb-promo-banner-closed' }; /* ============================================================ */ // Check if banner was closed before if (CONFIG.rememberClose) { try { const wasClosed = localStorage.getItem(CONFIG.storageKey); if (wasClosed === 'true') { return; // Don't show banner } } catch (e) { console.warn('LocalStorage not available:', e); } } // Check if banner already exists to prevent duplicates if (document.getElementById('rb-promo-banner-2024')) { return; } // Create banner elements const banner = document.createElement('div'); banner.id = 'rb-promo-banner-2024'; banner.className = 'rb-promo-banner-2024'; banner.setAttribute('role', 'banner'); banner.setAttribute('aria-label', 'عرض ترويجي'); // Create close button const closeBtn = document.createElement('button'); closeBtn.className = 'rb-promo-close-btn-2024'; closeBtn.setAttribute('aria-label', 'إغلاق البانر'); closeBtn.innerHTML = '×'; closeBtn.onclick = function(e) { e.preventDefault(); e.stopPropagation(); closeBanner(); }; // Create anchor link const link = document.createElement('a'); link.href = CONFIG.url; link.className = 'rb-promo-banner-link-2024'; link.setAttribute('target', '_blank'); link.setAttribute('rel', 'noopener noreferrer'); link.setAttribute('aria-label', 'عملائنا الكرام نعتذر، لايمكننا استقبال طلبات لمدة 3 أسابيع - المتجر مغلق مؤقتا نشكركم لتفهمكم'); // Create banner content const content = document.createElement('div'); content.className = 'rb-promo-banner-content-2024'; // Create text container const animatedContainer = document.createElement('div'); animatedContainer.className = 'rb-promo-animated-container-2024'; animatedContainer.setAttribute('aria-live', 'polite'); // Create two text strips for continuous effect (نفس الحركة بالضبط) for (let i = 0; i < 2; i++) { const textStrip = document.createElement('div'); textStrip.className = 'rb-promo-text-strip-2024'; textStrip.innerHTML = `${CONFIG.message}${CONFIG.message}`; animatedContainer.appendChild(textStrip); } // Build the banner structure content.appendChild(animatedContainer); link.appendChild(content); banner.appendChild(link); banner.appendChild(closeBtn); // Add CSS styles const style = document.createElement('style'); style.id = 'rb-promo-banner-styles-2024'; style.textContent = ` .rb-promo-banner-2024 { width: 100%; overflow: hidden; background-color: ${CONFIG.backgroundColor}; height: ${CONFIG.bannerHeight}; display: flex; align-items: center; position: relative; z-index: 30; box-sizing: border-box; } .rb-promo-banner-link-2024 { display: block; text-decoration: none; color: ${CONFIG.textColor}; width: 100%; height: 100%; transition: opacity 0.3s ease; } .rb-promo-banner-link-2024:hover { opacity: 0.9; } .rb-promo-banner-link-2024:focus { outline: 2px solid ${CONFIG.textColor}; outline-offset: -4px; } .rb-promo-close-btn-2024 { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.2); border: none; color: ${CONFIG.textColor}; font-size: 24px; line-height: 1; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; z-index: 5; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; padding: 0; } .rb-promo-close-btn-2024:hover { background: rgba(255, 255, 255, 0.3); transform: translateY(-50%) scale(1.1); } .rb-promo-close-btn-2024:focus { outline: 2px solid ${CONFIG.textColor}; outline-offset: 2px; } .rb-promo-banner-content-2024 { padding: 0 50px 0 50px; height: 100%; width: 100%; overflow: hidden; position: relative; } .rb-promo-animated-container-2024 { height: 100%; width: 100%; position: relative; overflow: hidden; direction: ltr; /* الحركة من الشمال لليمين */ } /* الحركة من الشمال لليمين - Animation left to right */ .rb-promo-text-strip-2024 { position: absolute; white-space: nowrap; height: 100%; display: flex; align-items: center; animation: rb-promo-ribbon-scroll-2024 ${CONFIG.animationSpeed} linear infinite; will-change: transform; } .rb-promo-text-strip-2024:nth-child(2) { animation-delay: -${parseFloat(CONFIG.animationSpeed) / 2}s; } .rb-promo-text-strip-2024 span { font-size: 16px; font-weight: bold; display: inline-block; padding: 0 40px; } .rb-promo-banner-2024:hover .rb-promo-text-strip-2024 { animation-play-state: paused; } /* الحركة من الشمال لليمين - Animation from left to right */ @keyframes rb-promo-ribbon-scroll-2024 { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } } .rb-promo-banner-2024.rb-sticky-2024 { position: fixed; top: 0; left: 0; width: 100%; z-index: 5; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); } body.rb-sticky-banner-active-2024 { padding-top: ${CONFIG.bannerHeight}; } /* Fade out animation for closing */ .rb-promo-banner-2024.rb-closing-2024 { animation: rb-promo-fadeout-2024 0.3s ease forwards; } @keyframes rb-promo-fadeout-2024 { to { opacity: 0; transform: translateY(-100%); } } @media (max-width: 768px) { .rb-promo-banner-2024 { height: ${CONFIG.bannerHeightMobile}; } .rb-promo-text-strip-2024 span { font-size: 14px; padding: 0 30px; } .rb-promo-close-btn-2024 { width: 26px; height: 26px; font-size: 20px; left: 8px; } .rb-promo-banner-content-2024 { padding: 0 40px 0 40px; } body.rb-sticky-banner-active-2024 { padding-top: ${CONFIG.bannerHeightMobile}; } } @media (max-width: 480px) { .rb-promo-text-strip-2024 span { font-size: 13px; padding: 0 20px; } .rb-promo-close-btn-2024 { width: 24px; height: 24px; font-size: 18px; } } @media (prefers-reduced-motion: reduce) { .rb-promo-text-strip-2024 { animation: none; } .rb-promo-banner-2024.rb-closing-2024 { animation: none; display: none; } } `; // Close banner function function closeBanner() { try { banner.classList.add('rb-closing-2024'); setTimeout(() => { if (banner && banner.parentNode) { banner.remove(); } if (style && style.parentNode) { style.remove(); } document.body.classList.remove('rb-sticky-banner-active-2024'); window.removeEventListener('scroll', onScroll); // Save closed state if (CONFIG.rememberClose) { try { localStorage.setItem(CONFIG.storageKey, 'true'); } catch (e) { console.warn('Could not save banner state:', e); } } }, 300); } catch (error) { console.error('Error closing banner:', error); } } // Insert banner into the page function insertBanner() { try { const header = document.querySelector('header.store-header'); if (header && header.parentNode) { header.parentNode.insertBefore(banner, header); } else { document.body.insertBefore(banner, document.body.firstChild); } // Add styles to head if (!document.getElementById('rb-promo-banner-styles-2024')) { document.head.appendChild(style); } } catch (error) { console.error('Error inserting banner:', error); } } // Sticky functionality with throttling for better performance let isSticky = false; let ticking = false; let stickyOffset = 0; function updateSticky() { try { const promoBar = document.getElementById('rb-promo-banner-2024'); if (!promoBar) return; if (stickyOffset === 0) { stickyOffset = promoBar.offsetTop; } const shouldBeSticky = window.pageYOffset > stickyOffset; if (shouldBeSticky !== isSticky) { isSticky = shouldBeSticky; if (isSticky) { promoBar.classList.add('rb-sticky-2024'); document.body.classList.add('rb-sticky-banner-active-2024'); } else { promoBar.classList.remove('rb-sticky-2024'); document.body.classList.remove('rb-sticky-banner-active-2024'); } } } catch (error) { console.error('Error updating sticky banner:', error); } ticking = false; } function onScroll() { if (!ticking) { window.requestAnimationFrame(updateSticky); ticking = true; } } // Initialize if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', function() { insertBanner(); window.addEventListener('scroll', onScroll, { passive: true }); }); } else { insertBanner(); window.addEventListener('scroll', onScroll, { passive: true }); } // Public API for manual control window.rbPromoBanner = { close: closeBanner, reset: function() { try { localStorage.removeItem(CONFIG.storageKey); console.log('Banner state reset. Refresh page to see banner again.'); } catch (e) { console.warn('Could not reset banner state:', e); } } }; })(); /* ========================================== نهاية كود البانر الإعلاني END OF PROMO BANNER SCRIPT ========================================== */