document.addEventListener("DOMContentLoaded", function() { // مصفوفة فيها كل سيلكتور ونصوصه ورابطه const items = [ { selector: ".dan-video .swiper-slide:nth-child(1) .video-item", title: "عباية رهف", buttonText: "اكتشفي العباية", link: "https://gravityabaya.com/products/rahaf" }, { selector: ".dan-video .swiper-slide:nth-child(2) .video-item", title: "عباية نوف", buttonText: "شاهدي التفاصيل", link: "https://gravityabaya.com/products/nouf" }, { selector: ".dan-video .swiper-slide:nth-child(3) .video-item", title: "عباية نوف", buttonText: "شاهدي التفاصيل", link: "https://gravityabaya.com/products/nouf" } ]; // نضيف المحتوى لكل سيلكتور items.forEach(itemData => { const el = document.querySelector(itemData.selector); if (!el) return; const overlay = document.createElement("div"); overlay.className = "video-overlay-custom"; overlay.innerHTML = `
`; el.style.position = "relative"; el.appendChild(overlay); }); }); document.addEventListener("DOMContentLoaded", function() { const html = ` `; function waitForElement(selector, callback, interval = 200, maxAttempts = 50) { let attempts = 0; const checkExist = setInterval(() => { const el = document.querySelector(selector); if (el) { clearInterval(checkExist); callback(el); } else if (attempts++ > maxAttempts) { clearInterval(checkExist); } }, interval); } waitForElement(".store-footer__contacts-row", (target) => { target.insertAdjacentHTML("beforebegin", html); }); });