/* START OF JS CODE BY NUSSUQ.COM */
document.addEventListener("DOMContentLoaded", () => {
const updateIcons = () => {
let updated = false;
document.querySelectorAll("#save-money").forEach(e => {
if (e.innerHTML.includes("<i class=sicon-sar></i>")) {
e.innerHTML = e.innerHTML.replace(
/<i class=sicon-sar><\/i>/g,
''
);
updated = true;
}
});
if (updated) anime({ targets: ".product-save", opacity: [0, 1], translateY: [20, 0], duration: 800, easing: "easeOutQuad" });
return updated;
};
document.querySelectorAll(".product-save").forEach(e => e.style.opacity = "0");
if (!updateIcons()) setInterval(() => updateIcons() && clearInterval(this), 2000);
});
const discordIcon = document.querySelector('.contact-links>a:last-child',);
if (discordIcon) {
const addDiscord = `
دسكورد `;
discordIcon.insertAdjacentHTML('afterend', addDiscord);
}
document.addEventListener("DOMContentLoaded", function() {
function applyColorToSpecificH2() {
const h2Elements = document.querySelectorAll('h2');
h2Elements.forEach(function(element) {
if (element.textContent.trim() === 'قد يعجبك أيضًا') {
element.style.color = '#dab604';
}
});
}
applyColorToSpecificH2();
document.body.addEventListener('click', function() {
applyColorToSpecificH2();
});
const observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.type === 'childList') {
applyColorToSpecificH2();
}
});
});
const config = { childList: true, subtree: true };
observer.observe(document.body, config);
});
document.addEventListener("DOMContentLoaded", function () {
const thankYouElement = document.querySelector(".thank-you h1, .thank-you p.thanks-item");
if (thankYouElement && thankYouElement.textContent.includes("شكرا لتسوّقكم عبر متجرنا")) {
thankYouElement.textContent = "شكرا لثقتك في بطاقة ستور ☺️";
}
});