/************************************************************************************/ /************************************************************************************/ /************************************************************************************/ /************************************************************************************/ /* جميع التعديلات الخاصة بتنسيق المتجر تمت اضافتها من قبل المهندس محمد شيخ موسى mobile : +963992318670 email : mohammad.al.laith.mousa@gmail.com */ /************************************************************************************/ /************************************************************************************/ /************************لا أحلل أخذ أي جزء من الكود *******************************/ /************************************************************************************/ /************************************************************************************/ (function () { "use strict"; /* ========================================================= Shared utilities ========================================================= */ const runAll = (tasks) => () => tasks.every((task) => { try { return task(); } catch { return true; } }); const setTextOnce = (selector, text) => () => { const el = document.querySelector(selector); if (!el || el.dataset.modified) return true; el.textContent = text; el.dataset.modified = "true"; return true; }; /* ========================================================= 1. Titles above the two donation grids ========================================================= */ const injectGridTitles = () => { const grids = [ { id: "#donations-grid-1", text: "قسم الكوينز" }, { id: "#donations-grid-2", text: "خدمات FC27 الأخرى" }, ]; grids.forEach(({ id, text }) => { const section = document.querySelector(`section${id}`); if (!section || section.querySelector(".s-block__title")) return; section.insertAdjacentHTML( "afterbegin", `
`;
const style = document.createElement("style");
style.textContent = `
#tabby-tamara-float {
position: fixed;
bottom: 44px;
left: 24px;
z-index: 9999;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 6px;
padding: 8px;
background: #ffffff;
border-radius: 16px;
text-decoration: none !important;
box-shadow: 0 8px 24px rgba(125, 19, 192, 0.35);
transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
animation: tt-float-bounce 3s ease-in-out infinite;
cursor: pointer;
}
#tabby-tamara-float:hover {
transform: translateY(-5px) scale(1.05);
box-shadow: 0 12px 32px rgba(125, 19, 192, 0.65);
animation-play-state: paused;
}
#tabby-tamara-float .tt-logo {
height: 26px;
width: auto;
display: block;
object-fit: contain;
}
#tabby-tamara-float::before,
#tabby-tamara-float::after {
content: '';
position: absolute;
inset: 0;
border-radius: 16px;
background: #7d13c0;
z-index: -1;
animation: tt-pulse 2s ease-out infinite;
}
#tabby-tamara-float::after { animation-delay: 1s; }
@keyframes tt-float-bounce {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-6px); }
}
@keyframes tt-pulse {
0% { transform: scale(1); opacity: 0.7; }
100% { transform: scale(1.5); opacity: 0; }
}
@media (max-width: 640px) {
#tabby-tamara-float {
bottom: 66px; left: 16px; padding: 6px; gap: 4px; border-radius: 12px;
}
#tabby-tamara-float .tt-logo { height: 20px; }
#tabby-tamara-float::before,
#tabby-tamara-float::after { border-radius: 12px; }
}
@media (prefers-reduced-motion: reduce) {
#tabby-tamara-float,
#tabby-tamara-float::before,
#tabby-tamara-float::after { animation: none !important; }
}
`;
document.head.appendChild(style);
document.body.appendChild(badge);
return true;
};
/* =========================================================
9. Orders page title (only on /account/orders)
========================================================= */
const renameOrdersTitle = () => {
if (!window.location.pathname.includes("/account/orders")) return true;
setTextOnce("h1.font-bold.text-lg", "سجل الطلبات")();
document.title = "AURA - سجل الطلبات";
return true;
};
/* =========================================================
10. Change "أضف للسلة" button text everywhere
========================================================= */
const rewriteAddToCartButtons = () => {
const NEW_TEXT = "أضف للسلة";
document.querySelectorAll("span.s-button-text").forEach((span) => {
if (span.textContent.trim() === "أضف لسلة التبرعات") {
span.textContent = NEW_TEXT;
}
});
return true;
};
/* =========================================================
11. Cart page text replacements (only on /ar/cart)
========================================================= */
const rewriteCartPage = () => {
if (!window.location.href.includes("/ar/cart")) return true;
// استبدال "ملخص المساهمة" بـ "الملخص"
document
.querySelectorAll("h3.s-cart-summary-card-sheet-title")
.forEach((el) => {
if (el.textContent.trim() === "ملخص المساهمة") {
el.textContent = "الملخص";
}
});
// استبدال "مجموع التبرعات" بـ "مجموع المنتجات"
document
.querySelectorAll(".s-cart-summary-card-line > span")
.forEach((el) => {
if (el.textContent.trim() === "مجموع التبرعات") {
el.textContent = "مجموع المنتجات";
}
});
// استبدال "إتمام التبرع" بـ "إتمام الطلب"
document.querySelectorAll("span.s-button-text").forEach((span) => {
if (span.textContent.trim() === "إتمام التبرع") {
span.textContent = "إتمام الطلب";
}
});
return true;
};
/* =========================================================
12. Rewrite "إتمام التبرع" inside the add-to-cart toast
========================================================= */
const rewriteToastButton = () => {
document
.querySelectorAll(
"salla-add-product-toast.s-add-product-toast--visible span.s-button-text",
)
.forEach((span) => {
if (span.textContent.trim() === "إتمام التبرع") {
span.textContent = "إتمام الطلب";
}
});
return true;
};
/* =========================================================
13. Replace "سجل التبرعات" with "سجل الطلبات" in user menu
========================================================= */
const rewriteUserMenuOrders = () => {
document
.querySelectorAll(
".s-user-menu-inline .s-user-menu-dropdown-item-title, .s-user-menu-dropdown-list .s-user-menu-dropdown-item-title",
)
.forEach((el) => {
if (el.textContent.trim() === "سجل التبرعات") {
el.textContent = "سجل الطلبات";
}
});
return true;
};
/* =========================================================
14. Donation counter → Purchase counter + Animation
========================================================= */
const rewriteDonationCounter = () => {
// البحث عن العنصر الذي يحتوي على النص
const container = document.querySelector(".main-content .flex.text-sm");
if (!container) return true;
// تجنب تكرار التنفيذ
if (container.dataset.counterModified === "true") return true;
// استبدال كلمة "التبرع" بكلمة "الشراء"
const walker = document.createTreeWalker(
container,
NodeFilter.SHOW_TEXT,
null,
false,
);
let node;
while ((node = walker.nextNode())) {
if (node.nodeValue.includes("التبرع")) {
node.nodeValue = node.nodeValue.replace(/التبرع/g, "الشراء");
}
}
// إضافة CSS للأنيميشن (مرة واحدة فقط)
if (!document.getElementById("donation-counter-style")) {
const style = document.createElement("style");
style.id = "donation-counter-style";
style.textContent = `
@keyframes fadeInSlide {
0% {
opacity: 0;
transform: translateY(-15px) scale(0.9);
filter: blur(4px);
}
60% {
opacity: 1;
transform: translateY(3px) scale(1.02);
filter: blur(0);
}
100% {
opacity: 1;
transform: translateY(0) scale(1);
filter: blur(0);
}
}
@keyframes pulseGlow {
0%, 100% {
box-shadow: 0 0 0 0 rgba(125, 19, 192, 0.6),
0 0 0 0 rgba(125, 19, 192, 0.3);
}
50% {
box-shadow: 0 0 20px 6px rgba(125, 19, 192, 0.5),
0 0 35px 10px rgba(125, 19, 192, 0.2);
}
}
@keyframes iconBounce {
0%, 100% { transform: scale(1) rotate(0deg); }
25% { transform: scale(1.25) rotate(-8deg); }
50% { transform: scale(1.1) rotate(8deg); }
75% { transform: scale(1.2) rotate(-4deg); }
}
@keyframes shimmer {
0% { background-position: -200% 0; }
100% { background-position: 200% 0; }
}
@keyframes borderRotate {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
.donation-animated {
padding: 10px 16px;
border-radius: 10px;
background: linear-gradient(45deg, #7d13c0, #0c1013 90%) !important;
background-size: 200% 200% !important;
animation: fadeInSlide 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
pulseGlow 2.5s ease-in-out 0.8s infinite,
borderRotate 4s ease infinite;
position: relative;
overflow: hidden;
display: inline-block;
color: #fff;
border: 1px solid rgba(125, 19, 192, 0.6);
}
.donation-animated::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(120deg,
transparent 30%,
rgba(255, 255, 255, 0.25) 50%,
transparent 70%);
background-size: 200% 100%;
animation: shimmer 2s ease-in-out 1s infinite;
pointer-events: none;
}
.donation-animated .sicon-fire {
display: inline-block;
animation: iconBounce 1.2s ease-in-out 0.3s;
transform-origin: center;
color: #c084fc !important;
}
.donation-animated .text-primary {
color: #c084fc !important;
font-weight: bold;
}
.donation-animated .text-primary span {
color: #ffffff !important;
text-shadow: 0 0 8px rgba(125, 19, 192, 0.8);
}
`;
document.head.appendChild(style);
}
// تطبيق الأنيميشن على العنصر
const targetElement = container.querySelector("div");
if (targetElement) {
targetElement.classList.add("donation-animated");
}
container.dataset.counterModified = "true";
return true;
};
/* =========================================================
Boot
========================================================= */
const tasks = [
injectGridTitles,
rewriteFooterCredit,
rewriteAboutSection,
renameAboutWidget,
appendSecondWhatsApp,
appendPaymentIcons,
injectApplePayNotice,
mountFloatingBadge,
renameOrdersTitle,
rewriteAddToCartButtons,
rewriteCartPage,
rewriteToastButton,
rewriteUserMenuOrders,
rewriteDonationCounter,
];
const runTasks = runAll(tasks);
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", runTasks);
} else {
runTasks();
}
// مراقبة دائمة لأن أزرار سلة تُبنى بشكل غير متزامن
const observer = new MutationObserver(() => {
runTasks();
});
observer.observe(document.body, { childList: true, subtree: true });
// إعادة تشغيل إضافية كل ثانية لأول 15 ثانية
let ticks = 0;
const interval = setInterval(() => {
runTasks();
if (++ticks >= 15) clearInterval(interval);
}, 1000);
// إعادة التشغيل عند التنقل الداخلي في سلة (SPA)
window.addEventListener("popstate", runTasks);
document.addEventListener("salla:pageLoaded", runTasks);
})();