document.addEventListener("DOMContentLoaded", function () { // لا نكرر السكشن لو مضاف if (document.querySelector(".ce-global-celebs-section")) return; // إخفاء شريط السكروول للأفقى var style = document.createElement("style"); style.textContent = ` .ce-celebs-track { scrollbar-width: none; -ms-overflow-style: none; } .ce-celebs-track::-webkit-scrollbar { display: none; } `; document.head.appendChild(style); // سكشن المشاهير (العنوان + الصور + الفيديوهات) var sectionHTML = `

CELEBRITIES

مشاهير تألقو بمنتجاتنا

`; var wrapper = document.createElement("div"); wrapper.innerHTML = sectionHTML; // تحديد مكان الإدراج var isHome = window.location.pathname === "/" || window.location.pathname === "/ar" || window.location.pathname === "/en"; var insertBeforeNode = null; if (isHome) { // قبل قسم المميزات في الصفحة الرئيسية insertBeforeNode = document.querySelector("section.s-block.s-block--features.angel-features"); } if (!insertBeforeNode) { // باقي الصفحات: قبل الفوتر insertBeforeNode = document.querySelector("footer"); } if (insertBeforeNode && insertBeforeNode.parentNode) { insertBeforeNode.parentNode.insertBefore(wrapper, insertBeforeNode); } else { document.body.appendChild(wrapper); } // إعداد الأوتو سكرول var track = document.querySelector(".ce-global-celebs-section .ce-celebs-track"); if (!track) return; var lastInteractionTime = Date.now(); var pauseDuration = 3000; // 3 ثواني بعد اللمس/السحب var stepSize = 1; // بيكسل لكل فريم function markInteraction() { lastInteractionTime = Date.now(); } ["touchstart", "touchend", "mousedown", "mouseup", "wheel"].forEach(function (evt) { track.addEventListener(evt, markInteraction, { passive: true }); }); function autoScroll() { var now = Date.now(); var maxScroll = track.scrollWidth - track.clientWidth; if (maxScroll > 0 && now - lastInteractionTime > pauseDuration) { if (track.scrollLeft >= maxScroll) { track.scrollLeft = 0; } else { track.scrollLeft += stepSize; } } requestAnimationFrame(autoScroll); } requestAnimationFrame(autoScroll); }); document.addEventListener('DOMContentLoaded', function () { /* ---------------------------------------------------- 1) الضمان الذهبي — لكل المنتجات (مرة وحدة) ---------------------------------------------------- */ var priceWrapper = document.querySelector('.price-wrapper'); if (priceWrapper && !document.querySelector('.product-warranty')) { var warrantyBox = document.createElement('div'); warrantyBox.className = 'product-warranty flex items-center gap-2 mt-3'; warrantyBox.innerHTML = '' + '' + '' + '' + '' + '' + '' + '' + 'ضمان ذهبي' + ''; priceWrapper.insertAdjacentElement('afterend', warrantyBox); } /* ---------------------------------------------------- 2) تخصيص الباقي لمنتج World Cup Sweater فقط ---------------------------------------------------- */ var targetPath = '/ar/world-cup-sweater/p1237897016'; if (!window.location.pathname.includes(targetPath)) return; /* ---------------------------------------------------- 2-A) صندوق التقييم فوق اسم المنتج (الصورة اللي أرسلتيها) ---------------------------------------------------- */ var subtitle = document.querySelector('.product-entry__sub-title'); if (subtitle && !document.querySelector('.product-ratings')) { var ratingsBox = document.createElement('div'); ratingsBox.className = 'product-ratings mb-2 text-sm text-gray-700 da-ts'; ratingsBox.innerHTML = // ⭐ السطر الأول '
' + '' + '' + '' + '' + '4.92' + 'بناءً على 16 تقييم' + '
' + // 👍 السطر الثاني — اليد في اليمين '
' + '' + '' + '' + '100%' + 'من المقيمين ينصحون بهذا المنتج' + '
'; subtitle.parentNode.insertBefore(ratingsBox, subtitle); } /* ---------------------------------------------------- 2-B) صندوق "تم شراء المنتج" ---------------------------------------------------- */ if (priceWrapper && !document.querySelector('.product-purchased')) { var purchasedBox = document.createElement('div'); // كلاس نظيف بدون حدود أو خلفية purchasedBox.className = 'product-purchased mt-2 inline-flex items-center gap-2 text-sm'; // ستايل مباشر لضمان التنفيذ purchasedBox.style.border = 'none'; purchasedBox.style.background = 'transparent'; purchasedBox.style.boxShadow = 'none'; purchasedBox.style.padding = '0'; purchasedBox.style.color = '#dc2626'; // أحمر purchasedBox.innerHTML = '' + 'هذا المنتج تم شراؤه 235 مرة' + ''; priceWrapper.insertAdjacentElement('afterend', purchasedBox); } /* ---------------------------------------------------- 2-C) آراء العملاء تحت "عادة ما يتم شراؤها معًا" ---------------------------------------------------- */ var buyWithSection = document.querySelector(".buy-with.container.mt-4"); if (!buyWithSection || document.querySelector('.customer-reviews')) return; var starSvg = '' + '' + '' + '' + '' + ''; var checkSvg2 = '' + '' + '' + ''; var reviews = [ { text: "براند سعودي يفوووووز من الآخر والجوده روعه", ago: "منذ يوم " }, { text: "جميل والتوصيل كان سريع شكرا لكم", ago: "منذ يوم " }, { text: "وربي أفضل خامة مرت علي والسعر روعه", ago: "منذ يومين " }, { text: "خامة رائعه ومريحة جدا", ago: "منذ ٤ أيام" }, { text: "أفضل براند خامتهم ولا غلطة", ago: "منذ ٦ أيام" }, { text: "مره ممتاز شكرا", ago: "منذ ٨ أيام" }, { text: "رائع", ago: "منذ ٩ أيام" }, { text: "طلبته كهدية وكان اختيار جدًا موفق", ago: "منذ أسبوعين" }, { text: "المقاس مضبوط والتغليف مرتب جدًا", ago: "منذ ٣ أسابيع" }, { text: "من أفضل الهووديز اللي جربتها، فخم", ago: "منذ شهر" }, { text: "قماشه روعه غسيل ولبس", ago: "منذ شهر " }, { text: "جميل جدًا", ago: "منذ شهر " }, { text: "التوصيل سريع وخدمة العملاء محترمة", ago: "منذ شهر" }, { text: "اقسم بالله رووووعه", ago: "منذ شهر" }, { text: "رائعين هذا اول تعامل لي ومو الأخير", ago: "منذ شهر" }, { text: "مستحيل تندمون، جودة فعلًا عالية", ago: "منذ شهر" } ]; var wrap = document.createElement("div"); wrap.className = "customer-reviews mt-6 p-4 rounded-lg bg-white shadow-sm border space-y-4"; var header = '

آراء العملاء

' + '
' + starSvg + 'تقييم 4.92 من 5 بناءً على 16 تقييم' + '
'; var body = ""; reviews.forEach(function (r) { body += '
' + '
' + checkSvg2 + 'عميل موثوق' + '
' + '
' + '
★★★★★
' + '' + r.ago + '' + '
' + '
' + r.text + '
' + '
'; }); wrap.innerHTML = header + body; buyWithSection.insertAdjacentElement("afterend", wrap); }); document.addEventListener('DOMContentLoaded', function () { // صفحة Snowline Hoodie فقط var targetPath = '/ar/snowline-hoodie/p1662176633'; var path = window.location.pathname || ''; if (path.indexOf(targetPath) === -1) return; var priceWrapper = document.querySelector('.price-wrapper'); if (!priceWrapper) return; // عدلي العدد لو حابة var purchasesCount = 185; var purchasedBox = document.createElement('div'); // كلاس نظيف بدون حدود purchasedBox.className = 'product-purchased mt-2 inline-flex items-center gap-2 text-sm'; // ستايل مباشر لضمان التنفيذ purchasedBox.style.border = 'none'; purchasedBox.style.background = 'transparent'; purchasedBox.style.boxShadow = 'none'; purchasedBox.style.padding = '0'; purchasedBox.style.color = '#dc2626'; // أحمر purchasedBox.innerHTML = '' + 'هذا المنتج تم شراؤه ' + purchasesCount + ' مرة' + ''; // بعد السعر مباشرة priceWrapper.insertAdjacentElement('afterend', purchasedBox); }); document.addEventListener('DOMContentLoaded', function () { // نخلي الكود يشتغل فقط على صفحة Snowline Hoodie var targetPath = '/ar/snowline-hoodie/p1662176633'; var path = window.location.pathname || ''; if (path.indexOf(targetPath) === -1) return; // نختار عنوان المنتج نفسه var title = document.querySelector('h1.da-tm.leading-normal.text-lg'); if (!title) return; // إنشاء صندوق التقييم var ratingsBox = document.createElement('div'); ratingsBox.className = 'product-ratings mb-2 text-sm text-gray-700 da-ts'; ratingsBox.style.direction = 'rtl'; ratingsBox.style.textAlign = 'right'; ratingsBox.innerHTML = // السطر الأول: التقييم '
' + '' + '' + '' + '' + '5' + 'بناءً على 10 تقييم' + '
' + // السطر الثاني: نسبة التوصية '
' + '' + '' + '' + '100%' + 'من المقيمين ينصحون بهذا المنتج' + '
'; // نضيفه فوق العنوان مباشرة title.parentNode.insertBefore(ratingsBox, title); }); document.addEventListener("DOMContentLoaded", function () { // خصّص التقييمات لمنتج Snowline Hoodie فقط var targetPath = '/ar/snowline-hoodie/p1662176633'; var path = window.location.pathname || ''; if (path.indexOf(targetPath) === -1) return; // استهداف قسم "عادة ما يتم شراؤها معًا" var buyWithSection = document.querySelector(".buy-with.container.mt-4"); if (!buyWithSection) return; // SVG النجوم (الأيقونة الدائرية الخضراء) var starSvg = '' + '' + '' + '' + '' + ''; // SVG الصح var checkSvg = '' + '' + '' + '' + '' + ''; // آراء خاصة بـ Snowline var reviews = [ { text: "الهودي رهيب رهيب من ناحيه كلشي", ago: "منذ يوم " }, { text: "منتج رائع وخامات جميله", ago: "منذ 2 أيام" }, { text: "١٠ نجوم خامه على جودة على تفصيله رهيبه", ago: "منذ 3 أيام" }, { text: "الخامة دافية بشكل ممتاز ومريحة في اللبس", ago: "منذ 4 أيام" }, { text: "أنصح فيه بقوة", ago: "منذ 6 أيام" }, { text: "جميل مرة", ago: "منذ 9 أيام" }, { text: "لبسته في السفر وكان خيار جدًا مناسب", ago: "منذ أسبوعين" }, { text: " قماشه ناعم من جوا وما يسبب تحسس روعه", ago: "منذ 3 أسابيع" }, { text: "التوصيل سريع شكرا", ago: "منذ 3 أسابيع" }, { text: "شكله أفخم من الصور", ago: "منذ شهر " }, ]; // الكونتينر var wrapper = document.createElement("div"); wrapper.className = "customer-reviews mt-6 p-4 rounded-lg bg-white shadow-sm border space-y-4"; var headerHtml = '

آراء العملاء

' + '
' + starSvg + 'تقييم 5 من 5 بناءً على 10 تقييم' + '
'; var bodyHtml = ""; reviews.forEach(function (r) { bodyHtml += '
' + '
' + checkSvg + 'عميل موثوق' + '
' + '
' + '
★★★★★
' + '' + r.ago + '' + '
' + '
' + r.text + '
' + '
'; }); wrapper.innerHTML = headerHtml + bodyHtml; // تحت "عادة ما يتم شراؤها معًا" buyWithSection.insertAdjacentElement("afterend", wrapper); }); /* ============================ 1) صندوق "هذا المنتج تم شراؤه 200 مرة" بعد السعر ============================ */ document.addEventListener('DOMContentLoaded', function () { var targetPath = '/ar/elegant-hoodie/p1831225849'; var path = window.location.pathname || ''; if (path.indexOf(targetPath) === -1) return; var priceWrapper = document.querySelector('.price-wrapper'); if (!priceWrapper) return; var purchasesCount = 369; // غيري الرقم لو تبين var purchasedBox = document.createElement('div'); // كلاس نظيف بدون حدود purchasedBox.className = 'product-purchased mt-2 inline-flex items-center gap-2 text-sm'; // ستايل مباشر لضمان إزالة أي حدود purchasedBox.style.border = 'none'; purchasedBox.style.background = 'transparent'; purchasedBox.style.boxShadow = 'none'; purchasedBox.style.padding = '0'; purchasedBox.style.color = '#dc2626'; // أحمر purchasedBox.innerHTML = '' + 'هذا المنتج تم شراؤه ' + purchasesCount + ' مرة' + ''; // بعد السعر مباشرة priceWrapper.insertAdjacentElement('afterend', purchasedBox); }); /* ============================ 2) التقييم المختصر فوق اسم المنتج (نجمة + إبهام) ============================ */ document.addEventListener('DOMContentLoaded', function () { var targetPath = '/ar/elegant-hoodie/p1831225849'; var path = window.location.pathname || ''; if (path.indexOf(targetPath) === -1) return; // h1 حق اسم المنتج var title = document.querySelector('h1.da-tm.leading-normal.text-lg'); if (!title) return; var ratingsBox = document.createElement('div'); ratingsBox.className = 'product-ratings mb-2 text-sm text-gray-700 da-ts'; ratingsBox.style.direction = 'rtl'; ratingsBox.style.textAlign = 'right'; ratingsBox.innerHTML = // ⭐ السطر الأول '
' + '' + '' + '' + '' + '5' + 'بناءً على 14 تقييم' + '
' + // 👍 السطر الثاني '
' + '' + '' + '' + '100%' + 'من المقيمين ينصحون بهذا المنتج' + '
'; // نضيفه فوق العنوان مباشرة title.parentNode.insertBefore(ratingsBox, title); }); /* ============================ 3) قسم "آراء العملاء" تحت "عادة ما يتم شراؤها معًا" ============================ */ document.addEventListener("DOMContentLoaded", function () { var targetPath = '/ar/elegant-hoodie/p1831225849'; var path = window.location.pathname || ''; if (path.indexOf(targetPath) === -1) return; var buyWithSection = document.querySelector(".buy-with.container.mt-4"); if (!buyWithSection) return; var starSvg = '' + '' + '' + '' + '' + ''; var checkSvg = '' + '' + '' + '' + '' + ''; var reviews = [ { text: "هوودي أنيق جدًا", ago: "منذ 4 أيام " }, { text: "روووعه جدا", ago: "منذ أسبوعين" }, { text: "حبيت", ago: "منذ أسبوعين" }, { text: "وربي خامه فخمه جدا", ago: "منذ 3 أسابيع" }, { text: "جميييل جدا شكرا لكم", ago: "منذ 3 أسابيع" }, { text: "المقاس مضبوط والخامه تهبل.", ago: "منذ شهر " }, { text: "مررره حلو", ago: "منذ شهر" }, { text: "صراح الشكل والتصميم خرافيه", ago: "منذ شهر" }, { text: "غسلته أكثر من مرة ولونه ثابت جدًا.", ago: "منذ شهر" }, { text: " تجربة حلوة", ago: "منذ شهر" }, { text: "جميل توصيل سريع.", ago: "منذ شهر" }, { text: "ممتاز", ago: "منذ شهر" }, { text: "يستاهل كل ريال", ago: "منذ شهر" } ]; var wrapper = document.createElement("div"); wrapper.className = "customer-reviews mt-6 p-4 rounded-lg bg-white shadow-sm border space-y-4"; var headerHtml = '

آراء العملاء

' + '
' + starSvg + 'تقييم 5 من 5 بناءً على 14 تقييم' + '
'; var bodyHtml = ""; reviews.forEach(function (r) { bodyHtml += '
' + '
' + checkSvg + 'عميل موثوق' + '
' + '
' + '
★★★★★
' + '' + r.ago + '' + '
' + '
' + r.text + '
' + '
'; }); wrapper.innerHTML = headerHtml + bodyHtml; buyWithSection.insertAdjacentElement("afterend", wrapper); }); /* ============================================ 1) صندوق "هذا المنتج تم شراؤه 200 مرة" بعد السعر ============================================ */ document.addEventListener('DOMContentLoaded', function () { var targetPath = '/ar/sketch-vibe-hoodie/p1963480390'; var path = window.location.pathname || ''; if (path.indexOf(targetPath) === -1) return; var priceWrapper = document.querySelector('.price-wrapper'); if (!priceWrapper) return; var purchasesCount = 239; // عدّلي الرقم لو حابة var purchasedBox = document.createElement('div'); // كلاس نظيف بدون حدود purchasedBox.className = 'product-purchased mt-2 inline-flex items-center gap-2 text-sm'; // ستايل مباشر لضمان التنفيذ purchasedBox.style.border = 'none'; purchasedBox.style.background = 'transparent'; purchasedBox.style.boxShadow = 'none'; purchasedBox.style.padding = '0'; purchasedBox.style.color = '#dc2626'; // أحمر purchasedBox.innerHTML = '' + 'هذا المنتج تم شراؤه ' + purchasesCount + ' مرة' + ''; // بعد السعر مباشرة priceWrapper.insertAdjacentElement('afterend', purchasedBox); }); /* ============================================ 2) التقييم المختصر فوق اسم المنتج (نجمة + إبهام) ============================================ */ document.addEventListener('DOMContentLoaded', function () { var targetPath = '/ar/sketch-vibe-hoodie/p1963480390'; var path = window.location.pathname || ''; if (path.indexOf(targetPath) === -1) return; // h1 الخاص باسم المنتج var title = document.querySelector('h1.da-tm.leading-normal.text-lg'); if (!title) return; var ratingsBox = document.createElement('div'); ratingsBox.className = 'product-ratings mb-2 text-sm text-gray-700 da-ts'; ratingsBox.style.direction = 'rtl'; ratingsBox.style.textAlign = 'right'; ratingsBox.innerHTML = // ⭐ السطر الأول '
' + '' + '' + '' + '' + '4.95' + 'بناءً على 10 تقييمات' + '
' + // 👍 السطر الثاني '
' + '' + '' + '' + '100%' + 'من المقيمين ينصحون بهذا المنتج' + '
'; title.parentNode.insertBefore(ratingsBox, title); }); /* ============================================ 3) قسم "آراء العملاء" تحت "عادة ما يتم شراؤها معًا" ============================================ */ document.addEventListener("DOMContentLoaded", function () { var targetPath = '/ar/sketch-vibe-hoodie/p1963480390'; var path = window.location.pathname || ''; if (path.indexOf(targetPath) === -1) return; var buyWithSection = document.querySelector(".buy-with.container.mt-4"); if (!buyWithSection) return; var starSvg = '' + '' + '' + '' + '' + ''; var checkSvg = '' + '' + '' + '' + '' + ''; var reviews = [ { text: "تصميم وخامه روعه.", ago: "منذ 9 أيام" }, { text: "الهودي روعه", ago: "منذ أسبوعي" }, { text: "جميل جدا", ago: "منذ أسبوعين" }, { text: "ستايله مختلف عن الموجود بالسوق حبيته.", ago: "منذ 3 أسابيع" }, { text: "القماش روعه والجودة.", ago: "منذ 3 أسابيع" }, { text: "شكرا روعه", ago: "منذ شهر" }, { text: "الكوالتي تشكرون عليه.", ago: "منذ شهر" }, { text: "جميل", ago: "منذ شهر" }, { text: "روعه", ago: "منذ شهر" }, { text: "صراحه هالبراند يفوز بالجوده", ago: "منذ شهر" }, ]; var wrapper = document.createElement("div"); wrapper.className = "customer-reviews mt-6 p-4 rounded-lg bg-white shadow-sm border space-y-4"; var headerHtml = '

آراء العملاء

' + '
' + starSvg + 'تقييم 4.95 من 5 بناءً على 10 تقييم' + '
'; var bodyHtml = ""; reviews.forEach(function (r) { bodyHtml += '
' + '
' + checkSvg + 'عميل موثوق' + '
' + '
' + '
★★★★★
' + '' + r.ago + '' + '
' + '
' + r.text + '
' + '
'; }); wrapper.innerHTML = headerHtml + bodyHtml; buyWithSection.insertAdjacentElement("afterend", wrapper); }); document.addEventListener('DOMContentLoaded', function () { function addStarsToProductCards() { // نجيب كل كروت المنتجات var cards = document.querySelectorAll('.s-product-card-content'); if (!cards.length) return; cards.forEach(function(card) { // نبحث عن بلوك خيارات المنتج داخل نفس الكرت var optionsWrapper = card.querySelector('.s-product-card-options'); if (!optionsWrapper) return; // لا نكرر إضافة النجوم if (card.querySelector('.product-card-rating')) return; // إنشاء عنصر النجوم var ratingDiv = document.createElement('div'); ratingDiv.className = 'product-card-rating'; // 5 نجوم نصية (مضمونة تشتغل في أي ثيم) ratingDiv.innerHTML = '★★★★★'; // نضيف النجوم قبل خيارات الألوان مباشرة card.insertBefore(ratingDiv, optionsWrapper); }); } // تشغيل الدالة بعد تأخير بسيط عشان سلة تكمّل تحميل الكروت setTimeout(addStarsToProductCards, 1200); }); document.addEventListener('DOMContentLoaded', function () { var priceSection = document.querySelector('section.total.details'); if (priceSection) priceSection.remove(); }); document.addEventListener('DOMContentLoaded', function () { // نخلي الكود يشتغل فقط على منتج World cup Sweater var targetPath = '/ar/world-cup-sweater/p1237897016'; var path = window.location.pathname || ''; if (path.indexOf(targetPath) === -1) return; // h1 الخاص باسم المنتج var title = document.querySelector('h1.da-tm.leading-normal.text-lg'); if (!title) return; var ratingsBox = document.createElement('div'); ratingsBox.className = 'product-ratings mb-2 text-sm text-gray-700 da-ts'; ratingsBox.style.direction = 'rtl'; ratingsBox.style.textAlign = 'right'; ratingsBox.innerHTML = // ⭐ السطر الأول '
' + '' + '' + '' + '' + '4.92' + 'بناءً على 13 تقييمات' + '
' + // 👍 السطر الثاني '
' + '' + '' + '' + '100%' + 'من المقيمين ينصحون بهذا المنتج' + '
'; title.parentNode.insertBefore(ratingsBox, title); });