0
/* ========================================================= FAST IOS — PACKAGE INTERACTION ADD THIS AT THE END OF YOUR CURRENT JS PHP SAFE ========================================================= */ document.addEventListener("DOMContentLoaded", function () { const packageCards = document.querySelectorAll( ".containers.availablepackagaes .package-card" ); if (!packageCards.length) return; packageCards.forEach(function (card) { /* منع تشغيل الكود أكثر من مرة */ if (card.dataset.fastIosReady === "1") return; card.dataset.fastIosReady = "1"; /* تأثير الضغط على البطاقة */ card.addEventListener("mousedown", function () { card.classList.add("fast-package-pressed"); }); card.addEventListener("mouseup", function () { card.classList.remove("fast-package-pressed"); }); card.addEventListener("mouseleave", function () { card.classList.remove("fast-package-pressed"); }); /* للجوال */ card.addEventListener("touchstart", function () { card.classList.add("fast-package-pressed"); }, { passive: true }); card.addEventListener("touchend", function () { setTimeout(function () { card.classList.remove("fast-package-pressed"); }, 120); }, { passive: true }); }); /* ===================================================== BUY BUTTON EFFECT ===================================================== */ const buyButtons = document.querySelectorAll( ".containers.availablepackagaes .fill-button__package" ); buyButtons.forEach(function (button) { if (button.dataset.fastIosButton === "1") return; button.dataset.fastIosButton = "1"; button.addEventListener("click", function () { button.classList.add("fast-buy-clicked"); setTimeout(function () { button.classList.remove("fast-buy-clicked"); }, 300); const icons = { gold: "https://fast-ios.com/public/uploads/files/1nufVZ_pXRx0P32.jpg", diamond: "https://fast-ios.com/public/uploads/files/RWqtXOG7mBCxzLY.jpg", elite: "https://fast-ios.com/public/uploads/files/OmFxH7BINYfb6lP.jpg", ipad: "https://fast-ios.com/public/uploads/files/sWlXfi7HztMwVAQ.jpg" }; function changePackageIcons() { const cards = document.querySelectorAll( ".containers.availablepackagaes .package-card" ); cards.forEach(function (card) { const title = card.querySelector(".header"); const firstLi = card.querySelector(".custom-list li:first-child"); if (!title || !firstLi) return; let icon = ""; const name = title.textContent.trim(); if (name.includes("ذهبية")) { icon = icons.gold; } else if (name.includes("الماسية")) { icon = icons.diamond; } else if (name.includes("النخبة")) { icon = icons.elite; } else if (name.includes("ايباد") || name.includes("آيباد")) { icon = icons.ipad; } if (!icon) return; /* منع التكرار */ if (firstLi.querySelector(".fast-package-icon")) return; /* حذف النجمة */ firstLi.innerHTML = firstLi.innerHTML.replace(/✨/g, ""); /* إضافة الصورة */ const img = document.createElement("img"); img.src = icon; img.className = "fast-package-icon"; firstLi.insertBefore(img, firstLi.firstChild); }); } changePackageIcons(); document.addEventListener("DOMContentLoaded", changePackageIcons); setTimeout(changePackageIcons, 500); setTimeout(changePackageIcons, 1500); setTimeout(changePackageIcons, 3000); }); }); });
تصميم وبرمجة