// كودين التمرير والفقاعات والعناوين const internalLinks = document.querySelectorAll('a[href^="#"]'); internalLinks.forEach((link) => { link.addEventListener("click", function (e) { const targetSelector = this.getAttribute("href"); const target = document.querySelector(targetSelector); if (target) { e.preventDefault(); target.scrollIntoView({ behavior: "smooth" }); } }); }); const titles = document.querySelectorAll(".s-block__title h2, .s-slider-block__title h2"); titles.forEach((title) => { title.addEventListener("mouseenter", () => { title.style.transform = "scale(1.05)"; }); title.addEventListener("mouseleave", () => { title.style.transform = "scale(1)"; }); }); //-------------------------------------------------- //window.addEventListener("load", function () { // setTimeout(() => { // alert("🎉 مرحبًا بك في متجرنا! لا تفوّت العروض الخاصة اليوم //🌟"); // }, 1500); //}); //-------------------------------------------------- window.addEventListener("load", () => { // ⏳ عدد الساعات بين كل ظهور const HOURS_INTERVAL = 5; // تحويل الساعات إلى ثواني const SECONDS_INTERVAL = HOURS_INTERVAL * 60 * 60; // 🔹 وقت آخر ظهور محفوظ const lastShownTime = localStorage.getItem("fishTipLastShown"); if (lastShownTime) { const secondsPassed = (Date.now() - parseInt(lastShownTime)) / 1000; // تحويل إلى ثواني if (secondsPassed < SECONDS_INTERVAL) { return; // ⛔ لم يمر الوقت المحدد بعد } } // 🐟 قائمة معلومات الأسماك const fishTips = [ { title: "💡 معلومة بحرية", text: "سمك الهامور غني بالبروتين ويساعد على صحة القلب. جربه الآن طازجًا من فيشكا!", link: "https://fishka-sa.com/fish/c1382205726?filters[category_id]=1382205726" }, { title: "💡 معلومة بحرية", text: "سمك السلمون يحتوي على أوميغا 3 المفيد للمخ وصحة العيون.", link: "https://fishka-sa.com/fish/c1382205730?filters[category_id]=1382205730" }, { title: "💡 معلومة بحرية", text: "سمك الشعري لذيذ ومثالي للشوي ويتميز بنكهة طبيعية رائعة.", link: "https://fishka-sa.com/fish/c1382205735?filters[category_id]=1382205735" }, { title: "💡 معلومة بحرية", text: "سمك التونة مصدر ممتاز للبروتين والطاقة، ويعزز نشاطك اليومي.", link: "https://fishka-sa.com/fish/c1382205740?filters[category_id]=1382205740" }, { title: "💡 معلومة بحرية", text: "الروبيان غني بالمعادن ويعزز صحة البشرة والشعر.", link: "https://fishka-sa.com/fish/c1382205745?filters[category_id]=1382205745" }, { title: "💡 معلومة بحرية", text: "سمك الكنعد يحتوي على دهون صحية مفيدة للقلب والمناعة.", link: "https://fishka-sa.com/fish/c1382205750?filters[category_id]=1382205750" } ]; setTimeout(() => { // 🎯 اختيار معلومة عشوائية const randomTip = fishTips[Math.floor(Math.random() * fishTips.length)]; // ✅ إنشاء نافذة البوب أب const tipPopup = document.createElement("div"); tipPopup.id = "fishTip"; tipPopup.innerHTML = `
${randomTip.text}
تسوق الآن × `; document.body.appendChild(tipPopup); // 📝 حفظ وقت الظهور الجديد localStorage.setItem("fishTipLastShown", Date.now().toString()); // ✅ إغلاق عند الضغط على X tipPopup.querySelector(".close-tip").addEventListener("click", () => { tipPopup.remove(); }); // ⏳ اختفاء تلقائي بعد 30 ثانية setTimeout(() => { tipPopup.remove(); }, 30000); }, 30000); // يظهر بعد 30 ثانية من تحميل الصفحة }); //------------------------------------------------ //----------------- // إشعار ترحيبي window.addEventListener("load", () => { // تحقق إن المستخدم في الصفحة الرئيسية فقط if (location.pathname === "/" || location.pathname === "/index.html") { // تحقق إذا تم عرض البوب أب من قبل if (!localStorage.getItem("welcomeShown")) { // إنشاء البوب أب let popup = document.createElement("div"); popup.id = "welcomePopup"; popup.innerHTML = "اكتشف أفضل الأسماك الطازجة لدينا.
"; document.body.appendChild(popup); // إزالة البوب أب بعد 4 ثواني setTimeout(() => popup.remove(), 4000); // حفظ الحالة في LocalStorage حتى لا يظهر مرة أخرى localStorage.setItem("welcomeShown", "true"); } } }); //------------------------------------------- //----حركة الفقاعات ماوس موف---------- //------------------------------------------- document.addEventListener("mousemove", (e) => { let bubble = document.createElement("span"); bubble.className = "mouseBubble"; bubble.style.left = e.pageX + "px"; bubble.style.top = e.pageY + "px"; document.body.appendChild(bubble); setTimeout(() => bubble.remove(), 800); }); //------------------------------------------- //----حركة الضغط ماوس موف---------- //------------------------------------------- document.addEventListener("click", (e) => { let drop = document.createElement("span"); drop.className = "waterDrop"; drop.style.left = e.pageX + "px"; drop.style.top = e.pageY + "px"; document.body.appendChild(drop); setTimeout(() => drop.remove(), 600); }); //------------------------------------------------ //--------كود زر تأثيرات الواتساب-------- //------------------------------------------------ document.addEventListener("DOMContentLoaded", () => { const waBtn = document.getElementById("wa-angel"); if (waBtn) { waBtn.style.display = "none"; // إخفاء مؤقت setTimeout(() => { waBtn.style.display = "block"; }, 5000); // يظهر بعد 5 ثواني } }); document.addEventListener("DOMContentLoaded", () => { const waBtn = document.getElementById("wa-angel"); if (waBtn) { setInterval(() => { waBtn.classList.add("pulse"); setTimeout(() => waBtn.classList.remove("pulse"), 1000); }, 6000); // كل 6 ثواني يعمل نبضة } }); document.addEventListener("DOMContentLoaded", () => { const waBtn = document.getElementById("wa-angel"); setInterval(() => { waBtn.style.boxShadow = "0 0 20px rgba(37, 211, 102, 0.8)"; setTimeout(() => { waBtn.style.boxShadow = "none"; }, 500); }, 6000); // كل 8 ثواني }); //---------------------بطاقة المنتج القلب--------------------------- //--------------------------السلة في اضافة // ==================== CSS ==================== // ==================== CSS ==================== // ==================== CSS ==================== // ==================== CSS ==================== // ==================== CSS ==================== // ========== CSS ========== // ========== CSS داخلي ========== const style = document.createElement("style"); style.innerHTML = ` #welcomePopup { position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.25); display: none; justify-content: center; align-items: center; z-index: 9999; backdrop-filter: blur(2px); } #welcomePopup .popup-box { background: linear-gradient(135deg, #0F9D58, #18A857); color:#fff; padding:25px 25px; border-radius:20px; max-width:400px; width:85%; text-align:center; font-family:"Tajawal",sans-serif; box-shadow:0 5px 20px rgba(0,0,0,0.1); animation: popupFade 0.6s ease; } #welcomePopup h2 { color:#FFD700; margin-bottom:12px; font-size:20px; line-height:1.3; } #welcomePopup p { font-size:15px; margin-bottom:15px; line-height:1.5; transition: all 0.3s ease; } #pressArea, #countdownBox, #couponBox { width:240px; height:60px; border-radius:12px; display:flex; justify-content:center; align-items:center; font-size:18px; margin:10px auto; cursor:pointer; user-select:none; position: relative; } #pressArea { background:#FFD700; color:#0F9D58; font-weight:600; } #countdownBox { background:#FFD700; color:#0F9D58; font-size:24px; font-weight:bold; display:none; } #couponBox { background:#fff; color:#0F9D58; font-weight:bold; display:none; text-align:center; animation: fadeIn 0.6s ease forwards; opacity:0; box-shadow:0 4px 12px rgba(0,0,0,0.08); } .star { width:12px; height:12px; position:absolute; font-size:12px; opacity:0.5; animation: starMove 1.2s linear forwards; } @keyframes starMove { to { transform: translateY(-70px) translateX(40px) scale(0); opacity:0; } } #welcomePopup .close-btn { background:transparent; color:#FFD700; border:2px solid #FFD700; padding:8px 18px; border-radius:10px; cursor:pointer; font-weight:600; transition:all 0.3s ease; } #welcomePopup .close-btn:hover { background:#FFD700; color:#0F9D58; } .toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background:#1B48E1; color:#fff; padding:12px 22px; border-radius:8px; font-size:14px; opacity:0; pointer-events: none; transition: opacity 0.5s ease, transform 0.5s ease; z-index:10000; } .toast.show { opacity:1; transform: translateX(-50%) translateY(-10px); } @keyframes popupFade { from{transform:translateY(-20px);opacity:0;} to{transform:translateY(0);opacity:1;} } @keyframes fadeIn { from{opacity:0;} to{opacity:1;} } `; document.head.appendChild(style); // ========== HTML البوب أب ========== const popup = document.createElement("div"); popup.id = "welcomePopup"; popup.innerHTML = `اضغط لاكتشاف كوبونك الخاص بهذه المناسبة!