forked from techaddict0x/presalewebsite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.min.js
1 lines (1 loc) · 9.28 KB
/
main.min.js
1
!function(){"use strict";const t=document.getElementsByClassName("tg");function e(t,e){t.classList.add("tb"),e.style.maxHeight=e.scrollHeight+"px"}function n(t,e){t.classList.remove("tb"),e.style.maxHeight=null}if(t.length>0)for(let i=0;i<t.length;i++){const s=t[i],a=s.parentNode,l=s.nextElementSibling;a.classList.contains("tb")&&e(a,l),s.addEventListener("click",(function(){a.classList.contains("tb")?n(a,l):e(a,l)}))}}(),function(){"use strict";let t={touchStartX:0,touchEndX:0,minSwipePixels:30,detectionZone:void 0,swipeCallback:function(){},init:function(e,n){t.swipeCallback=n,e.addEventListener("touchstart",(function(e){t.touchStartX=e.changedTouches[0].screenX}),!1),e.addEventListener("touchend",(function(e){t.touchEndX=e.changedTouches[0].screenX,t.handleSwipeGesture()}),!1)},handleSwipeGesture:function(){let e,n;t.touchEndX<=t.touchStartX&&(n=t.touchStartX-t.touchEndX,e="left"),t.touchEndX>=t.touchStartX&&(n=t.touchEndX-t.touchStartX,e="right"),n>t.minSwipePixels&&"undefined"!==e&&t.swipe(e,n)},swipe:function(e,n){let i={};i.direction=e,i.movedPixels=n,t.swipeCallback(i)}};const e=document.getElementsByClassName("carousel-items");function n(t,e){void 0===e&&(e="next");let n=t.getElementsByClassName("tz tb")[0],i="next"===e?n.nextElementSibling:n.previousElementSibling,s=n.getAttribute("data-carousel"),a=t.parentNode.getElementsByClassName("nt")[s],l="next"===e?a.nextElementSibling:a.previousElementSibling;n.classList.remove("tb"),a.classList.remove("tb"),i?(i.classList.add("tb"),l.classList.add("tb")):"next"===e?(t.firstElementChild.classList.add("tb"),t.parentNode.getElementsByClassName("ne")[0].firstElementChild.classList.add("tb")):(t.lastElementChild.classList.add("tb"),t.parentNode.getElementsByClassName("ne")[0].lastElementChild.classList.add("tb"))}function i(t,e){let n,i=0;for(let t=0;t<e.length;t++)e[0].parentNode.style.minHeight=i+"px",e[t].classList.add("w"),n=e[t].offsetHeight,e[t].classList.remove("w"),n>i&&(i=n);e[0].parentNode.style.minHeight=i+"px"}function s(t){t&&clearInterval(t)}if(e.length>0)for(let a=0;a<e.length;a++){let l=e[a],r=l.getElementsByClassName("tz"),o=0,c=l.getAttribute("data-autorotate");const d=document.createElement("div");d.className="ne",l.parentNode.insertBefore(d,l.nextSibling);for(let t=0;t<r.length;t++){r[t].setAttribute("data-carousel",t),r[t].classList.contains("tb")&&(o=t);let e=document.createElement("tbuttonn");e.className="nt",e.setAttribute("data-bullet",t),l.parentNode.getElementsByClassName("ne")[0].appendChild(e)}r[o].classList.add("tb");let u=l.parentNode.getElementsByClassName("nt");u[o].classList.add("tb"),i(0,r),window.addEventListener("resize",(function(){i(0,r)}));let m=!1;c&&(m=setInterval((function(){n(l,"next")}),c));for(let t=0;t<u.length;t++){let e=u[t];e.addEventListener("click",(function(t){if(t.preventDefault(),e.classList.contains("tb"))return;for(let t=0;t<u.length;t++)u[t].classList.remove("tb");for(let t=0;t<r.length;t++)r[t].classList.remove("tb");let n=this.getAttribute("data-bullet");r[n].classList.add("tb"),this.classList.add("tb"),s(m)}))}t.init(l,(function(t){"left"===t.direction?n(l,"next"):"right"===t.direction&&n(l,"prev"),s(m)}))}}(),function(){"use strict";document.documentElement.classList.remove("no-js"),document.documentElement.classList.add("js"),window.addEventListener("load",(function(){document.body.classList.add("n")}))}(),function(){"use strict";const t=document.getElementById("th"),e=document.getElementById("nj");t&&(t.addEventListener("click",(function(){document.body.classList.toggle("tv"),e.classList.toggle("tb"),e.style.maxHeight?e.style.maxHeight=null:e.style.maxHeight=e.scrollHeight+"px","true"===this.getAttribute("aria-expanded")?this.setAttribute("aria-expanded","false"):this.setAttribute("aria-expanded","true")})),document.addEventListener("click",(function(n){n.target===e||n.target===t||e.contains(n.target)||(document.body.classList.remove("tv"),e.classList.remove("tb"),e.style.maxHeight=null,t.setAttribute("aria-expanded","false"))})))}(),function(){"use strict";const t=document.getElementsByClassName("tx"),e=document.getElementsByClassName("modal-trigger");function n(){document.body.classList.remove("modal-is-active");for(let e=0;e<t.length;e++)t[e].classList.remove("tb")}if(t.length>0&&e.length>0)for(let t=0;t<e.length;t++){let n=e[t],i=document.getElementById(n.getAttribute("aria-controls"));i&&(n.hasAttribute("data-video")&&(null!==i.querySelector("iframe")?i.querySelector("iframe").setAttribute("src",n.getAttribute("data-video")):null!==i.querySelector("video")&&i.querySelector("video").setAttribute("src",n.getAttribute("data-video"))),n.addEventListener("click",(function(t){var e;t.preventDefault(),n.hasAttribute("aria-controls")&&(e=i)&&(document.body.classList.add("modal-is-active"),e.classList.add("tb"))})))}document.addEventListener("click",(function(t){(t.target.classList.contains("tx")||t.target.classList.contains("modal-close-trigger"))&&(t.preventDefault(),n())})),document.addEventListener("keydown",(function(t){27===(t||window.event).keyCode&&n()}))}(),function(){"use strict";const t=document.querySelectorAll(".ie");if(t.length>0)for(let n=0;n<t.length;n++){const i=t[n],s={el:i.querySelector("input")};s.data=JSON.parse(s.el.getAttribute("data-price-input")),s.currentValEl=i.querySelector(".it"),s.thumbSize=parseInt(window.getComputedStyle(s.currentValEl).getPropertyValue("--thumb-size"),10);const a=i.parentNode.querySelectorAll(".pricing-item-price"),l=[];for(let t=0;t<a.length;t++){const e=a[t],n={};n.currency=e.parentNode.querySelector(".iw"),n.amount=e.parentNode.querySelector(".pricing-item-price-amount"),n.after=e.parentNode.querySelector(".pricing-item-price-after"),n.data=JSON.parse(e.getAttribute("data-price-output")),l.push(n)}s.el.setAttribute("min",0),s.el.setAttribute("max",Object.keys(s.data).length-1),!s.el.getAttribute("value")&&s.el.setAttribute("value",0),e(s,l),window.addEventListener("input",(function(){e(s,l)}))}function e(t,e){t.currentValEl&&(t.currentValEl.innerHTML=t.data[t.el.value]);for(let n=0;n<e.length;n++){const i=e[n];i.currency&&(i.currency.innerHTML=i.data[t.el.value][0]),i.amount&&(i.amount.innerHTML=i.data[t.el.value][1]),i.after&&(i.after.innerHTML=i.data[t.el.value][2])}!function(t){const e=t.el.value/t.el.max,n=t.thumbSize*e,i=(t.thumbSize-t.currentValEl.clientWidth)/2;t.currentValEl.style.left=t.el.clientWidth*e-n+i+"px"}(t)}}(),function(){"use strict";const t=document.querySelectorAll(".rz");if(t.length>0)for(let n=0;n<t.length;n++){const i=t[n],s=i.querySelector("input"),a=i.parentNode.querySelectorAll(".pricing-item-price"),l=[];for(let t=0;t<a.length;t++){const e=a[t],n={};n.currency=e.parentNode.querySelector(".iw"),n.amount=e.parentNode.querySelector(".pricing-item-price-amount"),n.after=e.parentNode.querySelector(".pricing-item-price-after"),n.data=JSON.parse(e.getAttribute("data-price-output")),l.push(n)}e(s,l),window.addEventListener("change",(function(){e(s,l)}))}function e(t,e){for(let n=0;n<e.length;n++){const i=e[n],s=t.checked?1:0;i.currency&&(i.currency.innerHTML=i.data[s][0]),i.amount&&(i.amount.innerHTML=i.data[s][1]),i.after&&(i.after.innerHTML=i.data[s][2])}}}(),function(){"use strict";const t=document.querySelectorAll("[class*=reveal-]");let e=window.innerHeight;function n(t,e){var n=0;return function(){var i=(new Date).getTime();if(!(i-n<t))return n=i,e.apply(void 0,arguments)}}function i(){for(let i=0;i<t.length;i++){let s=t[i],a=s.getAttribute("data-reveal-delay");n=s.getAttribute("data-reveal-offset")?s.getAttribute("data-reveal-offset"):"200",(s.getAttribute("data-reveal-container")?s.closest(s.getAttribute("data-reveal-container")):s).getBoundingClientRect().top<=e-n&&!s.classList.contains("is-revealed")&&(a&&0!==a?setTimeout((function(){s.classList.add("is-revealed")}),a):s.classList.add("is-revealed"))}var n;t.length>document.querySelectorAll("[class*=reveal-].is-revealed").length||(window.removeEventListener("load",i),window.removeEventListener("scroll",s),window.removeEventListener("resize",a))}function s(){n(30,i())}function a(){e=window.innerHeight,n(30,i())}t.length>0&&document.body.classList.contains("t")&&(window.addEventListener("load",i),window.addEventListener("scroll",s),window.addEventListener("resize",a))}(),function(){"use strict";const t=document.getElementsByClassName("smooth-scroll"),e=(t,n,i,s,a)=>{const l=n-t;let r=l/i;const o=function(t){return t<.5?2*t*t:(4-2*t)*t-1}(r=Math.min(r,1));window.scroll(0,a+s*o),l<i&&window.requestAnimationFrame((n=>{const l=n||(new Date).getTime();e(t,l,i,s,a)}))};if(t.length>0)for(let n=0;n<t.length;n++)t[n].addEventListener("click",(function(t){t.preventDefault();const n=t.target.closest(".smooth-scroll"),i=n.href.split("#")[1],s=document.getElementById(i),a=n.getAttribute("data-duration")||1e3;s&&window.requestAnimationFrame((t=>{const n=t||(new Date).getTime(),i=n,l=window.pageYOffset,r=s.getBoundingClientRect().top;e(i,n,a,r,l)}))}))}(),function(){"use strict";const t=document.getElementsByClassName("nr");function e(t){let e=t.getAttribute("aria-controls");document.getElementById(e).classList.add("tb"),t.classList.add("tb")}if(t.length>0)for(let n=0;n<t.length;n++){let i=t[n];i.addEventListener("click",(function(n){n.preventDefault();const i=this.closest(".tabs").getElementsByClassName("ni");if(!this.classList.contains("tb")){for(let e=0;e<t.length;e++)t[e].classList.remove("tb");for(let t=0;t<i.length;t++)i[t].classList.remove("tb");e(this)}})),i.classList.contains("tb")&&e(i)}}();