) { //Below Code to inject HTML in Products page // Function to inject the swiper HTML after a specific element if the path is /latest-products function injectSwiperIfPathMatches() { // Check if the current path is /latest-products if (window.location.pathname == '/latest-products') { // Define the new swiper HTML const newSwiperHTML = `
`; // Locate the element with the class "container min-h-[32px]" const targetElement = document.querySelector('.container'); if (targetElement) { // Create a container element for the new HTML const newSwiperElement = document.createElement('div'); newSwiperElement.innerHTML = newSwiperHTML; // Insert the new element after the target element targetElement.insertAdjacentHTML('afterend', newSwiperElement.innerHTML); } else { console.error('Target element not found.'); } } } // Call the function to inject the swiper injectSwiperIfPathMatches(); try { /* Add custom Js code below */ document.body.style.backgroundColor = "#e8e8e8"; document.querySelector('.s-block.s-block--faqs.s-block--anime.s-block--full-bg').style.backgroundColor = "#e8e8e8"; /*for overlay over categories */ document.addEventListener("DOMContentLoaded", function() { // Select all swiper-slide elements except the first one and third one const slides = document.querySelectorAll('.swiper-slide:not(:first-child):not(:nth-child(2)):not(:nth-child(3)):not(:nth-child(4)) a'); slides.forEach((slide) => { // Prevent the tag from being clickable slide.addEventListener('click', function(event) { event.preventDefault(); }); // Create the overlay div and append it to the tag const overlay = document.createElement('div'); overlay.className = 'overlay'; overlay.innerText = 'قريبا'; slide.appendChild(overlay); }); }); } catch(e) { console.log(e); } }); /* Add custom Js code below */