/*Code of all banners add class*/ document.addEventListener('DOMContentLoaded', function() { const sections = document.querySelectorAll('section'); for (let i = 0; i < sections.length; i++) { const section = sections[i]; const link = section.querySelector('a.banner.banner--fixed'); if (link) { section.classList.add('bannerWn'); } } }); /*Code of first banner add id firstSecHome & text html of about salon arabic */ document.addEventListener('DOMContentLoaded', function() { const header = document.querySelector('header.store-header'); if (header) { const nextSection = header.nextElementSibling; if (nextSection && nextSection.tagName.toLowerCase() === 'section') { // Add ID nextSection.id = 'firstSecHome'; // Detect language const lang = document.documentElement.lang || 'ar'; // ✅ Arabic section let customHTML = `

عن صالونا

صالون ديسمبر…
حيث يلتقي الجمال بالفخامة.

نقدّم لكِ تجربة متكاملة من العناية بالشعر، البشرة، والأظافر مع لمسة من الأناقة والاهتمام بالتفاصيل

تعرفي علينا عن قرب
`; // ✅ English version if (lang === 'en') { customHTML = `

About Our Salon

December Salon…
Where beauty meets luxury.

We offer you a complete experience of hair, skin, and nail care with a touch of elegance and attention to detail.

Discover More
`; } // Insert section after firstSecHome nextSection.insertAdjacentHTML('afterend', customHTML); } } }); /* change the src of the logo */ document.addEventListener('DOMContentLoaded', function() { const headerN = document.querySelector('header.store-header'); const newSrc = "https://cdn.salla.sa/form-builder/bS043XPVKk79r9ouBcynAs0FxfgFi1UwmlyOPG7P.png"; if (headerN) { const logoImg = headerN.querySelector('.prestige-logo img'); if (logoImg) { logoImg.src = newSrc; } } }); /*add class to div of description of services*/ document.addEventListener('DOMContentLoaded', function() { // Find all divs with class "relative" const divs = document.querySelectorAll('div.relative'); for (let i = 0; i < divs.length; i++) { const h3 = divs[i].querySelector('h3'); if (h3) { const text = h3.textContent.trim(); // Check both Arabic and English titles if (text === 'خدماتنا' || text === 'Our Services') { divs[i].classList.add('servicesSecD'); break; // Stop after first match (optional) } } } }); /*add class to section of products*/ document.addEventListener('DOMContentLoaded', function() { const faqSection = document.querySelector('section.prestige-faq'); if (faqSection) { const nextEl = faqSection.nextElementSibling; if (nextEl && nextEl.tagName.toLowerCase() === 'div' && nextEl.classList.contains('relative')) { nextEl.classList.add('prodSec'); } } }); /*add class to section have reviews*/ document.addEventListener('DOMContentLoaded', function() { const divs = document.querySelectorAll('div.relative'); for (let i = 0; i < divs.length; i++) { const h3 = divs[i].querySelector('h3'); if (h3) { const text = h3.textContent.trim(); // Match Arabic or English heading text if (text === 'وش يقولون عنّا' || text === 'What they say about us') { divs[i].classList.add('revDis'); break; // stop after first match (optional) } } } }); /*change the logo in footer*/ document.addEventListener('DOMContentLoaded', function() { const footer = document.querySelector('footer'); const newSrc = "https://cdn.salla.sa/form-builder/xSKKFwY69x7wCuphrlaBRN6T16rW0hfMifnnfUww.png"; if (footer) { const logoDiv = footer.querySelector('div.logo.w-32'); if (logoDiv) { const img = logoDiv.querySelector('img'); if (img) { img.src = newSrc; } } } }); /*change home 1st banner in english */ document.addEventListener('DOMContentLoaded', function() { // Check if is English and LTR const htmlTag = document.documentElement; if (htmlTag.lang === 'en' && htmlTag.dir === 'ltr') { const section = document.querySelector('section#firstSecHome'); const newSrc = "https://cdn.salla.sa/form-builder/MPh1fF4KpA3O9AgH0Yw8pJWms1zG9N4iIqWSkWaH.png"; if (section) { const img = section.querySelector('img'); if (img) { img.src = newSrc; img.setAttribute('data-src', newSrc); // if lazy loading used } } } }); /*change the banner src that after about in eng version*/ document.addEventListener('DOMContentLoaded', function() { if (document.documentElement.lang === 'en') { const oldSrc = "https://cdn.salla.sa/form-builder/4elkWrp6ohflMw2J0FqJEWgRR0C8vehOoDQqq3tM.png"; const newSrc = "https://cdn.salla.sa/form-builder/JXvTQH96TcMd4q3tX00jo4EysHp8Zrac3te0eOir.png"; // Check every 300ms until the image is available const checkImg = setInterval(() => { const img = document.querySelector(`section.s-block.s-block--fixed-banner.wide-placeholder.bannerWn img[src="${oldSrc}"]`); if (img) { img.src = newSrc; img.setAttribute('data-src', newSrc); clearInterval(checkImg); // stop checking } }, 300); } });