document.addEventListener('DOMContentLoaded', function () {
// Show intro only on homepage
if (window.location.pathname === '/' || window.location.pathname === '/index.html') {
// Create the intro screen
const intro = document.createElement('div');
intro.id = 'intro-screen';
intro.innerHTML = `
متجر إلكتروني موثوق
© 2025 – جميع الحقوق محفوظة
`;
document.body.appendChild(intro);
// Delay logo appearance
setTimeout(() => {
intro.classList.add('show-logo');
}, 400);
// Remove after a moment
setTimeout(() => {
intro.classList.add('fade-out');
setTimeout(() => intro.remove(), 800);
}, 2400);
}
});
document.addEventListener('DOMContentLoaded', function () {
if (window.location.pathname === '/cart') {
// Create the intro screen
const intro = document.createElement('div');
intro.id = 'intro-screen';
intro.innerHTML = `
`;
document.body.appendChild(intro);
// Show image with delay
setTimeout(() => {
intro.classList.add('show-logo');
}, 400);
// Fade out after 2.4s
setTimeout(() => {
intro.classList.add('fade-out');
setTimeout(() => intro.remove(), 800);
}, 2400);
// Updated styles: no background, transparent overlay
const style = document.createElement('style');
style.innerHTML = `
#intro-screen {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: transparent;
display: flex;
align-items: center;
justify-content: center;
z-index: 10000;
opacity: 0;
transition: opacity 0.4s ease;
pointer-events: none;
}
#intro-screen.show-logo {
opacity: 1;
pointer-events: auto;
}
#intro-screen.fade-out {
opacity: 0;
}
`;
document.head.appendChild(style);
}
});
document.addEventListener('DOMContentLoaded', function () {
if (window.location.pathname === '/cart') {
setTimeout(() => {
const notice = document.createElement('div');
notice.id = 'support-notice';
notice.innerHTML = `
طرق دفع اخرى ؟ اضغط هنا
`;
document.body.appendChild(notice);
// Animate in
setTimeout(() => {
notice.classList.add('show-notice');
}, 50);
// Styles
const style = document.createElement('style');
style.innerHTML = `
#support-notice {
position: fixed;
bottom: -100px;
right: 20px;
background: rgba(0, 0, 0, 0.8);
color: white;
font-size: 13px;
font-family: Montserrat, sans-serif;
padding: 10px 14px;
border-radius: 8px;
z-index: 9999;
box-shadow: 0 4px 12px rgba(0,0,0,0.2);
transition: bottom 0.5s ease;
line-height: 1.6;
direction: rtl;
}
#support-notice.show-notice {
bottom: 20px;
}
`;
document.head.appendChild(style);
}, 1500); // 1.5 second delay
}
});
document.addEventListener('DOMContentLoaded', function () {
if (window.location.pathname !== '/') return;
const footer = document.querySelector('footer');
if (!footer) return;
const section = document.createElement('section');
section.id = 'trust-badges-section';
section.innerHTML = `
دعم فني وخدمة عملاء
فريق متخصص جاهز لمساعدتك على مدار الساعة.
توصيل سريع
استلم منتجاتك الرقمية فوراً بعد الدفع.
خيارات دفع متعددة
مدى، أبل باي، STC Pay وغيرها.
منتجات رقمية أصلية
نضمن لك الجودة والموثوقية.
`;
footer.parentNode.insertBefore(section, footer);
const style = document.createElement('style');
style.innerHTML = `
#trust-badges-section {
padding: 50px 0;
background: #f0f0f4;
direction: rtl;
}
.trust-badges-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
max-width: 1200px;
margin: 0 auto;
padding: 0 15px;
}
.trust-badge {
background: linear-gradient(145deg, #ffffff, #f5f5f5);
border-radius: 20px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
text-align: center;
transition: transform 0.3s ease, box-shadow 0.3s ease;
font-family: 'Montserrat', sans-serif;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
aspect-ratio: 1/1;
padding: 20px;
}
.trust-badge:hover {
transform: translateY(-8px);
box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12);
}
.trust-badge img {
width: 70px;
height: 70px;
margin-bottom: 15px;
object-fit: contain;
}
.trust-badge-title {
font-size: 1.2rem;
font-weight: 800;
margin-bottom: 8px;
color: #222;
}
.trust-badge-description {
font-size: 0.95rem;
color: #666;
}
@media (max-width: 768px) {
.trust-badges-container {
grid-template-columns: repeat(2, 1fr);
gap: 10px;
padding: 0 10px;
}
.trust-badge {
border-radius: 15px;
padding: 15px;
}
.trust-badge img {
width: 60px;
height: 60px;
}
.trust-badge-title {
font-size: 1rem;
}
.trust-badge-description {
font-size: 0.85rem;
}
}
`;
document.head.appendChild(style);
});
document.addEventListener('DOMContentLoaded', function() {
if (window.location.pathname.includes('/available-payment-methods/page-1661788708')) {
var wrapper = document.createElement('div');
wrapper.style.cssText = `
max-width:900px;
margin:40px auto;
padding:30px 20px;
background:linear-gradient(145deg,#ffffff,#e6e6e6);
box-shadow:0 10px 20px rgba(0,0,0,0.15);
border-radius:20px;
text-align:center;
font-family:'Montserrat', Arial, sans-serif;
color:#222;
direction:rtl;
`;
var mainTitle = document.createElement('h2');
mainTitle.innerText = 'طرق الدفع المتوفرة';
mainTitle.style.cssText = `
font-size:30px;
margin-bottom:25px;
font-weight:bold;
text-shadow:1px 1px 2px rgba(0,0,0,0.1);
`;
wrapper.appendChild(mainTitle);
var paymentOptions = [
{
name: 'ويسترن يونيون',
image:'https://i.postimg.cc/RCYcs38C/WU-1a8f4ddc.png',
description: 'يمكنك الدفع بسهولة وأمان عبر Western Union. نوفر لك طرق دفع مرنة وآمنة لتجربة تسوق مريحة.'
},
{
name: 'دفع بالعملات الرقمية',
image:'https://i.postimg.cc/MZgQ0CMv/download-removebg-preview.png',
description: 'ندعم الدفع عبر البيتكوين والعملات الرقمية الأخرى !'
}
];
paymentOptions.forEach(function(option) {
var row = document.createElement('div');
row.style.cssText = `
display:flex;
align-items:center;
justify-content:flex-start;
flex-wrap:wrap;
background:#f9f9f9;
padding:15px;
margin-bottom:20px;
border-radius:15px;
box-shadow:2px 2px 8px rgba(0,0,0,0.05);
transition:transform 0.3s ease, box-shadow 0.3s ease;
color:#222;
`;
row.addEventListener('mouseenter', function() {
row.style.transform = 'translateY(-5px)';
row.style.boxShadow = '4px 4px 12px rgba(0,0,0,0.1)';
});
row.addEventListener('mouseleave', function() {
row.style.transform = 'translateY(0)';
row.style.boxShadow = '2px 2px 8px rgba(0,0,0,0.05)';
});
var img = document.createElement('img');
img.src = option.image;
img.alt = option.name;
img.style.cssText = `
width:60px;
height:60px;
object-fit:contain;
margin-left:20px;
flex-shrink:0;
border-radius:10px;
`;
var textContainer = document.createElement('div');
textContainer.style.cssText = `
text-align:right;
flex:1;
`;
var title = document.createElement('h3');
title.innerText = option.name;
title.style.cssText = `
font-size:22px;
margin:0 0 8px 0;
color:#333;
`;
var description = document.createElement('p');
description.innerText = option.description;
description.style.cssText = `
margin:0;
color:#555;
font-size:16px;
line-height:1.5;
`;
textContainer.appendChild(title);
textContainer.appendChild(description);
row.appendChild(img);
row.appendChild(textContainer);
wrapper.appendChild(row);
});
var instructionsContainer = document.createElement('div');
instructionsContainer.style.cssText = `
margin-top:40px;
padding:20px;
background:linear-gradient(135deg,#fff9c4,#fff59d);
border:2px dashed #fdd835;
border-radius:15px;
box-shadow:2px 2px 10px rgba(0,0,0,0.05);
font-size:20px;
color:#222;
line-height:1.8;
text-align:center;
font-weight:bold;
font-family:'Montserrat', Arial, sans-serif;
`;
instructionsContainer.innerHTML = `
فضلاً بعد اتمام عملية الدفع ، يرجى إرسال لقطة الشاشة عبر رقم المتجر:
+966563401544
مع تفاصيل طلبك.
`;
wrapper.appendChild(instructionsContainer);
var header = document.querySelector('header');
if (header) {
header.parentNode.insertBefore(wrapper, header.nextSibling);
} else {
document.body.insertBefore(wrapper, document.body.firstChild);
}
var alertContainer = document.createElement('div');
alertContainer.style.cssText = `
position:fixed;
top:100px;
left:20px;
background:#ffebee;
border:2px solid #e53935;
border-radius:10px;
padding:15px 20px;
color:#b71c1c;
font-size:16px;
font-weight:bold;
box-shadow:0 4px 10px rgba(0,0,0,0.2);
z-index:9999;
animation:moveLeftRight 2s infinite alternate;
display:flex;
align-items:center;
gap:10px;
`;
alertContainer.innerHTML = '🚨 يرجى تحويل وضع العملة في اعلى الصفحة قبل اجراء عملية التحويل ، والتأكد من المبلغ قبل التحويل 🚨';
document.body.appendChild(alertContainer);
var style = document.createElement('style');
style.innerHTML = `
@media (max-width:600px){
div[style*="max-width:900px"] h2{font-size:26px;}
div[style*="max-width:900px"] h3{font-size:20px;}
div[style*="max-width:900px"] p{font-size:15px;}
}
@keyframes moveLeftRight{
0%{transform:translateX(0);}
100%{transform:translateX(10px);}
}
`;
document.head.appendChild(style);
}
});
// Create the notice bar
const noticeBar = document.createElement('div');
noticeBar.innerHTML = `
🔥 عرض لفترة محدودة: احصل على خصم 20٪ على جميع المنتجات الرقمية! استخدم الكود:
SAVE30 🔥
🔥 خصم 20٪ على جميع المنتجات الرقمية! استخدم الكود:
SAVE20 🔥
`;
// Initial styles (not fixed)
Object.assign(noticeBar.style, {
position: 'relative',
top: '0',
width: '100%',
backgroundColor: '#FF3B30',
color: '#fff',
fontFamily: 'Montserrat, sans-serif',
fontSize: '15px',
fontWeight: '600',
textAlign: 'center',
padding: '10px',
zIndex: '9999',
direction: 'rtl',
borderBottom: '1px solid #ddd',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
lineHeight: '1.4',
boxSizing: 'border-box',
flexWrap: 'nowrap',
gap: '8px',
transition: 'top 0.3s ease',
});
// Add animation + mobile switch styles
const style = document.createElement('style');
style.innerHTML = `
.notice-text {
display: inline-block;
animation: softPulse 3s infinite ease-in-out;
max-width: 100%;
white-space: nowrap;
}
.notice-desktop {
display: inline-block;
}
.notice-mobile {
display: none;
}
@media (max-width: 600px) {
#notice-bar {
font-size: 13px !important;
padding: 8px !important;
flex-direction: row !important;
flex-wrap: wrap;
}
.notice-desktop {
display: none;
}
.notice-mobile {
display: inline-block;
text-align: center;
}
}
.highlight-code {
animation: glowPulse 3s infinite ease-in-out;
color: #000;
font-weight: bold;
background-color: #FACC15;
padding: 2px 6px;
border-radius: 4px;
}
@keyframes softPulse {
0% { transform: scale(1); opacity: 1; }
50% { transform: scale(1.01); opacity: 0.98; }
100% { transform: scale(1); opacity: 1; }
}
@keyframes glowPulse {
0% { text-shadow: 0 0 0px #FACC15; transform: scale(1); }
50% { text-shadow: 0 0 10px #FACC15; transform: scale(1.05); }
100% { text-shadow: 0 0 0px #FACC15; transform: scale(1); }
}
`;
document.head.appendChild(style);
// Apply ID and add to DOM
noticeBar.id = 'notice-bar';
document.body.prepend(noticeBar);
// Adjust body padding dynamically (optional, since no longer fixed)
document.body.style.paddingTop = noticeBar.offsetHeight + 'px';
// Show/hide on scroll
let lastScrollTop = 0;
window.addEventListener('scroll', () => {
const currentScroll = window.scrollY;
if (currentScroll <= 10) {
noticeBar.style.position = 'relative';
noticeBar.style.top = '0';
} else {
noticeBar.style.position = 'absolute';
noticeBar.style.top = '-100px'; // hide it
}
lastScrollTop = currentScroll;
});