diff --git a/assets/js/main.js b/assets/js/main.js index 9883092..550e914 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -258,7 +258,7 @@ function updateStatusRealtime() { } updateStatusRealtime(); -setInterval(updateStatusRealtime, 10000); +setInterval(updateStatusRealtime, 15000); diff --git a/assets/js/main.min.js b/assets/js/main.min.js index 848610b..e6b6737 100644 --- a/assets/js/main.min.js +++ b/assets/js/main.min.js @@ -1 +1 @@ -const menuButton=document.querySelector(".menu-toggle"),navigation=document.querySelector("nav.nav-primary");menuButton.addEventListener("click",(function(){navigation.classList.toggle("show"),menuButton.classList.toggle("activated"),"true"===menuButton.getAttribute("aria-expanded")?menuButton.setAttribute("aria-expanded","false"):menuButton.setAttribute("aria-expanded","true"),"true"===menuButton.getAttribute("aria-pressed")?menuButton.setAttribute("aria-pressed","false"):menuButton.setAttribute("aria-pressed","true")}));const menuLinks=document.querySelectorAll(".primary-menu .menu-item a, a.top-link, .site-title a");menuLinks.forEach((e=>{e.addEventListener("click",(function(){navigation.classList.remove("show"),menuButton.classList.remove("activated"),menuButton.setAttribute("aria-expanded","false"),menuButton.setAttribute("aria-pressed","false")}))})),window.addEventListener("scroll",(()=>{window.scrollY>=100?document.querySelector("body").classList.add("dark"):document.querySelector("body").classList.remove("dark")}));let menuSection=document.querySelectorAll(".nav-primary li.menu-item a");menuSection.forEach((e=>{e.onclick=()=>{setTimeout((()=>{menuSection.forEach((e=>e.classList.remove("active"))),e.classList.add("active")}),300)}})),window.onscroll=()=>{document.querySelectorAll("main.entry-content section.section").forEach(((e,t)=>{e.getBoundingClientRect().ye.classList.remove("active"))),menuSection[t].classList.add("active"))}))};const form=document.getElementById("homepage-contact-form");function countWhenVisible(e,t,n){let o=!1,a=null;new IntersectionObserver((r=>{if(r[0].isIntersecting&&!o){o=!0,a=performance.now();let r=0,i=n,u=setInterval((()=>{let n=(performance.now()-a)/i;n>=1?(clearInterval(u),e.innerHTML=t):(r=Math.floor(n*t),e.innerHTML=r)}),20)}})).observe(e)}function checkStoreStatus(){const e="America/New_York",t=new Date,n=new Date(t.toLocaleString("en-US",{timeZone:e})),o=n.toLocaleString("en-US",{timeZone:e,weekday:"long"}),a=n.getHours();return"Sunday"===o&&a>=9&&a<17||"Sunday"!==o&&a>=8&&a<19?'Open come on down':'Closed see you in the morning'}function detectDayToday(){const e=new Date,t={weekday:"long"},n=(new Intl.DateTimeFormat("en-US",t).format(e),"America/New_York"),o=e.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,timeZone:n}),a=new Date(e.toLocaleString("en-US",{timeZone:n}));return`${new Intl.DateTimeFormat("en-US",t).format(a)} ${o}`}function updateStatusRealtime(){document.getElementById("storestatus").innerHTML=`${detectDayToday()}, We Are ${checkStoreStatus()}`}form.addEventListener("submit",(function(e){const t=document.getElementById("contact-form-name"),n=document.getElementById("contact-form-email"),o=document.getElementById("contact-form-message");let a=!0;""===t.value?(a=!1,t.setCustomValidity("Please enter your name.")):t.setCustomValidity(""),""===n.value?(a=!1,n.setCustomValidity("Please enter your email address.")):n.checkValidity()?n.setCustomValidity(""):(a=!1,n.setCustomValidity("Please enter a valid email address.")),""===o.value?(a=!1,o.setCustomValidity("Please enter a message.")):o.setCustomValidity(""),a||e.preventDefault()})),form.addEventListener("submit",(function(e){const t=document.getElementById("contact-form-name"),n=document.getElementById("contact-form-email"),o=document.getElementById("contact-form-number"),a=document.getElementById("contact-form-vehicle"),r=document.getElementById("contact-form-message"),i=(document.querySelector("button.form-submit-button"),`[Contact-Form] ${t.value}`),u=`${r.value}\n\n${t.value}\n${o.value}\n${a.value}\n${n.value}`,c=`mailto:${encodeURIComponent("carclubtire@gmail.com")}?subject=${encodeURIComponent(i)}&body=${encodeURIComponent(u)}`;window.open(c),e.preventDefault()})),document.getElementById("year").innerHTML=(new Date).getFullYear(),countWhenVisible(document.querySelector(".business-counter .counter-number"),5,1e3),countWhenVisible(document.querySelector(".tires-counter .counter-number"),640,1e3),countWhenVisible(document.querySelector(".wheels-counter .counter-number"),2200,2e3),countWhenVisible(document.querySelector(".oil-counter .counter-number"),5e3,3e3),updateStatusRealtime(),setInterval(updateStatusRealtime,1e4);const preloader=document.getElementById("loader-wrapper");window.onload=setTimeout((function(){preloader&&(preloader.hidden=!0),preloader&&(preloader.style.display="none")}),2e3),window.onload=function(){preloader.classList.add("hide-preloader")}; \ No newline at end of file +const menuButton=document.querySelector(".menu-toggle"),navigation=document.querySelector("nav.nav-primary");menuButton.addEventListener("click",(function(){navigation.classList.toggle("show"),menuButton.classList.toggle("activated"),"true"===menuButton.getAttribute("aria-expanded")?menuButton.setAttribute("aria-expanded","false"):menuButton.setAttribute("aria-expanded","true"),"true"===menuButton.getAttribute("aria-pressed")?menuButton.setAttribute("aria-pressed","false"):menuButton.setAttribute("aria-pressed","true")}));const menuLinks=document.querySelectorAll(".primary-menu .menu-item a, a.top-link, .site-title a");menuLinks.forEach((e=>{e.addEventListener("click",(function(){navigation.classList.remove("show"),menuButton.classList.remove("activated"),menuButton.setAttribute("aria-expanded","false"),menuButton.setAttribute("aria-pressed","false")}))})),window.addEventListener("scroll",(()=>{window.scrollY>=100?document.querySelector("body").classList.add("dark"):document.querySelector("body").classList.remove("dark")}));let menuSection=document.querySelectorAll(".nav-primary li.menu-item a");menuSection.forEach((e=>{e.onclick=()=>{setTimeout((()=>{menuSection.forEach((e=>e.classList.remove("active"))),e.classList.add("active")}),300)}})),window.onscroll=()=>{document.querySelectorAll("main.entry-content section.section").forEach(((e,t)=>{e.getBoundingClientRect().ye.classList.remove("active"))),menuSection[t].classList.add("active"))}))};const form=document.getElementById("homepage-contact-form");function countWhenVisible(e,t,n){let o=!1,a=null;new IntersectionObserver((r=>{if(r[0].isIntersecting&&!o){o=!0,a=performance.now();let r=0,i=n,u=setInterval((()=>{let n=(performance.now()-a)/i;n>=1?(clearInterval(u),e.innerHTML=t):(r=Math.floor(n*t),e.innerHTML=r)}),20)}})).observe(e)}function checkStoreStatus(){const e="America/New_York",t=new Date,n=new Date(t.toLocaleString("en-US",{timeZone:e})),o=n.toLocaleString("en-US",{timeZone:e,weekday:"long"}),a=n.getHours();return"Sunday"===o&&a>=9&&a<17||"Sunday"!==o&&a>=8&&a<19?'Open come on down':'Closed see you in the morning'}function detectDayToday(){const e=new Date,t={weekday:"long"},n=(new Intl.DateTimeFormat("en-US",t).format(e),"America/New_York"),o=e.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,timeZone:n}),a=new Date(e.toLocaleString("en-US",{timeZone:n}));return`${new Intl.DateTimeFormat("en-US",t).format(a)} ${o}`}function updateStatusRealtime(){document.getElementById("storestatus").innerHTML=`${detectDayToday()}, We Are ${checkStoreStatus()}`}form.addEventListener("submit",(function(e){const t=document.getElementById("contact-form-name"),n=document.getElementById("contact-form-email"),o=document.getElementById("contact-form-message");let a=!0;""===t.value?(a=!1,t.setCustomValidity("Please enter your name.")):t.setCustomValidity(""),""===n.value?(a=!1,n.setCustomValidity("Please enter your email address.")):n.checkValidity()?n.setCustomValidity(""):(a=!1,n.setCustomValidity("Please enter a valid email address.")),""===o.value?(a=!1,o.setCustomValidity("Please enter a message.")):o.setCustomValidity(""),a||e.preventDefault()})),form.addEventListener("submit",(function(e){const t=document.getElementById("contact-form-name"),n=document.getElementById("contact-form-email"),o=document.getElementById("contact-form-number"),a=document.getElementById("contact-form-vehicle"),r=document.getElementById("contact-form-message"),i=(document.querySelector("button.form-submit-button"),`[Contact-Form] ${t.value}`),u=`${r.value}\n\n${t.value}\n${o.value}\n${a.value}\n${n.value}`,c=`mailto:${encodeURIComponent("carclubtire@gmail.com")}?subject=${encodeURIComponent(i)}&body=${encodeURIComponent(u)}`;window.open(c),e.preventDefault()})),document.getElementById("year").innerHTML=(new Date).getFullYear(),countWhenVisible(document.querySelector(".business-counter .counter-number"),5,1e3),countWhenVisible(document.querySelector(".tires-counter .counter-number"),640,1e3),countWhenVisible(document.querySelector(".wheels-counter .counter-number"),2200,2e3),countWhenVisible(document.querySelector(".oil-counter .counter-number"),5e3,3e3),updateStatusRealtime(),setInterval(updateStatusRealtime,15e3);const preloader=document.getElementById("loader-wrapper");window.onload=setTimeout((function(){preloader&&(preloader.hidden=!0),preloader&&(preloader.style.display="none")}),2e3),window.onload=function(){preloader.classList.add("hide-preloader")}; \ No newline at end of file diff --git a/index.html b/index.html index cde3db7..479b7e6 100644 --- a/index.html +++ b/index.html @@ -22,8 +22,8 @@ - - + + @@ -418,7 +418,7 @@

Contact Us

- +