const floatButton = document.createElement('button');
floatButton.classList.add('momyzat-btn');
floatButton.innerText = "أهم ما يميزنا 🌟";
document.body.appendChild(floatButton);
const popupWindow = document.createElement('div');
popupWindow.classList.add('momyzat-popup');
popupWindow.innerHTML = `
`;
document.body.appendChild(popupWindow);
floatButton.addEventListener('click', () => {
popupWindow.classList.toggle('active');
});
const closeButton = popupWindow.querySelector('.close-btn');
closeButton.addEventListener('click', (e) => {
e.preventDefault();
popupWindow.classList.remove('active');
});
// window.onload = function() {
// const style = document.createElement('style');
// style.innerHTML = `
// body {
// position: relative;
// }
// #popup {
// content: "🛒 نحن متجر ELECTRONIA نحن هنا لنوفر لك أفضل المنتجات 🛍️✨";
// position: absolute;
// top: 20px;
// left: 50%;
// transform: translateX(-50%);
// background-color:#4c1c54;
// color:#ffffff;
// padding: 15px 25px;
// border-radius: 12px;
// font-size: 18px;
// font-family: Arial, sans-serif;
// display: none;
// text-align: center;
// max-width: 80%;
// box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
// z-index:99999999999;
// }
// #popup.show {
// display: block;
// animation: fadeInOut 7s ease-in-out forwards;
// }
// @keyframes fadeInOut {
// 0% {
// opacity: 0;
// transform: translateX(-50%) translateY(-20px);
// }
// 20% {
// opacity: 1;
// transform: translateX(-50%) translateY(0);
// }
// 80% {
// opacity: 1;
// transform: translateX(-50%) translateY(0);
// }
// 100% {
// opacity: 0;
// transform: translateX(-50%) translateY(20px);
// }
// }
// `;
// document.head.appendChild(style);
// const popup = document.createElement('div');
// popup.id = 'popup';
// popup.textContent = "🛒 نحن متجر ELECTRONIA نحن هنا لنوفر لك أفضل المنتجات 🛍️✨";
// document.body.appendChild(popup);
// setTimeout(() => {
// popup.classList.add('show');
// setTimeout(() => {
// popup.classList.remove('show');
// }, 7000);
// }, 4000);
// };
const section = document.querySelector('#app > div.app-inner.flex.flex-col.min-h-full > section.s-block.s-block--categories');
const faqData = [
{
question: "هل هناك توصيل لدول الخليج؟",
answer: "نعم نوفر الشحن لكل دول الخليج وبأسعار مغرية"
},
{
question: "هل يمكن ارجاع المنتج في حالة لم يعجبني؟",
answer: "نعم ندعم في متجرنا سياسة الاسترجاع بشرط أن لا تتجاوز المدة 10 أيام من استلام المنتج"
},
{
question: "هل منتجاتكم أصلية؟",
answer: "أكيد نحن نفخر بأن منتجاتنا أصلية وذات جودة عالية"
}
];
if (section) {
section.innerHTML = '';
let questionsHTML = faqData.map(({ question, answer }) => `
`).join('');
section.innerHTML = `
`;
const script = document.createElement('script');
script.textContent = `
document.querySelectorAll('.question-item .question').forEach(question => {
question.addEventListener('click', function () {
const answer = this.nextElementSibling;
const isVisible = answer.classList.contains('show');
document.querySelectorAll('.answer').forEach(a => a.classList.remove('show'));
document.querySelectorAll('.question').forEach(q => q.classList.remove('open'));
if (!isVisible) {
answer.classList.add('show');
this.classList.add('open');
}
});
});
`;
section.appendChild(script);
}
document.addEventListener("DOMContentLoaded", function() {
const elements = document.querySelectorAll('.banner--fixed img');
function handleScroll() {
const windowHeight = window.innerHeight;
elements.forEach(element => {
const rect = element.getBoundingClientRect();
if (rect.top <= windowHeight * 0.8) {
element.classList.add('visible');
}
});
}
window.addEventListener('scroll', handleScroll);
handleScroll();
});
let link = document.createElement("link");
link.href = "https://fonts.googleapis.com/css2?family=Cairo:wght@400;700&display=swap";
link.rel = "stylesheet";
document.head.appendChild(link);
let style = document.createElement("style");
style.innerHTML = `
* {
font-family: 'Cairo', sans-serif !important;
}
`;
document.head.appendChild(style);
document.addEventListener("DOMContentLoaded", function () {
const section = document.querySelector('.s-block.s-block--features');
if (!section) return;
section.innerHTML = `
`;
const style = document.createElement('style');
style.textContent = `
.feature-card {
background-color: transparent;
border-radius: 20px;
padding: 5px;
text-align: center;
transition: transform 0.4s ease, box-shadow 0.4s ease;
position: relative;
overflow: hidden;
perspective: 1000px;
}
.feature-card:hover {
transform: translateY(-7px);
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}
.icon-wrapper {
width: 200px;
height:200px;
margin: 0 auto 5px auto;
transition: transform 0.8s ease;
transform-style: preserve-3d;
will-change: transform;
}
.feature-card:hover .icon-wrapper {
transform: rotateY(180deg);
}
.feature-icon {
width: 100%;
height: 100%;
display: flex;
}
.feature-number {
font-size: 2.7rem;
font-weight: bold;
color: var(--main-color);
margin-bottom: 0px;
}
.feature-label {
font-size: 1.5rem;
color: var(--main-color);
font-weight: bold;
}
`;
document.head.appendChild(style);
const startCounting = () => {
const counters = document.querySelectorAll('.feature-number');
counters.forEach(counter => {
const target = +counter.getAttribute('data-target');
let count = 0;
const increment = target / 100;
const updateCount = () => {
if (count < target) {
count += increment;
counter.textContent = Math.ceil(count);
requestAnimationFrame(updateCount);
} else {
counter.textContent = target;
}
};
updateCount();
});
};
const handleScroll = () => {
const section = document.querySelector('.why-us-section');
if (!section) return;
const sectionTop = section.getBoundingClientRect().top;
const triggerPoint = window.innerHeight - 100;
if (sectionTop < triggerPoint) {
startCounting();
window.removeEventListener('scroll', handleScroll);
}
};
window.addEventListener('scroll', handleScroll);
});