✏️ 正在编辑: script.min.js
路径:
/var/www/koruspay.com.br/assets/js/script.min.js
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
const navToggle=document.getElementById("nav-toggle"),navMenu=document.getElementById("nav-menu"),navClose=document.getElementById("nav-close"),navLinks=document.querySelectorAll(".nav__link");navToggle&&navToggle.addEventListener("click",(()=>{navMenu.classList.add("show")})),navClose&&navClose.addEventListener("click",(()=>{navMenu.classList.remove("show")})),navLinks.forEach((e=>{e.addEventListener("click",(()=>{navMenu.classList.remove("show")}))}));const header=document.querySelector(".header");window.addEventListener("scroll",(()=>{window.scrollY>=50?(header.style.background="#1a1a4a",header.style.boxShadow="0 2px 20px rgba(0, 0, 0, 0.1)"):(header.style.background="#1a1a4a",header.style.boxShadow="none")})),document.querySelectorAll('a[href^="#"]').forEach((e=>{e.addEventListener("click",(function(e){e.preventDefault();const t=document.querySelector(this.getAttribute("href"));if(t){const e=header.offsetHeight,n=t.offsetTop-e;window.scrollTo({top:n,behavior:"smooth"})}}))}));const faqItems=document.querySelectorAll(".faq__item");faqItems.forEach((e=>{e.querySelector(".faq__question").addEventListener("click",(()=>{const t=e.classList.contains("active");faqItems.forEach((e=>{e.classList.remove("active")})),t||e.classList.add("active")}))}));const contactForm=document.querySelector(".contact__form");function isValidEmail(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function showNotification(e,t="info"){document.querySelectorAll(".notification").forEach((e=>e.remove()));const n=document.createElement("div");n.className=`notification notification--${t}`,n.innerHTML=`\n <div class="notification__content">\n <i class="fas ${getNotificationIcon(t)}"></i>\n <span>${e}</span>\n <button class="notification__close">\n <i class="fas fa-times"></i>\n </button>\n </div>\n `,n.style.cssText=`\n position: fixed;\n top: 100px;\n right: 20px;\n background: ${getNotificationColor(t)};\n color: white;\n padding: 1rem 1.5rem;\n border-radius: 0.75rem;\n box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);\n z-index: 10000;\n transform: translateX(400px);\n transition: transform 0.3s ease-in-out;\n max-width: 400px;\n `,n.querySelector(".notification__content").style.cssText="\n display: flex;\n align-items: center;\n gap: 0.75rem;\n ",n.querySelector(".notification__close").style.cssText="\n background: none;\n border: none;\n color: white;\n cursor: pointer;\n padding: 0;\n margin-left: auto;\n ",document.body.appendChild(n),setTimeout((()=>{n.style.transform="translateX(0)"}),100),setTimeout((()=>{removeNotification(n)}),5e3),n.querySelector(".notification__close").addEventListener("click",(()=>{removeNotification(n)}))}function removeNotification(e){e.style.transform="translateX(400px)",setTimeout((()=>{e.parentNode&&e.parentNode.removeChild(e)}),300)}function getNotificationIcon(e){switch(e){case"success":return"fa-check-circle";case"error":return"fa-exclamation-circle";case"warning":return"fa-exclamation-triangle";default:return"fa-info-circle"}}function getNotificationColor(e){switch(e){case"success":return"#28a745";case"error":return"#dc3545";case"warning":return"#ffc107";default:return"#17a2b8"}}contactForm&&contactForm.addEventListener("submit",(function(e){e.preventDefault();const t=new FormData(this),n=Object.fromEntries(t);if(!(n.name&&n.email&&n.company&&n.phone))return void showNotification("Por favor, preencha todos os campos obrigatórios.","error");if(!isValidEmail(n.email))return void showNotification("Por favor, insira um email válido.","error");const o=this.querySelector('button[type="submit"]'),r=o.innerHTML;o.innerHTML='<i class="fas fa-spinner fa-spin"></i> Enviando...',o.disabled=!0,result=callBackendExecution("src/contact_send.php","contact_form").then((e=>{1==e?showNotification("Mensagem enviada com sucesso! Entraremos em contato em breve.","success"):showNotification(e,"error")})).catch((e=>{showNotification(e,"error")})),setTimeout((()=>{this.reset(),o.innerHTML=r,o.disabled=!1}),2e3)}));const observerOptions={threshold:.1,rootMargin:"0px 0px -50px 0px"},observer=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&(e.target.style.opacity="1",e.target.style.transform="translateY(0)")}))}),observerOptions);function animateCounter(e,t,n=2e3){let o=0;const r=t/(n/16),a=setInterval((()=>{o+=r,o>=t?(e.textContent=formatNumber(t),clearInterval(a)):e.textContent=formatNumber(Math.floor(o))}),16)}function formatNumber(e){return e>=1e9?(e/1e9).toFixed(1)+"B":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e.toString()}document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".solution__card, .benefit__item, .stat__item, .pricing__card").forEach((e=>{e.style.opacity="0",e.style.transform="translateY(30px)",e.style.transition="opacity 0.6s ease-out, transform 0.6s ease-out",observer.observe(e)}))}));const statsSection=document.querySelector(".stats");let statsAnimated=!1;if(statsSection){new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting&&!statsAnimated){statsAnimated=!0;[{element:document.querySelector(".stat__item:nth-child(1) .stat__number"),target:1e4},{element:document.querySelector(".stat__item:nth-child(2) .stat__number"),target:2e9},{element:document.querySelector(".stat__item:nth-child(3) .stat__number"),target:99.9},{element:document.querySelector(".stat__item:nth-child(4) .stat__number"),target:24}].forEach(((e,t)=>{e.element&&setTimeout((()=>{if(2===t){let t=0;const n=setInterval((()=>{t+=.1,t>=99.9?(e.element.textContent="99.9%",clearInterval(n)):e.element.textContent=t.toFixed(1)+"%"}),20)}else 3===t?e.element.textContent="24/7":animateCounter(e.element,e.target)}),200*t)}))}}))}),{threshold:.5}).observe(statsSection)}function debounce(e,t){let n;return function(...o){clearTimeout(n),n=setTimeout((()=>{clearTimeout(n),e(...o)}),t)}}document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".hero__floating-card").forEach(((e,t)=>{e.addEventListener("mouseenter",(()=>{e.style.transform="translateY(-15px) scale(1.05)",e.style.boxShadow="0 20px 40px rgba(0, 0, 0, 0.2)"})),e.addEventListener("mouseleave",(()=>{e.style.transform="translateY(0) scale(1)",e.style.boxShadow="0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"}))}))})),document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".pricing__card").forEach((e=>{e.addEventListener("mouseenter",(()=>{e.classList.contains("pricing__card--featured")||(e.style.borderColor="var(--secondary-color)")})),e.addEventListener("mouseleave",(()=>{e.classList.contains("pricing__card--featured")||(e.style.borderColor="var(--gray-200)")}))}))})),document.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelectorAll("img[data-src]"),t=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const n=e.target;n.src=n.dataset.src,n.classList.remove("lazy"),t.unobserve(n)}}))}));e.forEach((e=>t.observe(e)))}));const optimizedScrollHandler=debounce((()=>{window.scrollY>=50?(header.style.background="#1a1a4a",header.style.boxShadow="0 2px 20px rgba(0, 0, 0, 0.1)"):(header.style.background="#1a1a4a",header.style.boxShadow="none")}),10);function callBackendExecution(e,t){return new Promise(((n,o)=>{var r=new XMLHttpRequest;r.onreadystatechange=function(){4==this.readyState&&200==this.status&&n(this.responseText)},myForm=document.getElementById(t),serializedForm=serializeForm(myForm),r.open("POST",e,!0),r.onerror=function(){o(new Error("Network error or request failed"))},r.setRequestHeader("Content-type","application/x-www-form-urlencoded"),r.send(serializedForm)}))}function serializeForm(e){const t=new FormData(e),n={};for(const[e,o]of t.entries())n.hasOwnProperty(e)?(Array.isArray(n[e])||(n[e]=[n[e]]),n[e].push(o)):n[e]=o;return Object.keys(n).map((e=>encodeURIComponent(e)+"="+encodeURIComponent(n[e]))).join("&")}window.removeEventListener("scroll",(()=>{})),window.addEventListener("scroll",optimizedScrollHandler),document.addEventListener("DOMContentLoaded",(()=>{faqItems.forEach((e=>{const t=e.querySelector(".faq__question");t.setAttribute("tabindex","0"),t.setAttribute("role","button"),t.setAttribute("aria-expanded","false"),t.addEventListener("keydown",(e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.click())}))}));faqItems[0]?.querySelector(".faq__question")?.onclick;faqItems.forEach((e=>{const t=e.querySelector(".faq__question");t.addEventListener("click",(()=>{const n=e.classList.contains("active");t.setAttribute("aria-expanded",n?"true":"false")}))}))}));
💾 保存文件
← 返回文件管理器