// البانر العلوي setTimeout(function() { const bannerHTML = ` `; const ad = document.querySelector("salla-advertisement"); const header = document.querySelector(".store-header"); const target = ad || header; if (target) { target.insertAdjacentHTML("beforebegin", bannerHTML); console.log("Banner added successfully!"); } else { console.log("Target element not found"); } }, 500); // البوب اب (function() { 'use strict'; function isIndexPage() { return document.body.classList.contains('index'); } function injectStyles() { const style = document.createElement('style'); style.textContent = ` .nakheel-popup-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.2); display: none; justify-content: center; align-items: center; z-index: 10000; backdrop-filter: blur(5px); animation: nakheelFadeIn 0.3s ease-out; direction: rtl; } .nakheel-popup-overlay.show { display: flex !important; } .nakheel-popup-content { background: linear-gradient(135deg, #00333b, #00894a 100%); border-radius: 20px; padding: 40px 35px; max-width: 500px; width: 90%; text-align: center; position: relative; color: white; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); transform: scale(0.7); animation: nakheelPopupIn 0.4s ease-out forwards; } .nakheel-popup-content::before { content: ''; position: absolute; top: -2px; left: -2px; right: -2px; bottom: -2px; background: rgba(0, 0, 0, 0.2); border-radius: 22px; z-index: -1; opacity: 0.7; animation: nakheelBorderGlow 3s ease-in-out infinite alternate; } .nakheel-close-btn { position: absolute; top: 15px; right: 15px; background: rgba(255, 255, 255, 0.2); border: none; border-radius: 50%; width: 40px; height: 40px; color: white; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; backdrop-filter: blur(10px); } .nakheel-close-btn:hover { background: rgba(255, 255, 255, 0.3); transform: rotate(90deg); } .nakheel-popup-h2 { font-size: 2rem; margin-bottom: 15px; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); line-height: 1.2; margin-top: 0; } .nakheel-popup-h3 { font-size: 1.2rem; margin-bottom: 30px; opacity: 0.95; font-weight: 300; line-height: 1.4; margin-top: 0; } .nakheel-cta-button { background: linear-gradient(45deg, #00894a, #00333b); color: white; border: none; padding: 15px 35px; border-radius: 50px; font-size: 1.1rem; font-weight: bold; cursor: pointer; transition: all 0.3s ease; text-decoration: none; display: inline-block; box-shadow: 0 8px 25px rgba(0, 139, 74, 0.4); position: relative; overflow: hidden; } .nakheel-cta-button::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); transition: all 0.5s; } .nakheel-cta-button:hover::before { left: 100%; } .nakheel-cta-button:hover { transform: translateY(-3px); box-shadow: 0 12px 35px rgba(0, 139, 74, 0.6); } @keyframes nakheelFadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes nakheelPopupIn { from { transform: scale(0.7) rotate(-5deg); opacity: 0; } to { transform: scale(1) rotate(0deg); opacity: 1; } } @keyframes nakheelBorderGlow { from { opacity: 0.7; } to { opacity: 0.9; } } @media (max-width: 480px) { .nakheel-popup-content { padding: 30px 25px; margin: 20px; } .nakheel-popup-h2 { font-size: 1.6rem; } .nakheel-popup-h3 { font-size: 1rem; } .nakheel-cta-button { padding: 12px 25px; font-size: 1rem; } } `; document.head.appendChild(style); } function createPopup() { const overlay = document.createElement('div'); overlay.className = 'nakheel-popup-overlay'; overlay.id = 'nakheelPopupOverlay'; const content = document.createElement('div'); content.className = 'nakheel-popup-content'; const closeBtn = document.createElement('button'); closeBtn.className = 'nakheel-close-btn'; closeBtn.innerHTML = '×'; closeBtn.onclick = closePopup; const h2 = document.createElement('h2'); h2.className = 'nakheel-popup-h2'; h2.textContent = '🎉 احتفل باليوم الوطني مع عروض قلعه النخيل الخاصة! ✨'; const h3 = document.createElement('h3'); h3.className = 'nakheel-popup-h3'; h3.textContent = 'اختر البكدج المثالية واصنع تجربتك الاستثنائية.'; const ctaButton = document.createElement('a'); ctaButton.className = 'nakheel-cta-button'; ctaButton.href = 'https://nakheelcastle.com/%D8%A8%D8%A7%D9%83%D8%AF%D8%AC%D8%A7%D8%AA-%D8%A7%D9%84%D9%8A%D9%88%D9%85-%D8%A7%D9%84%D9%88%D8%B7%D9%86%D9%8A/c1860630292'; ctaButton.target = '_blank'; ctaButton.textContent = 'اكتشف الباقات الآن'; content.appendChild(closeBtn); content.appendChild(h2); content.appendChild(h3); content.appendChild(ctaButton); overlay.appendChild(content); document.body.appendChild(overlay); return overlay; } function showPopup() { const overlay = document.getElementById('nakheelPopupOverlay') || createPopup(); overlay.classList.add('show'); document.body.style.overflow = 'hidden'; } function closePopup() { const overlay = document.getElementById('nakheelPopupOverlay'); if (overlay) { overlay.classList.remove('show'); document.body.style.overflow = 'auto'; } } function shouldShowPopup() { try { const lastShown = localStorage.getItem('nakheelPopupLastShown'); const now = new Date().getTime(); const oneDay = 24 * 60 * 60 * 1000; return !lastShown || (now - parseInt(lastShown)) > oneDay; } catch (e) { return true; } } function markPopupShown() { try { localStorage.setItem('nakheelPopupLastShown', new Date().getTime().toString()); } catch (e) { // Ignore } } function initPopup() { if (!isIndexPage()) { return; } injectStyles(); const overlay = createPopup(); overlay.addEventListener('click', function(e) { if (e.target === this) { closePopup(); } }); document.addEventListener('keydown', function(e) { if (e.key === 'Escape') { closePopup(); } }); setTimeout(function() { showPopup(); }, 1000); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initPopup); } else { initPopup(); } window.nakheelPopup = { show: showPopup, close: closePopup }; })(); // كود الفوتر window.onload = function () { try { (function() { const TRY_MS = 6000; const POLL_EVERY = 200; const deadline = Date.now() + TRY_MS; function findTarget() { const h3 = Array.from(document.querySelectorAll('footer h3')) .find(function(el) { return el.textContent && el.textContent.trim().includes('روابط مهمة'); }); if (h3) return h3.closest('div'); const menu = document.querySelector('footer salla-menu[source="footer"]'); if (menu) return menu.closest('div'); return null; } function moveSocialIntoTarget() { const social = document.querySelector('footer salla-social'); const target = findTarget(); if (social && target) { const menu = target.querySelector('salla-menu[source="footer"]'); if (menu && !(menu.nextElementSibling && menu.nextElementSibling.matches('salla-social'))) { menu.after(social); } else if (!target.contains(social)) { target.appendChild(social); } social.classList.remove('hidden'); return true; } return false; } if (moveSocialIntoTarget()) return; const poll = setInterval(function() { if (Date.now() > deadline || moveSocialIntoTarget()) clearInterval(poll); }, POLL_EVERY); const footer = document.querySelector('footer'); if (footer) { const observer = new MutationObserver(function() { if (moveSocialIntoTarget()) observer.disconnect(); }); observer.observe(footer, { childList: true, subtree: true }); } })(); } catch (err) { console.error("حدث خطأ أثناء تنفيذ الكود:", err); } }; // كود الثيم والعروض (function () { var App = { ready: function (cb) { if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", cb, { once: true }); } else cb(); } }; var Utils = (function () { function uid() { if (crypto && crypto.getRandomValues) { var n = new Uint32Array(1); crypto.getRandomValues(n); return n[0].toString(36); } return Date.now().toString(36); } function hsl(h) { return "hsl(" + h + ",90%,50%)"; } function cssVars(c) { var css = ":root{--brand-accent:" + c + "}"; css += "[data-inline-accent]{accent-color:var(--brand-accent)}"; return css; } return { uid: uid, hsl: hsl, cssVars: cssVars }; })(); var Theme = (function () { var hues = [18, 196, 226, 274, 318]; var pick = hues[(Math.random() * hues.length) | 0]; var node = document.createElement("style"); node.setAttribute("data-theme-id", Utils.uid()); node.textContent = Utils.cssVars(Utils.hsl(pick)); return { node: node }; })(); var Store = (function () { var profile = { name: "قلعة النخيل", locale: "ar-SA", currency: "SAR", tz: "Asia/Riyadh" }; var promos = [ { id: "nd-95-1", title: "خصم 23% لليوم الوطني", code: "ND23", endsAt: "2025-09-24T00:00:00+03:00" }, { id: "nd-95-2", title: "شحن مجاني فوق 199 ريال", code: "SHIP23", endsAt: "2025-09-24T00:00:00+03:00" } ]; function activePromos(nowISO) { var now = new Date(nowISO || Date.now()).getTime(); return promos.filter(function (p) { return new Date(p.endsAt).getTime() > now; }); } return { profile: profile, activePromos: activePromos }; })(); App.ready(function () { try { var promos = Store.activePromos(); if (promos.length) { var holder = document.querySelector("[data-promo-holder]") || document.createElement("div"); holder.setAttribute("data-promo-holder", "true"); holder.style.display = "none"; holder.dataset.store = Store.profile.name; promos.forEach(function (p) { var badge = document.createElement("i"); badge.setAttribute("data-promo-id", p.id); badge.title = p.title + " • " + p.code; holder.appendChild(badge); }); document.body.appendChild(holder); } } catch (err) { var tag = document.createElement("meta"); tag.name = "qalat-annex"; tag.content = (err && (err.name || "Error")) + ":" + Utils.uid(); document.head.appendChild(tag); } }); })();