document.addEventListener("DOMContentLoaded", function() { // إنشاء البنر العريض const pilatesBanner = document.createElement("div"); pilatesBanner.className = "pilates-fullbanner"; pilatesBanner.innerHTML = ` `; // إضافة البنر قبل الفوتر مباشرة const footer = document.querySelector("footer"); if(footer){ footer.insertAdjacentElement("beforebegin", pilatesBanner); } else { document.body.appendChild(pilatesBanner); } // إضافة CSS const style = document.createElement("style"); style.innerHTML = ` .pilates-fullbanner { width: 100%; background: #F6F7F7; padding: 50px 20px; box-sizing: border-box; text-align: center; } .pilates-fullbanner .banner-text h1 { color: #986057; font-size: 2.5em; margin-bottom: 12px; } .pilates-fullbanner .banner-text p { color: #656635; font-size: 1.2em; margin-bottom: 40px; } .pilates-fullbanner .schedule-grid { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; } .pilates-fullbanner .schedule-card { background-color: #ffffff; border: 2px solid #B37368; border-radius: 15px; width: 300px; padding: 15px; box-shadow: 0 4px 10px rgba(0,0,0,0.08); transition: transform 0.3s, box-shadow 0.3s, opacity 0.8s; text-align: left; opacity: 0; transform: translateY(30px); } .pilates-fullbanner .schedule-card.visible { opacity: 1; transform: translateY(0); } .pilates-fullbanner .schedule-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); } .pilates-fullbanner .schedule-card img { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; } .pilates-fullbanner .schedule-card h3 { color: #986057; margin: 10px 0 5px; font-size: 1.1em; } .pilates-fullbanner .schedule-card p { color: #656635; margin: 2px 0; font-size: 0.95em; } .pilates-fullbanner .book-btn { display: inline-block; margin-top: 10px; padding: 10px 15px; background-color: #986057; color: #F6F7F7; text-decoration: none; border-radius: 8px; font-weight: bold; transition: background 0.3s; } .pilates-fullbanner .book-btn:hover { background-color: #B37368; } .pilates-fullbanner .monthly-subscription { margin-top: 50px; display: flex; justify-content: center; align-items: center; gap: 15px; opacity: 0; transform: translateY(30px); transition: all 0.8s; } .pilates-fullbanner .monthly-subscription.visible { opacity: 1; transform: translateY(0); } .pilates-fullbanner .subscribe-image { width: 140px; height: 90px; object-fit: cover; border-radius: 8px; } .pilates-fullbanner .subscribe-text { text-align: left; } .pilates-fullbanner .subscribe-btn { background-color: #986057; color: #fff; padding: 10px 20px; border-radius: 10px; text-decoration: none; font-weight: bold; transition: background 0.3s; } .pilates-fullbanner .subscribe-btn:hover { background-color: #B37368; } .pilates-fullbanner .subscribe-note { margin: 6px 0 0; color: #656635; font-size: 0.95em; } @media (max-width: 768px) { .pilates-fullbanner .schedule-card { width: 100%; margin-bottom: 15px; text-align: center; } .pilates-fullbanner .monthly-subscription { flex-direction: column; gap: 10px; } .pilates-fullbanner .subscribe-text { text-align: center; } } `; document.head.appendChild(style); // تأثير fade-in عند التمرير const observer = new IntersectionObserver(entries => { entries.forEach(entry => { if(entry.isIntersecting) entry.target.classList.add("visible"); }); }, { threshold: 0.2 }); document.querySelectorAll(".animate-on-scroll").forEach(el => observer.observe(el)); observer.observe(document.querySelector(".monthly-subscription")); }); document.addEventListener("DOMContentLoaded", function() { const currencyElements = document.querySelectorAll(".currency, .s-price, .price, .amount"); currencyElements.forEach(el => { el.innerHTML = el.innerHTML.replace(/ر\.س|﷼|SAR/gi, 'SR'); }); }); document.addEventListener("DOMContentLoaded", function () { // رابط صفحة الحجز const bookingURL = "https://aoiastudio.com/cart/booking/800906703"; // الباقات المطلوب تحويلها فقط للحجز const monthlyPackages = [ { id: "p1136432049", path: "/باقة-شهرين-8-جلسات-بيلاتس-ريفورمر/p1136432049" }, { id: "p561216219", path: "/باقة-شهر-4-جلسات-بيلاتس-ريفورمر/p561216219" } ]; // ===================================================== // 1) منع فتح صفحة المنتج – تحويل مباشر للحجز // ===================================================== monthlyPackages.forEach(pkg => { if (window.location.pathname.includes(pkg.id) || window.location.pathname.includes(pkg.path)) { window.location.href = bookingURL; } }); // ===================================================== // 2) تحويل كل الروابط المتعلقة بالباقات → مباشرة للحجز // ===================================================== const allLinks = document.querySelectorAll("a[href]"); allLinks.forEach(link => { monthlyPackages.forEach(pkg => { if (link.href.includes(pkg.id) || link.href.includes(pkg.path)) { link.addEventListener("click", function (e) { e.preventDefault(); window.location.href = bookingURL; }); } }); // يشمل الأزرار المنسوخة مثل "احجزي الآن" if (link.innerText.trim().includes("احجزي الآن")) { link.addEventListener("click", function (e) { e.preventDefault(); window.location.href = bookingURL; }); } }); // ===================================================== // 3) منع أزرار السلة / الدفع / احجزي الآن داخل صفحة الباقات // ===================================================== const blockButtons = () => { const btns = document.querySelectorAll("button, a"); btns.forEach(btn => { const txt = (btn.innerText || "").trim(); const triggerWords = [ "أضف للسلة", "شراء الآن", "الدفع الآن", "احجزي الآن", "احجزي الان", "احجزي" ]; triggerWords.forEach(word => { if (txt.includes(word)) { btn.addEventListener("click", function (e) { const current = window.location.pathname; monthlyPackages.forEach(pkg => { if (current.includes(pkg.id) || current.includes(pkg.path)) { e.preventDefault(); window.location.href = bookingURL; } }); }); } }); }); }; // الموقع يحمّل أزرار جديدة بشكل ديناميكي → نراقب كل نصف ثانية setInterval(blockButtons, 500); // ===================================================== // 4) منع السلة نفسها من فتح صفحة الدفع // ===================================================== let oldPushState = history.pushState; history.pushState = function () { if (arguments[2] && arguments[2].includes("cart")) { window.location.href = bookingURL; return; } return oldPushState.apply(history, arguments); }; });