/* Add custom Js code below */ // الأسئلة الشائعة الصفحة الفرعية const showFAQsPage = () => { if (window.location.pathname.includes('XzDOw')) { var cont = document.querySelector("article"); var output = "" var content = "" var flag = false var flagcount = 0 for (let i = 0; i < cont.children.length; i++) { if (cont.children[i].innerHTML.includes("strong")) { if (flagcount > 0) { if (flag === true) { output = output + `
${content}
` content = "" } } output = output + `` flagcount++ } else { if (cont.children[i].innerHTML.includes("br") || cont.children[i].innerHTML.includes("h1")) { continue; } else { if (flagcount === 0) { continue } content = content + `

${cont.children[i].innerHTML}

` flag = true } } } document.querySelector("article").innerHTML = output } } const myfunc = () => { const accordionBtns = document.querySelectorAll(".accordion"); if (accordionBtns) { accordionBtns.forEach((accordion) => { if (accordion) { accordion.onclick = function () { // accordion.addEventListener('click', function () { this.classList.toggle("is-open"); let content = this.nextElementSibling; if (content.style.maxHeight) { content.style.maxHeight = null; } else { content.style.maxHeight = content.scrollHeight + "px"; } // }) } } }) } } const interval = setInterval(() => { myfunc() }, 2000); /* #### #### عن المتجر ###### ###### */ const showOurStory = () => { const storyDiv = document.createElement("div"); storyDiv.classList.add('story-div') storyDiv.classList.add('container') const details = document.createElement("div"); details.innerHTML = `

دخون منارة

استمتع برحلة استثنائية واكتشف جمال العود بأسلوب مبتكر وروائح فريدة، انت هنا لتجربة عطرية فريدة بين العود ممزوجة بروائح عصرية نختارها بعناية بعد مئات التجارب، وكن على استعداد لتجربة سحرية تأسر الحواس وتأخذك في رحلة عطرية لا مثيل لها

تعرف علينا ` storyDiv.appendChild(details); const storeCenter = document.querySelector('.s-block:last-of-type') if (storeCenter) { storeCenter.after(storyDiv) } } /* #### #### عن المتجر ###### ###### */ const updateProductsTitle = () => { const first = document.querySelector('.s-block:nth-of-type(2) div h2') if (first) { const p = document.createElement("p"); p.innerText = `` first.appendChild(p) } const second = document.querySelector('.s-block:nth-of-type(3) .s-block__title h2') if (second) { const p = document.createElement("p"); p.innerText = `` second.appendChild(p) } const third = document.querySelector('.s-block:nth-of-type(6) .s-block__title h2') if (third) { const p = document.createElement("p"); p.innerText = `` third.appendChild(p) } } window.addEventListener('load', () => { showOurStory(); updateProductsTitle(); showFAQsPage(); }) /* #### #### الهيدر الخاص ###### ###### */ const newHeader = () => { const nav = document.createElement("div"); nav.classList.add('nav-div') const details = document.createElement("div"); const lang = document.querySelector('html').lang details.innerHTML = ` ` nav.appendChild(details); const header = document.querySelector('.store-header .header-components .container') if (header) { header.appendChild(nav) } const navShop = document.querySelector('.nav-shop') const menuBtn = document.querySelector('.mburger.mburger--collapse') if (navShop) { navShop.onclick = function (e) { menuBtn.click() } } // اللغة const localBtn = document.querySelector('.header-components .header-btn.btn--gray.rounded') if (localBtn) { localBtn.innerHTML = ` ` } // جعل الهيدر الجديد بجنب الشعار const navbarBrand = document.querySelector('.header-components .navbar-brand') if (navbarBrand) { const nav2 = nav.cloneNode(true) navbarBrand.after(nav2) } const navShop2 = document.querySelector('.header-components-inner .nav-shop') if (navShop2) { navShop2.onclick = function (e) { menuBtn.click() } } // نقل زر اللغة لجنب السلة const leftSideHeader = document.querySelector('.header-components .left-side') const langbtn = document.querySelector('.header-components .header-btn') if (leftSideHeader) { leftSideHeader.appendChild(langbtn) } } const changeSliderLink = () => { const sliderLink = document.querySelector('.s-block--slider-with-bg a.s-slider-block__display-all') sliderLink ? sliderLink.href = `https://manaraoud.com/latest-products` : '' } window.addEventListener('load', () => { newHeader(); setTimeout(() => { changeSliderLink() }, 3000); }) /* #### #### إظهار وصف مختصر تحت عنوان المنتج ###### ###### */ const takeDesunderProductTitle = () => { const p1 = document.querySelector('.product-single .product__description p:nth-of-type(1)') const p2 = document.querySelector('.product-single .product__description p:nth-of-type(2)') const title = document.querySelector('.product-single h1') if (title) { p1.classList.add('short-desc') p2.classList.add('short-desc') title.after(p2) title.after(p1) } } window.addEventListener('load', () => { takeDesunderProductTitle() }) const CreateHomeVideo = () => { const videoMobile = document.createElement('div') videoMobile.classList.add('home-video', 'video-mobile') videoMobile.innerHTML = ` ` const videoDesktop = document.createElement('div') videoDesktop.classList.add('home-video', 'video-desktop') videoDesktop.innerHTML = ` ` const section = document.querySelector('.index section:first-of-type'); if (section) { section.before(videoDesktop); section.before(videoMobile); } } window.addEventListener('load', () => { CreateHomeVideo() })/* Add custom Js code below */