(function() {
// إضافة CSS
const style = document.createElement('style');
style.textContent = `
.whatsapp-float {
position: fixed;
bottom: 30px;
right: 30px;
z-index: 1000;
}
.whatsapp-button {
width: 60px;
height: 60px;
background: #25D366;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
cursor: pointer;
transition: all 0.3s ease;
position: relative;
text-decoration: none;
}
.whatsapp-button:hover {
transform: scale(1.1);
box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}
.whatsapp-button::before {
content: '';
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
background: #25D366;
animation: whatsapp-pulse 2s infinite;
}
@keyframes whatsapp-pulse {
0% {
transform: scale(1);
opacity: 1;
}
50% {
transform: scale(1.3);
opacity: 0;
}
100% {
transform: scale(1);
opacity: 0;
}
}
.whatsapp-icon {
width: 35px;
height: 35px;
fill: white;
position: relative;
z-index: 1;
}
.whatsapp-tooltip {
position: absolute;
right: 70px;
top: 50%;
transform: translateY(-50%);
background: white;
color: #333;
padding: 10px 15px;
border-radius: 8px;
white-space: nowrap;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
font-size: 14px;
font-weight: 500;
}
.whatsapp-tooltip::after {
content: '';
position: absolute;
left: 100%;
top: 50%;
transform: translateY(-50%);
border: 8px solid transparent;
border-left-color: white;
}
.whatsapp-button:hover .whatsapp-tooltip {
opacity: 1;
visibility: visible;
}
.whatsapp-button:active {
transform: scale(0.95);
}
@media (max-width: 768px) {
.whatsapp-float {
bottom: 20px;
left: 20px;
}
.whatsapp-button {
width: 55px;
height: 55px;
}
.whatsapp-icon {
width: 30px;
height: 30px;
}
.whatsapp-tooltip {
display: none;
}
}
`;
document.head.appendChild(style);
// إنشاء عنصر HTML
const whatsappHTML = `
`;
// إضافة العنصر إلى الصفحة عند تحميلها
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', function() {
document.body.insertAdjacentHTML('beforeend', whatsappHTML);
});
} else {
document.body.insertAdjacentHTML('beforeend', whatsappHTML);
}
// تتبع النقرات (اختياري)
document.addEventListener('click', function(e) {
if (e.target.closest('.whatsapp-button')) {
console.log('تم النقر على زر واتساب');
// يمكن إضافة كود Google Analytics هنا
}
});
})();
///////////////////////////////////
(function () {
const logos = [
"https://i.ibb.co/fVDJHrtK/Apple-Pay-Logo-wine.png",
"https://i.ibb.co/gZ11mkQJ/Mada-Logo-svg.png",
"https://i.ibb.co/YBsxn6H2/43deb5f3-2fe6-40c1-8c3e-a104ef38ebc5-1000x324.webp",
];
function createMarqueeCards() {
return logos
.map(
(logo) => `
`
)
.join("");
}
const marqueeHTML = `
${createMarqueeCards()}
${createMarqueeCards()}
${createMarqueeCards()}
${createMarqueeCards()}
${createMarqueeCards()}
${createMarqueeCards()}
${createMarqueeCards()}
${createMarqueeCards()}
`;
function insertMarquee() {
const targetSection = document.querySelector(
"section.s-block.s-block--photos-slider"
);
if (targetSection) {
targetSection.insertAdjacentHTML("afterend", marqueeHTML);
console.log("marqee done");
} else {
console.warn("not found");
}
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", insertMarquee);
} else {
insertMarquee();
}
})();
///////////////////////
if (window.location.href.includes('p1494837800') ||
window.location.href.includes('p498991194')) {
const style = document.createElement('style');
style.textContent = '.tamara-product-widget { display: none; }';
document.head.appendChild(style);
}
//////////////////
function buildCopy() {
var n = document.createElement("div");
n.className = "marquee__copy";
for (var e = 0; e < 20; e++) {
var t = document.createElement("span");
t.className = "marquee__msg";
t.textContent = "تمتعي بشحن مجاني على جميع مشترياتك بـ 120 ريال وأكثر.. لأن إطلالتك في جمعات رمضان ولياليه هي أولويتنا في ميلاف";
n.appendChild(t);
if (e < 19) {
var a = document.createElement("span");
a.className = "sep";
n.appendChild(a);
}
}
return n;
}
function initMarquee() {
var n = document.createElement("style");
n.textContent = `
.marquee {
background-color: #003464 !important;
color: #fff !important;
overflow: hidden !important;
white-space: nowrap !important;
padding: 12px 0 !important;
position: relative !important;
width: 100% !important;
z-index: 999 !important;
direction: ltr !important; /* Force LTR for animation */
}
.marquee__inner {
display: inline-flex !important;
animation: scroll-right 800s linear infinite !important;
will-change: transform !important;
}
/* Duplicate content to create seamless loop */
.marquee_inner > .marquee_copy:last-child {
animation-delay: -75s !important; /* Half of animation duration */
}
.marquee__copy {
display: inline-flex !important;
align-items: center !important;
flex-shrink: 0 !important;
}
.marquee__msg {
display: inline-block !important;
font-size: 16px !important;
font-weight: 500 !important;
padding: 0 10px !important;
direction: rtl !important; /* Text content stays RTL */
color: #ffff !important;
white-space: nowrap !important;
}
.sep {
display: inline-block !important;
width: 8px !important;
height: 8px !important;
background-color: #ffff !important;
border-radius: 50% !important;
margin: 0 15px !important;
flex-shrink: 0 !important;
}
@keyframes scroll-right {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(100%);
}
}
.marquee:hover .marquee__inner {
animation-play-state: paused !important;
}
`;
document.head.appendChild(n);
var e = document.createElement("div");
e.className = "marquee";
var t = document.createElement("div");
t.className = "marquee__inner";
// Add 4 copies instead of 2 for seamless loop
t.appendChild(buildCopy());
t.appendChild(buildCopy());
t.appendChild(buildCopy());
t.appendChild(buildCopy());
e.appendChild(t);
// Find the best place to insert the marquee
var header = document.querySelector("header");
if (header) {
header.parentNode.insertBefore(e, header.nextSibling);
} else {
var body = document.body;
if (body.firstChild) {
body.insertBefore(e, body.firstChild);
} else {
body.appendChild(e);
}
}
console.log("Marquee created successfully!");
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", initMarquee);
} else {
initMarquee();
}