document.addEventListener('DOMContentLoaded', function() { let logo = document.querySelector('.navbar-brand'); let footerBox = document.querySelector('footer > div.store-footer__inner > div > div.lg\\:col-span-2.rtl\\:lg\\:pl-20.ltr\\:lg\\:pr-20 a.flex.items-center.m-0'); if (logo && footerBox) { // تصغير h3 let h3 = footerBox.querySelector('a > h3'); if (h3) h3.style.fontSize = '0'; // نسخ الشعار let clone = logo.cloneNode(true); footerBox.appendChild(clone); } console.log(logo); console.log(footerBox); }); 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+= ` `; window.Salla.onReady(function() { console.log('Salla Ready - Attempting to move main menu...'); // انتظر قليلاً للتأكد من تحميل جميع المكونات الداخلية setTimeout(function() { // ابحث عن عنصر القائمة الرئيسية const customMainMenuElement = document.querySelector('custom-main-menu'); if (!customMainMenuElement) { console.error('Salla Helper: Custom main menu element not found.'); return; } // ابحث عن الهيدر. const storeHeader = document.querySelector('header.store-header'); if (!storeHeader) { console.error('Salla Helper: Store header element not found.'); return; } // ابحث عن العنصر الذي يأتي بعد الهيدر مباشرة. // سنستخدم الهيدر نفسه كمرجع لوضع القائمة بعده. const elementAfterHeader = storeHeader; // الهيدر نفسه هو العنصر الذي سنضيف القائمة بعده // نحصل على الأخ الذي يلي الهيدر مباشرة في شجرة DOM const nextSiblingElement = elementAfterHeader.nextElementSibling; console.log('Found customMainMenuElement:', customMainMenuElement); console.log('Found storeHeader:', storeHeader); console.log('Found nextSiblingElement (placeholder for insertion):', nextSiblingElement); // قم بإزالة العنصر من موقعه الأصلي (داخل الهيدر) if (customMainMenuElement && customMainMenuElement.parentNode) { customMainMenuElement.remove(); console.log('Custom main menu element removed from its original position.'); } else { console.error('Custom main menu element not found in DOM to remove.'); return; } // قم بإدراج العنصر الجديد في المكان المحدد if (nextSiblingElement) { // أدخل العنصر الجديد قبل العنصر التالي للهيدر // نستخدم parentNode للهيدر لوضع العنصر الجديد فيه، قبل العنصر التالي storeHeader.parentNode.insertBefore(customMainMenuElement, nextSiblingElement); console.log('Custom main menu inserted before the next sibling element.'); } else { // إذا لم يكن هناك عنصر تالي للهيدر، أضفه بعد الهيدر مباشرة في نفس المستوى storeHeader.parentNode.appendChild(customMainMenuElement); console.log('Custom main menu appended after the header element.'); } console.log('Salla Helper: Custom main menu moved successfully.'); // في حال واجهت مشاكل مع فتح القائمة للجوال بعد النقل، قد تحتاج إلى إعادة تهيئة // السكريبتات المسؤولة عن ذلك. مثلاً، إذا كانت هناك دالة تهيئة اسمها SallaMobileMenu.init(): // if (typeof SallaMobileMenu !== 'undefined' && SallaMobileMenu.init) { // SallaMobileMenu.init(); // } }, 500); // تأخير لضمان تحميل المكونات }); document.addEventListener("DOMContentLoaded", function() { const header = document.querySelector("body.index header.store-header"); if (header) { const wrapper = document.createElement("div"); wrapper.classList.add("video-wrapper"); const video = document.createElement("video"); video.classList.add("custom-video"); video.src = "https://raw.githack.com/elwa2/Videos/main/IMG_5376.mp4"; video.autoplay = true; video.loop = true; video.muted = true; video.playsInline = true; wrapper.appendChild(video); header.parentNode.insertBefore(wrapper, header.nextSibling); } });