/* Add custom Js code below */ // Create the WhatsApp link container var whatsappFloat = document.createElement('div'); whatsappFloat.className = 'whatsapp-float'; // Create the WhatsApp link container var whatsappPopup = document.createElement('div'); whatsappPopup.className = 'whatsapp-popup'; whatsappPopup.style.display = 'none'; // Initially hidden // Create the popup content with avatar, text, and list of options var popupContent = `
`; whatsappPopup.innerHTML = popupContent; // Append the popup to the container whatsappFloat.appendChild(whatsappPopup); // Create the WhatsApp icon var whatsappIcon = document.createElement('img'); whatsappIcon.src = 'https://upload.wikimedia.org/wikipedia/commons/6/6b/WhatsApp.svg'; whatsappIcon.alt = 'WhatsApp'; whatsappIcon.className = 'whatsapp-icon'; // Append the icon to the container whatsappFloat.appendChild(whatsappIcon); // Append the WhatsApp button to the body document.body.appendChild(whatsappFloat); // Add CSS styles dynamically var style = document.createElement('style'); style.innerHTML = ` .whatsapp-float { position: fixed; bottom: 20px; left: 20px; z-index: 100; } .logo-container{ height: 50px; margin: auto; } .whatsapp-icon { width: 60px; height: 60px; border-radius: 50%; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); cursor: pointer; transition: transform 0.3s ease-in-out; } .whatsapp-icon:hover { transform: scale(1.1); } .whatsapp-popup { position: fixed; bottom: 90px; left: 20px; background: linear-gradient(var(--second-color), var(--main-color)); width: 300px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); padding: 15px; color: white; z-index: 101; border-radius: 10px; } .popup-header { display: flex ; justify-content: space-between; align-items: center; } .adfaz-container { display: flex ; padding-top: 6px; align-items: flex-end; justify-content: space-evenly; } .avatar-img { width: 40px; height: 40px; border-radius: 50%; margin-right: 10px; } .support-text { font-size: 16px; font-weight: bold; } .close-popup { background: none; border: none; font-size: 20px; cursor: pointer; } .popup-body { } .options-list { list-style-type: none; padding: 0; margin: 10px 0; } .options-list li { margin-bottom: 5px; } .whatsapp-button { display: block; width: 100%; text-align: center; background-color: #25d366; color: white; padding: 10px 15px; border-radius: 5px; text-decoration: none; margin-top: 15px; } .whatsapp-button:hover { background-color: #1ebe55; } .adfaz-container { display: flex; align-items: center; } .adfaz-link { display: flex; text-decoration: none; color: black; } .adfaz-img { width: 30px; height: 30px; margin-left: 3px; } .adfaz-text { font-size: 12px; color: white; } .support-text { font-size: 16px; font-weight: bold; } `; document.head.appendChild(style); // Toggle the popup when the icon is clicked whatsappIcon.addEventListener('click', function () { whatsappPopup.style.display = (whatsappPopup.style.display === 'none') ? 'block' : 'none'; }); // Close the popup when the close button is clicked document.querySelector('.close-popup').addEventListener('click', function () { whatsappPopup.style.display = 'none'; }); // Close the popup when the close button is clicked document.querySelector('.close-popup').addEventListener('click', function () { whatsappPopup.style.display = 'none'; }); document.querySelectorAll('a[href=""], a[href="#"]').forEach(link => { link.addEventListener('click', event => { event.preventDefault(); }); }); document.addEventListener("DOMContentLoaded", function() { const sections = document.querySelectorAll('section'); function checkVisibility() { sections.forEach(section => { const position = section.getBoundingClientRect(); if (position.top < window.innerHeight && position.bottom >= 0) { section.classList.add('visible'); } else { section.classList.remove('visible'); } }); } window.addEventListener("scroll", checkVisibility); checkVisibility(); // Check on load }) // Insert the banner swap (now called banSwiper) const banSwiperHTML = ` `; // Load FontAwesome for icons var fontAwesomeLink = document.createElement("link"); fontAwesomeLink.rel = "stylesheet"; fontAwesomeLink.href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css"; document.head.appendChild(fontAwesomeLink); // Google Tag Manager (unchanged) (function () { var script = document.createElement('script'); script.innerHTML = "(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-N36BWD87');"; document.head.appendChild(script); })(); // Google Tag Manager NoScript fallback (unchanged) (function () { var noscriptTag = document.createElement('noscript'); var iframeTag = document.createElement('iframe'); iframeTag.src = "https://www.googletagmanager.com/ns.html?id=GTM-N36BWD87"; iframeTag.height = "0"; iframeTag.width = "0"; iframeTag.style.display = "none"; iframeTag.style.visibility = "hidden"; noscriptTag.appendChild(iframeTag); document.body.appendChild(noscriptTag); })(); // Insert the banSwiper as the first element in the body document.body.insertAdjacentHTML('afterbegin', banSwiperHTML); // Create the loader div element const loaderDiv = document.createElement('div'); loaderDiv.id = 'loaderr'; loaderDiv.style.zIndex = '999'; // Create the 'everything' div const everythingDiv = document.createElement('div'); everythingDiv.className = 'everything'; // Create the 'loading-container' div const loadingContainerDiv = document.createElement('div'); loadingContainerDiv.className = 'loading-container'; // Create the SVG element for the cart icon const svgElement = ` `; // Create the loading text div // Create the 'loading-text' div and set the text content const loadingTextDiv = document.createElement('div'); // Append the SVG and loading text div to the loading container loadingContainerDiv.innerHTML = svgElement; // Append the loading container to the everything div everythingDiv.appendChild(loadingContainerDiv); // Append the everything div to the loader div loaderDiv.appendChild(everythingDiv); // Finally, append the loader div to the body document.body.appendChild(loaderDiv); y