document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll("img:not(.lcp-image)").forEach(img=>{if(!img.hasAttribute("loading")){img.setAttribute("loading","lazy");img.setAttribute("decoding","async")}});const lcpImage=document.querySelector('.lcp-image');if(lcpImage){const preload=document.createElement("link");preload.rel="preload";preload.href=lcpImage.src;preload.as="image";document.head.appendChild(preload)} const fonts=["/fonts/harir-regular.woff2","/fonts/harir-bold.woff2","https://your-cdn/sallaicons.ttf"];fonts.forEach(font=>{const link=document.createElement("link");link.rel="preload";link.href=font;link.as="font";link.type="font/woff2";link.crossOrigin="anonymous";document.head.appendChild(link)});window.addEventListener("load",()=>{const thirdPartyScripts=["https://cdn.jsdelivr.net/npm/swiper/swiper-bundle.min.js"];thirdPartyScripts.forEach(src=>{const script=document.createElement("script");script.src=src;script.async=!0;document.body.appendChild(script)})});if("serviceWorker" in navigator){navigator.serviceWorker.register("/sw.js").then(()=>{console.log("Service Worker Registered")}).catch(error=>{console.error("Service Worker Registration Failed:",error)})} document.querySelectorAll("script[src]:not(.essential)").forEach(script=>{script.defer=!0});document.querySelectorAll("img").forEach(img=>{if(!img.hasAttribute("width")||!img.hasAttribute("height")){img.setAttribute("width",img.naturalWidth||300);img.setAttribute("height",img.naturalHeight||300)}});const preloadCSS=document.createElement("link");preloadCSS.rel="preload";preloadCSS.href="/styles/main.css";preloadCSS.as="style";preloadCSS.onload=function(){this.rel="stylesheet"};document.head.appendChild(preloadCSS)}) //footer (function() { function addFooterContent() { var footerContainer = document.querySelector(".copyright-text"); if (footerContainer && !footerContainer.querySelector(".extra-footer-content")) { var newContent = document.createElement("span"); newContent.classList.add("extra-footer-content"); newContent.innerHTML = ' Run by: ' + 'Skylight'; footerContainer.appendChild(newContent); } } addFooterContent(); })();