0
document.addEventListener('DOMContentLoaded', () => { /* 1. التعامل مع روابط البانرات والسلايدر */ document.addEventListener('click', function(e) { const img = e.target.closest('a[data-lightbox="Slider"] img'); if (img) { e.preventDefault(); e.stopPropagation(); e.stopImmediatePropagation(); window.location.href = 'https://fasttime-sa.com/-/c1733088530'; return false; } }, true); const banner = document.querySelector('.hero-banner img, .slider img'); if (banner) { banner.style.cursor = 'pointer'; banner.onclick = function() { window.location.href = 'https://fast-ios.com'; }; } /* 2. ترتيب الباقات وتحديد الكلاسات الخاصة بكل باقة */ const grid = document.querySelector(".packages-grid"); if (grid) { const cards = [...grid.querySelectorAll(".package-card")]; const getCard = (name) => cards.find(card => card.querySelector(".header")?.textContent.includes(name) ); [ getCard("الباقة الذهبية"), getCard("الباقة الماسية"), getCard("باقة النخبة"), getCard("باقة ايباد") ].forEach(card => { if (card) grid.appendChild(card); }); } /* 3. تطبيق كلاسات وألوان الباقات دون إتلاف النصوص */ document.querySelectorAll(".package-card").forEach(card => { const header = card.querySelector(".header"); if (!header) return; const text = header.textContent.trim(); if (text.includes("الذهبية")) { card.classList.add("package-gold"); header.style.setProperty("-webkit-text-fill-color", "#FFD700", "important"); header.style.setProperty("color", "#FFD700", "important"); header.style.fontSize = "1.8rem"; } else if (text.includes("الماسية")) { card.classList.add("package-diamond"); header.style.setProperty("-webkit-text-fill-color", "#F5F5F5", "important"); header.style.setProperty("color", "#F5F5F5", "important"); } else if (text.includes("النخبة")) { card.classList.add("package-elite"); header.style.setProperty("-webkit-text-fill-color", "#9D5CFF", "important"); header.style.setProperty("color", "#9D5CFF", "important"); } else if (text.includes("ايباد")) { card.classList.add("package-ipad"); header.style.setProperty("-webkit-text-fill-color", "#2DBDFF", "important"); header.style.setProperty("color", "#2DBDFF", "important"); } }); /* 4. إضاءة وتوهج الباقة الذهبية */ const goldCard = [...document.querySelectorAll(".package-card")] .find(card => card.textContent.includes("الباقة الذهبية")); if (goldCard) { goldCard.style.boxShadow = "0 0 25px rgba(255,215,0,.35), 0 0 60px rgba(255,215,0,.15)"; } /* 5. لمعان الأزرار الأصلي */ document.querySelectorAll(".fill-button__package").forEach(btn => { btn.style.position = "relative"; btn.style.overflow = "hidden"; const shine = document.createElement("span"); shine.style.cssText = ` position:absolute; top:0; left:-120%; width:40%; height:100%; background:rgba(255,255,255,.35); transform:skewX(-25deg); pointer-events:none; `; btn.appendChild(shine); setInterval(() => { shine.animate( [ { left: "-120%" }, { left: "180%" } ], { duration: 1500 } ); }, 3000); }); /* 6. إنشاء الشريط الجانبي للتواصل الاجتماعي (نفس تصميمك القديم) */ if (!document.querySelector('.sticky-container')) { const socialStyle = document.createElement('style'); socialStyle.innerHTML = ` .sticky-container { padding: 1px; margin: 0px; position: fixed; left: -151px; top: 373px; width: 225px; z-index: 1100; } .sticky li { list-style-type: none; background-color: #6a6a6a6b; border-radius: 15px; color: #efefef; height: 43px; padding: 0px; margin: 0px 0px 1px 0px; transition: all 0.25s ease-in-out; cursor: pointer; } .sticky li:hover { margin-left: 115px; } .sticky li img { float: right; margin: 5px; } .sticky li p { padding-top: 5px; margin: 0px; line-height: 16px; font-size: 11px; } .sticky li p a { text-decoration: none; color: #fff; } .sticky li p a:hover { text-decoration: underline; } `; document.head.appendChild(socialStyle); const socialHtml = `
`; document.body.insertAdjacentHTML('beforeend', socialHtml); } });
تصميم وبرمجة