/* Add custom Js styles below */
/* Add custom Js styles below */
/* Add custom Js styles below */
/* Add custom Js code below */
/* Add custom Js code below */
(function() {
// إنشاء عنصر الواتساب العائم مع أعلى أولوية
const whatsappContainer = document.createElement('div');
whatsappContainer.className = 'ws-float-container';
whatsappContainer.style.cssText = `
position: fixed !important;
bottom: 20px !important;
left: 20px !important;
z-index: 2147483647 !important;
display: block!important;
`;
// إنشاء نافذة الدردشة
const whatsappPanel = document.createElement('div');
whatsappPanel.className = 'ws-chat-panel';
whatsappPanel.style.cssText = `
display: none !important;
position: fixed !important;
bottom: 90px !important;
left: 20px !important;
z-index: 2147483647 !important;
`;
// محتوى النافذة المعدل
whatsappPanel.innerHTML = `
مرحباً بك، نحن متواجدون لخدمتك
برجاء اختيار أحد الخيارات:
- 1- لتتبع الطلب
- 2- الإبلاغ عن مشكلة
- 3- استفسار عام
تواصل عبر واتساب
`;
whatsappContainer.appendChild(whatsappPanel);
// إنشاء أيقونة الواتساب المعدلة
const whatsappBtn = document.createElement('img');
whatsappBtn.src = 'https://upload.wikimedia.org/wikipedia/commons/6/6b/WhatsApp.svg';
whatsappBtn.alt = 'واتساب';
whatsappBtn.className = 'ws-main-btn';
whatsappBtn.style.cssText = `
width: 60px !important;
height: 60px !important;
border-radius: 50% !important;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
cursor: pointer !important;
transition: transform 0.3s ease-in-out !important;
display: block !important;
`;
whatsappContainer.appendChild(whatsappBtn);
// إضافة الأنماط المعدلة
const wsStyle = document.createElement('style');
wsStyle.innerHTML = `
.ws-float-container {
position: fixed !important;
bottom: 20px !important;
left: 20px !important;
z-index: 2147483647 !important;
}
.ws-main-btn {
width: 60px !important;
height: 60px !important;
border-radius: 50% !important;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
cursor: pointer !important;
transition: transform 0.3s ease-in-out !important;
}
.ws-main-btn:hover {
transform: scale(1.1) !important;
}
.ws-chat-panel {
position: fixed !important;
bottom: 90px !important;
left: 20px !important;
background-color: #252525;
width: 300px !important;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
padding: 15px !important;
color: white !important;
border-radius: 10px !important;
z-index: 2147483647 !important;
}
.ws-panel-header {
display: flex !important;
justify-content: space-between !important;
align-items: center !important;
margin-bottom: 15px !important;
}
.ws-avatar-wrapper {
display: flex !important;
align-items: center !important;
}
.ws-avatar-img {
width: 40px !important;
height: 40px !important;
border-radius: 50% !important;
margin-left: 10px !important;
}
.ws-support-text {
font-size: 16px !important;
font-weight: bold !important;
}
.ws-close-btn {
background: none !important;
border: none !important;
font-size: 20px !important;
cursor: pointer !important;
color: white !important;
}
.ws-options-list {
list-style-type: none !important;
padding: 0 !important;
margin: 15px 0 !important;
}
.ws-options-list li {
margin-bottom: 8px !important;
padding-right: 10px !important;
}
.ws-chat-btn {
display: block !important;
width: 100% !important;
text-align: center !important;
background-color: #25d366 !important;
color: white !important;
padding: 10px 15px !important;
border-radius: 5px !important;
text-decoration: none !important;
margin: 20px 0 15px !important;
transition: background-color 0.3s !important;
}
.ws-chat-btn:hover {
background-color: #1ebe55 !important;
}
.ws-credits {
display: flex !important;
justify-content: center !important;
margin-top: 10px !important;
}
.ws-dev-link {
display: flex !important;
align-items: center !important;
text-decoration: none !important;
}
.ws-dev-logo {
width: 30px !important;
height: 30px !important;
margin-left: 5px !important;
}
.ws-dev-text {
font-size: 12px !important;
color: white !important;
}
`;
document.head.appendChild(wsStyle);
// أحداث النقر المعدلة
whatsappBtn.addEventListener('click', function() {
whatsappPanel.style.display = whatsappPanel.style.display === 'none' ? 'block' : 'none';
});
document.querySelector('.ws-close-btn')?.addEventListener('click', function() {
whatsappPanel.style.display = 'none';
});
// إضافة العنصر إلى body مع تأخير
setTimeout(function() {
document.body.appendChild(whatsappContainer);
console.log('تم تحميل عنصر واتساب بنجاح');
}, 500);
})();
function enhanceCards() {
const cards = document.querySelectorAll('.s-product-card-entry');
if (cards.length === 0) return;
cards.forEach((card, index) => {
if (card.querySelector('.product-rating')) return;
// نجوم التقييم
const stars = document.createElement('div');
stars.className = 'product-rating';
const rating = Math.floor(Math.random() * 2) + 4;
for (let i = 0; i < 5; i++) {
const star = document.createElement('span');
star.innerHTML = i < rating ? '★' : '☆';
stars.appendChild(star);
}
stars.style.display = 'flex';
stars.style.justifyContent = 'center';
stars.style.color = '#FFD700';
stars.style.fontSize = '18px';
stars.style.margin = '10px 0';
card.querySelector('.s-product-card-content-main')?.appendChild(stars);
// بادج (جديد أو خصم)
const badge = document.createElement('div');
badge.className = 'product-badge';
badge.textContent = index % 2 === 0 ? 'جديد' : 'حصري';
badge.style.cssText = `
position: absolute;
top: 8px;
right: 8px;
background-color: var(--color-primary);
color: white;
padding: 4px 10px;
border-radius: 6px;
font-size: 13px;
font-weight: bold;
z-index: 10;
`;
card.style.position = 'relative';
card.appendChild(badge);
});
}
let tryCount = 0;
const interval = setInterval(() => {
enhanceCards();
tryCount++;
if (tryCount > 10) clearInterval(interval);
}, 1000)
/* Add custom Js code below */
document.querySelectorAll('a[href=""]').forEach(x=>{x.addEventListener('click',e => {e.preventDefault();});});
(() => {
const CONFIG = {
selector : '.store-header',
gradient : 'var(--background-gradient)', // استخدام التدرج من :root
interval : 5000,
fadeTime : 400,
msgs : [
" 🛒💥 عروض حصرية تنتظرك الآن",
"⏳💰 لا تفوت فرص التوفير اليوم",
"🔥 عروض حصرية تنتظرك الآن",
"🔥 خصومات لن تجدها إلا هنا",
"💥💵 أسعار تبدأ من المستحيل",
]
};
if (localStorage.getItem('tickerClosed')) return;
const waitFor = s => new Promise(res => {
if (document.querySelector(s)) return res(document.querySelector(s));
new MutationObserver((_, o) => {
if (document.querySelector(s)) { o.disconnect(); res(document.querySelector(s)); }
}).observe(document.documentElement, { childList: true, subtree: true });
});
const makeTicker = header => {
if (document.querySelector('.clr-ticker')) return;
const bar = Object.assign(document.createElement('div'), {
className: 'clr-ticker',
role: 'region',
ariaLabel: 'إعلانات المتجر',
innerHTML: `