(function() { var script = document.createElement('script'); script.src = "https://t.contentsquare.net/uxa/534a8a76e886d.js"; script.async = true; document.head.appendChild(script); })(); // AW-17769451736 هو مُعرف التتبع الخاص بك const TRACKING_ID = 'AW-17769451736'; // 1. إنشاء وسم السكربت (Script tag) الخاص بـ gtag.js const script = document.createElement('script'); script.async = true; script.src = `https://www.googletagmanager.com/gtag/js?id=${TRACKING_ID}`; // 2. إنشاء وسم السكربت الثاني لتنفيذ دالة gtag const inlineScript = document.createElement('script'); inlineScript.innerHTML = ` window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', '${TRACKING_ID}'); `; // 3. حقن السكربتين في وسم من الصفحة // هذا يضمن تحميل الكود في المكان الصحيح قبل أي أكواد تتبع أخرى document.head.appendChild(script); document.head.appendChild(inlineScript); /* Add custom Js styles below */ window.addEventListener('load', () => { // استهداف الصورة var targetImg = document.querySelector('.small_advert_banner img'); if (targetImg) { // إضافة كلاسات الثيم الشائعة (جرب واحداً تلو الآخر حسب ثيمك) targetImg.classList.add('hover-effect'); targetImg.classList.add('has-shimmer'); targetImg.style.cursor = 'pointer'; // لتغيير شكل الماوس } document.querySelectorAll('.slide-content').forEach(el => { el.classList.remove('md:text-right'); el.classList.add('md:text-center'); }); }); document.addEventListener('click', function (e) { // نتحقق إذا كان العنصر المنقور هو صورة داخل ستايدر سلة الصغير if (e.target.closest('.small_advert_banner img')) { console.log("تم النقر على صورة البانر"); window.location.href = '/جهاز-قياس-الضغط-أومرون-إيفولف-omron-evolv-ذكي،-لاسلكي،-وياباني/p1117634957'; // الرابط الذي تريده } }); (function() { function createSimplePopup(combinedMessage) { if (document.getElementById("simple-modal")) return; const modal = document.createElement("div"); modal.className = "simple-popup-box"; modal.id = "simple-modal"; // لاحظ هنا استخدمنا innerHTML لكي تظهر الفواصل بين الجمل modal.innerHTML = `
${combinedMessage}
`; document.body.appendChild(modal); document.getElementById("close-popup-btn").onclick = () => modal.remove(); setTimeout(() => modal.classList.add("show"), 100); document.addEventListener("keydown", (e) => { if (e.key === "Escape") modal.remove(); }); } function findAdText() { // نجلب كل العناصر التي تحتوي على نصوص داخل الشريط المتحرك const items = document.querySelectorAll(".marquee-content .ad-bar-item span, .ad-bar-item span"); let allTexts = []; items.forEach(item => { const text = item.textContent.trim(); // شرط: النص أكبر من 5 حروف وغير مكرر في المصفوفة if (text.length > 5 && !allTexts.includes(text)) { allTexts.push(text); } }); // نجمع الجمل ونضع بينها فاصل سطر ورمز نجمة ✨ return allTexts.length > 0 ? allTexts.join("✨
") : null; } function initPopupLogic() { const message = findAdText(); if (message) { setTimeout(() => createSimplePopup(message), 2000); return true; } return false; } if (!initPopupLogic()) { const observer = new MutationObserver((mutations, obs) => { if (initPopupLogic()) { obs.disconnect(); } }); observer.observe(document.body, { childList: true, subtree: true }); } })();