/* Add custom Js styles below */ document.addEventListener("DOMContentLoaded", function() { // نفحص إذا الصفحة الرئيسية if (!window.location.pathname || window.location.pathname === "/") return; // أو إذا سلة عندها body class home if (!document.body.classList.contains('home')) return; // نحدد الأب اللي هيتضاف فيه البنر الجديد const container = document.querySelector('.container'); if (!container) return; // نضيف بنر جديد للموبايل const mobileBanner = document.createElement('div'); mobileBanner.id = 'mobile-banner'; mobileBanner.innerHTML = ` Mobile Banner `; container.prepend(mobileBanner); }); document.addEventListener("DOMContentLoaded", function () { const banner = document.querySelector(".s-block--fixed-banner .banner--fixed"); if (!banner) return; banner.style.position = "relative"; banner.style.overflow = "hidden"; banner.style.display = "block"; const btn = document.createElement("a"); btn.textContent = "تسوق الآن"; btn.href = "https://elgenstore.com/"; Object.assign(btn.style, { position: "absolute", left: "50%", top: "50%", transform: "translate(-50%, -50%)", zIndex: "10", background: "rgba(255, 255, 255, 0.20)", color: "#fff", padding: "14px 50px", borderRadius: "60px", fontSize: "22px", fontWeight: "700", textDecoration: "none", backdropFilter: "blur(15px)", WebkitBackdropFilter: "blur(15px)", border: "1px solid rgba(255,255,255,0.4)", boxShadow: "0 6px 22px rgba(0,0,0,0.15)", cursor: "pointer", transition: "0.3s ease", textAlign: "center" }); // Hover btn.addEventListener("mouseover", () => { btn.style.background = "linear-gradient(90deg, #30eed2, #337473, #84cdcb, #80a1ba)"; btn.style.border = "none"; }); btn.addEventListener("mouseout", () => { btn.style.background = "rgba(255,255,255,0.20)"; btn.style.border = "1px solid rgba(255,255,255,0.4)"; }); banner.appendChild(btn); // تعديل responsive على الموبايل function adjustButton() { if (window.innerWidth <= 768) { // شاشة موبايل btn.style.fontSize = "16px"; btn.style.padding = "10px 30px"; btn.style.borderRadius = "40px"; } else { // ديسكتوب btn.style.fontSize = "22px"; btn.style.padding = "14px 50px"; btn.style.borderRadius = "60px"; } } adjustButton(); window.addEventListener("resize", adjustButton); }); // إنشاء الحاوية الخاصة بالتساقط const dropContainer = document.createElement("div"); dropContainer.id = "drop-container"; document.body.appendChild(dropContainer); // عدد القطرات التي يتم إنشاؤها const numberOfDrops = 60; function createDrop() { const drop = document.createElement("div"); drop.classList.add("drop"); // مكان البداية العشوائي drop.style.left = Math.random() * 100 + "vw"; // مدة و تأخير الحركة const duration = Math.random() * 5 + 3; // بين 3 و 8 ثواني const delay = Math.random() * 5; drop.style.animationDuration = `${duration}s`; drop.style.animationDelay = `${delay}s`; // إضافته للحاوية dropContainer.appendChild(drop); // إزالة العنصر بعد انتهاء الأنيميشن setTimeout(() => { drop.remove(); }, (duration + delay) * 1000); } // تكرار الإنشاء setInterval(() => { createDrop(); }, 200);