document.addEventListener("DOMContentLoaded", function () { if (document.querySelector(".cw-custom-footer")) return; const oldFooter = document.querySelector("footer") || document.querySelector(".s-footer") || document.querySelector(".store-footer") || document.querySelector(".footer"); if (!oldFooter) return; /* ضع رابط شعار عالم الكوفي البني هنا. إذا ما عندك رابط حاليًا، خله فارغ مؤقتًا وسيظهر النص بدل الشعار. */ const logoSrc = ""; const paymentImages = Array.from(oldFooter.querySelectorAll("img")).filter(function (img) { const src = (img.src || "").toLowerCase(); const alt = (img.alt || "").toLowerCase(); return ( src.includes("mada") || src.includes("visa") || src.includes("master") || src.includes("apple") || src.includes("stc") || src.includes("tabby") || src.includes("tamara") || src.includes("mispay") || src.includes("mis") || src.includes("bank") || alt.includes("mada") || alt.includes("visa") || alt.includes("master") || alt.includes("apple") || alt.includes("stc") || alt.includes("tabby") || alt.includes("tamara") || alt.includes("bank") ); }); const paymentHtml = paymentImages.length ? paymentImages .map(function (img) { return `${img.alt || `; }) .join("") : ` mada VISA Mastercard Apple Pay STC Pay Tabby MIS `; const footerHtml = ` `; oldFooter.insertAdjacentHTML("beforebegin", footerHtml); oldFooter.classList.add("cw-hide-original-footer"); oldFooter.style.setProperty("display", "none", "important"); oldFooter.style.setProperty("visibility", "hidden", "important"); oldFooter.style.setProperty("height", "0", "important"); oldFooter.style.setProperty("overflow", "hidden", "important"); });/* ===================================================== Coffee World - Replace 3 Contact Icons Only تغيير أيقونات الواتساب / السجل / الضريبة فقط ===================================================== */ document.addEventListener("DOMContentLoaded", function () { const icons = { whatsapp: "https://img.magnific.com/premium-vector/vector-whatsapp-social-media-logo_1093524-447.jpg?semt=ais_hybrid&w=740&q=80", cr: "https://vid.alarabiya.net/images/2021/02/08/d13a4654-e875-4c83-9edd-7f87424054cc/d13a4654-e875-4c83-9edd-7f87424054cc_16x9_1200x676.jpg", vat: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSVLE_AqADVuwkQxdwVNhWblvbazsjpYhTpGw&s" }; function replaceContactIcon(labelText, imageUrl, extraClass, altText) { const items = document.querySelectorAll(".cw-contact-strip div"); items.forEach(function (item) { if (item.textContent.includes(labelText)) { const icon = item.querySelector(".cw-contact-icon"); if (icon) { icon.classList.add(extraClass); icon.innerHTML = `${altText}`; } } }); } replaceContactIcon("واتساب", icons.whatsapp, "cw-custom-whatsapp-icon", "واتساب"); replaceContactIcon("السجل التجاري", icons.cr, "cw-custom-cr-icon", "السجل التجاري"); replaceContactIcon("الرقم الضريبي", icons.vat, "cw-custom-vat-icon", "الرقم الضريبي"); });/* Coffee World - Replace CR Icon Only */ document.addEventListener("DOMContentLoaded", function () { const newCrIcon = "https://pbs.twimg.com/media/HGHWXoEXoAAq-ne.jpg"; const items = document.querySelectorAll(".cw-contact-strip div"); items.forEach(function (item) { if (item.textContent.includes("السجل التجاري")) { const icon = item.querySelector(".cw-contact-icon"); if (icon) { icon.classList.add("cw-custom-cr-icon"); icon.innerHTML = `السجل التجاري`; } } }); });/* Coffee World - Add Business Platform Logo After Trust Text */ document.addEventListener("DOMContentLoaded", function () { const trustLogoUrl = "https://upload.wikimedia.org/wikipedia/ar/thumb/3/3c/%D8%A7%D9%84%D9%85%D8%B1%D9%83%D8%B2_%D8%A7%D9%84%D8%B3%D8%B9%D9%88%D8%AF%D9%8A_%D9%84%D9%84%D8%A3%D8%B9%D9%85%D8%A7%D9%84.svg/3840px-%D8%A7%D9%84%D9%85%D8%B1%D9%83%D8%B2_%D8%A7%D9%84%D8%B3%D8%B9%D9%88%D8%AF%D9%8A_%D9%84%D9%84%D8%A3%D8%B9%D9%85%D8%A7%D9%84.svg.png"; const trustBox = document.querySelector(".cw-trust"); if (trustBox && !trustBox.querySelector(".cw-trust-logo")) { const img = document.createElement("img"); img.src = trustLogoUrl; img.alt = "منصة الأعمال"; img.className = "cw-trust-logo"; img.loading = "lazy"; trustBox.appendChild(img); } });const meta = document.createElement('meta'); meta.name = 'domain-verification'; meta.content = 'f27e24b18b7639022d5277e1a7301cd3f525fa95b735eef1892ee68e05e001b9'; document.head.appendChild(meta);/* Coffee World - Replace Phone & Email Icons Only */ document.addEventListener("DOMContentLoaded", function () { const phoneIconUrl = "https://marketplace.canva.com/TyPi8/MAFPBsTyPi8/1/tl/canva-business-card-contact-information-icons.-call-icon.-contact-us-MAFPBsTyPi8.png"; const emailIconUrl = "https://upload.wikimedia.org/wikipedia/commons/4/4e/Gmail_Icon.png"; function replaceContactIcon(labelText, imageUrl, extraClass, altText) { const items = document.querySelectorAll(".cw-contact-strip div"); items.forEach(function (item) { if (item.textContent.includes(labelText)) { const icon = item.querySelector(".cw-contact-icon"); if (icon) { icon.classList.add(extraClass); icon.innerHTML = `${altText}`; } } }); } replaceContactIcon("اتصل بنا", phoneIconUrl, "cw-custom-phone-icon", "اتصل بنا"); replaceContactIcon("البريد الإلكتروني", emailIconUrl, "cw-custom-email-icon", "البريد الإلكتروني"); });/* Coffee World - Fix Social Media Footer Links */ document.addEventListener("DOMContentLoaded", function () { const socialLinks = [ { label: "Instagram", url: "https://www.instagram.com/kufiworld2021" }, { label: "TikTok", url: "https://www.tiktok.com/@kufiworld2021" }, { label: "Snapchat", url: "https://www.snapchat.com/add/kufiworld2021" }, { label: "YouTube", url: "https://www.youtube.com/" }, { label: "X", url: "https://x.com/" } ]; const buttons = document.querySelectorAll(".cw-social-icons a, .cw-social a"); buttons.forEach(function (button, index) { if (socialLinks[index]) { button.href = socialLinks[index].url; button.target = "_blank"; button.rel = "noopener noreferrer"; button.setAttribute("aria-label", socialLinks[index].label); } }); });/* Coffee World - Fix Social Media Links By Icon Label */ document.addEventListener("DOMContentLoaded", function () { const links = { instagram: "https://www.instagram.com/kufiworld2021/", tiktok: "https://www.tiktok.com/@kufiworld2021", snapchat: "https://www.snapchat.com/add/kufiworld2021", youtube: "https://www.youtube.com/", x: "https://x.com/" }; document.querySelectorAll(".cw-social-icons a, .cw-social a").forEach(function (btn) { const label = (btn.getAttribute("aria-label") || "").toLowerCase(); if (label.includes("instagram")) { btn.href = links.instagram; } if (label.includes("tiktok")) { btn.href = links.tiktok; } if (label.includes("snapchat")) { btn.href = links.snapchat; } if (label.includes("youtube")) { btn.href = links.youtube; } if (label === "x" || label.includes("twitter")) { btn.href = links.x; } btn.target = "_blank"; btn.rel = "noopener noreferrer"; }); });/* Coffee World - Final Social Media Links Fix */ document.addEventListener("DOMContentLoaded", function () { setTimeout(function () { const links = { instagram: "https://www.instagram.com/coffeeworld2021/", tiktok: "https://www.tiktok.com/@coffeeworld2021", snapchat: "https://www.snapchat.com/add/coffeeworld2021", x: "https://x.com/coffeeworld2021", youtube: "https://www.youtube.com/channel/UCZcZ10k" }; document.querySelectorAll(".cw-social-icons a, .cw-social a").forEach(function (btn) { const label = (btn.getAttribute("aria-label") || "").toLowerCase(); if (label.includes("instagram")) { btn.href = links.instagram; } if (label.includes("tiktok")) { btn.href = links.tiktok; } if (label.includes("snapchat")) { btn.href = links.snapchat; } if (label.includes("youtube")) { btn.href = links.youtube; } if (label === "x" || label.includes("twitter")) { btn.href = links.x; } btn.target = "_blank"; btn.rel = "noopener noreferrer"; }); }, 600); });/* Coffee World - Update About Footer Text */ document.addEventListener("DOMContentLoaded", function () { setTimeout(function () { const aboutCol = document.querySelector(".cw-about"); if (!aboutCol) return; const title = aboutCol.querySelector("h3"); const desc = aboutCol.querySelector("p"); if (title) { title.innerHTML = ` أناقة تبدأ من ركن القهوة `; } if (desc) { desc.innerHTML = ` في عالم الكوفي، نصمّم أركان قهوة تضيف لمنزلك أناقة هادئة وتنظيمًا يليق بذوقك، لتكتمل تفاصيل الضيافة اليومية بلمسة فاخرة تعكس شخصيتك.
أناقة تبدأ من ركن القهوة `; } }, 600); });/* Coffee World - Make Contact Cards Clickable */ document.addEventListener("DOMContentLoaded", function () { setTimeout(function () { const actions = [ { label: "البريد الإلكتروني", url: "mailto:kufiworld2021@gmail.com" }, { label: "اتصل بنا", url: "tel:+966555828377" }, { label: "واتساب", url: "https://wa.me/966555828377" } ]; const items = document.querySelectorAll(".cw-contact-strip div"); items.forEach(function (item) { actions.forEach(function (action) { if (item.textContent.includes(action.label)) { item.setAttribute("data-link", action.url); item.style.cursor = "pointer"; item.addEventListener("click", function () { if (action.url.startsWith("mailto:") || action.url.startsWith("tel:")) { window.location.href = action.url; } else { window.open(action.url, "_blank", "noopener,noreferrer"); } }); } }); }); }, 700); });/* Coffee World - Replace Footer Logo With Real Logo */ document.addEventListener("DOMContentLoaded", function () { setTimeout(function () { const newLogoUrl = "https://img.sanishtech.com/u/48eeccfc598a89eb40f13d376fde97a1.jpg"; const brandBox = document.querySelector(".cw-footer-brand"); if (!brandBox) return; brandBox.classList.add("cw-footer-real-logo"); const oldFallback = brandBox.querySelector(".cw-logo-fallback"); if (oldFallback) { oldFallback.remove(); } let logoImg = brandBox.querySelector("img"); if (!logoImg) { logoImg = document.createElement("img"); logoImg.alt = "Coffee World"; brandBox.prepend(logoImg); } logoImg.src = newLogoUrl; }, 700); });/* Coffee World - Replace Footer Logo Only */ document.addEventListener("DOMContentLoaded", function () { setTimeout(function () { const newLogoUrl = "https://img.sanishtech.com/u/7e04456a535c075eef66f73519cfaba1.png"; const brandBox = document.querySelector(".cw-footer-brand"); if (!brandBox) return; brandBox.classList.add("cw-footer-real-logo"); const oldFallback = brandBox.querySelector(".cw-logo-fallback"); if (oldFallback) { oldFallback.remove(); } let logoImg = brandBox.querySelector("img"); if (!logoImg) { logoImg = document.createElement("img"); logoImg.alt = "Coffee World"; brandBox.prepend(logoImg); } logoImg.src = newLogoUrl; }, 700); });/* Coffee World - Replace Footer Logo With New Logo */ document.addEventListener("DOMContentLoaded", function () { setTimeout(function () { const newLogoUrl = "https://img.sanishtech.com/u/fe645fcdd1e8d6ea977c29a01c31d56b.png"; const brandBox = document.querySelector(".cw-footer-brand"); if (!brandBox) return; brandBox.classList.add("cw-footer-real-logo"); const oldFallback = brandBox.querySelector(".cw-logo-fallback"); if (oldFallback) { oldFallback.remove(); } let logoImg = brandBox.querySelector("img"); if (!logoImg) { logoImg = document.createElement("img"); logoImg.alt = "Coffee World"; brandBox.prepend(logoImg); } logoImg.src = newLogoUrl; }, 700); });