var canonicalLink = document.createElement("link"); canonicalLink.rel = "canonical"; canonicalLink.href = window.location.href; document.head.appendChild(canonicalLink); (function() { document.addEventListener("DOMContentLoaded", function() { let links = document.querySelectorAll("a"); links.forEach(link => { let url = new URL(link.href, window.location.origin); if (!url.pathname.endsWith("/") && !url.pathname.includes(".")) { link.href = url.pathname + "/" + url.search + url.hash; } }); // إعادة توجيه الصفحة الحالية إذا لم يكن بها "/" if (!window.location.pathname.endsWith("/") && !window.location.pathname.includes(".")) { window.history.replaceState(null, "", window.location.pathname + "/" + window.location.search + window.location.hash); } }); })(); let announstyle = document.createElement("style"); announstyle.innerHTML = ` .marquee { width: 100%; overflow: hidden; background-color: #ffffff; border: 1px solid #cccccc; padding: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); position: relative; } .marquee-content { display: flex; animation: marquee 20s linear infinite; } .marquee-content span { margin-right: 50px; white-space: nowrap; } @keyframes marquee { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } } `; document.head.append(announstyle); let announ = document.createElement("div"); announ.classList.add("marquee"); announ.innerHTML = `
ᴥ احصل على خصم 15% بكود S15 ᴥ نشحن لمناطق المملكه والتوصيل لحد باب المنزل
`; document.querySelector("header").before(announ); document.addEventListener("DOMContentLoaded", function () { const marqueeContent = document.querySelector(".marquee-content"); const originalContent = marqueeContent.innerHTML; marqueeContent.innerHTML += originalContent; marqueeContent.addEventListener("animationiteration", function () { marqueeContent.style.transform = "translateX(0)"; }); }); (function() { document.addEventListener("DOMContentLoaded", function() { let links = document.querySelectorAll("a"); links.forEach(link => { let url = new URL(link.href, window.location.origin); if (!url.pathname.endsWith("/") && !url.pathname.includes(".")) { link.href = url.pathname + "/" + url.search + url.hash; } }); // إعادة توجيه الصفحة الحالية إذا لم يكن بها "/" if (!window.location.pathname.endsWith("/") && !window.location.pathname.includes(".")) { window.history.replaceState(null, "", window.location.pathname + "/" + window.location.search + window.location.hash); } }); })();