(function() { const newFooterHtml = ` `; const oldFooter = document.querySelector('footer.store-footer'); if (oldFooter) { oldFooter.outerHTML = newFooterHtml; } else { document.querySelector('.app-inner')?.insertAdjacentHTML('beforeend', newFooterHtml); } })(); const header = document.querySelector('.flex.items-stretch.justify-between.relative'); const child1 = header.children[0]; const child2 = header.children[1]; // 1. Extract elements const logo = child1.querySelector('.navbar-brand'); const menu = child1.querySelector('custom-main-menu'); const mobileToggle = child1.querySelector('[data-testid="store-header-mobile-toggle"]'); // 2. Create new structure with 3 columns const menuContainer = document.createElement('div'); menuContainer.className = 'flex items-center flex-1 order-1'; if (mobileToggle) menuContainer.appendChild(mobileToggle); if (menu) menuContainer.appendChild(menu); const logoContainer = document.createElement('div'); logoContainer.className = 'flex items-center justify-center flex-1 order-2'; if (logo) logoContainer.appendChild(logo); const iconsContainer = document.createElement('div'); iconsContainer.className = 'flex items-center justify-end flex-1 order-3'; while (child2.firstChild) { iconsContainer.appendChild(child2.firstChild); } // 3. Update the header header.innerHTML = ''; header.appendChild(menuContainer); header.appendChild(logoContainer); header.appendChild(iconsContainer); document.querySelector('footer').style.marginTop = '40px'; document.querySelectorAll('*').forEach(el => { if (el.shadowRoot) { const style = document.createElement('style'); style.textContent = `.banner-image-wrapper, .banner-link, img { height: auto !important; }`; el.shadowRoot.appendChild(style); } }); (function() { // 1. Define the English HTML content const englishFooterHTML = `
Logo
Premium Sleepwear

Luxury bamboo pajamas and loungewear. Lightweight comfort that breathes with you.

T I

Important Links

Contact Us

W
+1234567891011
P
+1234567891011
E
name1@hotmail.com
Vision 2030
mada
VISA
tabby
Apple Pay
`; // 2. Check language and apply changes if (document.documentElement.lang === 'en') { const footer = document.querySelector('.custom-new-footer'); if (footer) { footer.style.direction = 'ltr'; footer.style.textAlign = 'left'; footer.innerHTML = englishFooterHTML; } } })(); (function() { // Target the navigation buttons container (usually on the right/end) const navButtonsContainer = document.querySelector('#mainnav .container .order-3'); if (navButtonsContainer) { // Create the wrapper for the language switcher const langWrapper = document.createElement('div'); langWrapper.className = 'language-switcher-nav flex items-center gap-2 ml-4 rtl:mr-4'; // Add styling for visibility and spacing langWrapper.style.cssText = ` border-left: 1px solid #eee; padding-left: 15px; margin-left: 15px; font-size: 13px; font-weight: 600; display: flex; align-items: center; `; // Inject the links langWrapper.innerHTML = ` EN | AR `; // Add it to the start of the button group navButtonsContainer.prepend(langWrapper); } })(); (function() { const targetText = "أحدث المنتجات"; const replacementText = "The Newest Products"; function replaceTextInNode(node) { if (node.nodeType === Node.TEXT_NODE) { if (node.textContent.includes(targetText)) { node.textContent = node.textContent.split(targetText).join(replacementText); } } else if (node.nodeType === Node.ELEMENT_NODE) { node.childNodes.forEach(replaceTextInNode); } } // Initial replace replaceTextInNode(document.body); // Watch for new content (Ajax/Lazy loading) new MutationObserver((mutations) => { mutations.forEach(mutation => mutation.addedNodes.forEach(replaceTextInNode)); }).observe(document.body, { childList: true, subtree: true }); })();