document.querySelector("body > div.app-inner.flex.flex-col.min-h-full > header > div.main-nav-container.shadow-default.bg-white > div > div > div .flex.items-center.justify-end").innerHTML+=
`
`;
document.addEventListener("DOMContentLoaded", function () {
const observer = new MutationObserver(() => {
const menu = document.querySelector("#mainnav ul.s-user-menu-dropdown-list");
if (menu && !menu.dataset.modified) {
const newItem = document.createElement("li");
newItem.className = "s-user-menu-dropdown-item taq";
newItem.innerHTML = `تقييم المتجر والمنتجات`;
const lastItem = menu.lastElementChild;
if (lastItem) {
menu.insertBefore(newItem, lastItem);
} else {
menu.appendChild(newItem);
}
menu.dataset.modified = "true";
}
});
observer.observe(document.body, {
childList: true,
subtree: true,
});
});
window.onload = function () {
// نقل العنصر الأول
const source = document.querySelector('div.main-content.md\\:sticky.md\\:overflow-hidden.top-24.w-full.md\\:w-2\\/4.md\\:pb-16 > div.bg-white.py-2\\.5.mb-5.rounded-md.inline-flex.text-sm');
const target = document.querySelector('salla-rating-stars');
if (source && target) {
target.parentNode.insertBefore(source, target);
}
// نقل small إلى جنب السعر
const smallElement = document.querySelector('div.main-content.md\\:sticky.md\\:overflow-hidden.top-24.w-full.md\\:w-2\\/4.md\\:pb-16 > small');
const priceContainer = document.querySelector('div.flex.whitespace-nowrap.gap-4.items-center');
if (smallElement && priceContainer) {
priceContainer.appendChild(smallElement);
}
};
document.addEventListener('DOMContentLoaded', function () {
const productSections = document.querySelectorAll('section.s-block.container');
productSections.forEach(section => {
const title = section.querySelector('.s-block__title');
const productList = section.querySelector('salla-products-list');
const showAllButton = section.querySelector('.s-block__display-all');
if (title && productList && showAllButton && title.parentElement === section && productList.parentElement === section) {
const wrapper = document.createElement('div');
wrapper.classList.add('s-block-wrap');
section.insertBefore(wrapper, title);
wrapper.appendChild(title);
wrapper.appendChild(productList);
wrapper.appendChild(showAllButton);
}
});
});
document.addEventListener('DOMContentLoaded', function () {
const swiperSection = document.querySelector('section.s-block.s-block--best-offers.container.overflow-hidden');
if (swiperSection) {
const swiperContainer = swiperSection.querySelector('.swiper');
if (swiperContainer) {
const interval = setInterval(() => {
if (swiperContainer.swiper) {
clearInterval(interval);
swiperContainer.swiper.params.slidesPerGroup = 2;
swiperContainer.swiper.update();
}
}, 100);
setTimeout(() => {
clearInterval(interval);
}, 5000);
}
}
});