관리-도구
편집 파일: main.min.js
"use strict";var html=document.documentElement,body=document.querySelector("body");let start=$("#start-quiz").val();const loader=document.querySelector(".pre-loader-wrapper");window.addEventListener("load",function(){loader?.classList.add(...["opacity-0","duration-500"]),setTimeout(()=>{loader?.remove()},200)}),window.addEventListener("scroll",function(){let t=document.querySelector(".sticky-header");t&&(window.scrollY>window.innerHeight?t.classList.add(...["sticky","inset-0","shadow-md","z-[98]"]):t.classList.remove(...["sticky","inset-0","shadow-md","z-[98]"]))});const mob=document.querySelectorAll("[data-offcanvas-id]");mob.forEach(function(t){let e=t.getAttribute("data-offcanvas-id"),l=document.querySelector(`#${e}`),r=document.querySelector(`.${e}-inner`),i=l.querySelector(`.${e}-close`);t.addEventListener("click",()=>{l.classList.contains(...["invisible","opacity-0"])&&l.classList.remove(...["invisible","opacity-0"]),r.classList.contains(...["translate-x-full","rtl:-translate-x-full"])&&r.classList.remove(...["translate-x-full","rtl:-translate-x-full"]),body.classList.add("overflow-hidden")}),i&&i.addEventListener("click",()=>{l.classList.contains(...["invisible","opacity-0"])||l.classList.add(...["invisible","opacity-0"]),r.classList.contains(...["translate-x-full","rtl:-translate-x-full"])||r.classList.add(...["translate-x-full","rtl:-translate-x-full"]),body.classList.contains("overflow-hidden")&&body.classList.remove("overflow-hidden")}),l.addEventListener("click",function(t){t.target===this&&t.target!==r&&(l.classList.contains(...["invisible","opacity-0"])||l.classList.add(...["invisible","opacity-0"]),r.classList.contains(...["translate-x-full","rtl:-translate-x-full"])||r.classList.add(...["translate-x-full","rtl:-translate-x-full"]),body.classList.contains("overflow-hidden")&&body.classList.remove("overflow-hidden"))})}),document.querySelectorAll('a[href="#"]').forEach(t=>{t.addEventListener("click",t=>t.preventDefault())});const videoWrapper=document.querySelectorAll(".video-wrapper");videoWrapper.forEach(function(t){let e=document.querySelector(".controll-wrapper"),l=t.querySelector("video"),r=t.querySelectorAll(".controller");r.forEach(t=>{t.addEventListener("click",function(){e=this.closest(".controll-wrapper"),l.play(),e.classList.add("hide")})}),l.addEventListener("click",function(){l.pause(),e.classList.remove("hide")}),l.addEventListener("ended",function(){l.pause(),e.classList.remove("hide")})});const fa=document.querySelectorAll(".lms-accordion");fa.forEach(function(t){let e=t.querySelector(".lms-accordion-button");e&&e.addEventListener("click",function(){this.classList.toggle("panel-show")})});const clb=document.querySelectorAll(".card-layout-button");clb.forEach(function(t){t.addEventListener("click",function(){clb.forEach(t=>t.classList.remove("active")),this.classList.contains("active")||this.classList.add("active");let t=this.getAttribute("data-layout");html.setAttribute("data-card-layout",t)})});const inputTypeToggler=document.querySelectorAll(".inputTypeToggle");inputTypeToggler.forEach(function(t){t.addEventListener("change",function(){this.parentElement.parentElement.children[0].type=this.checked?"text":"password"})});const timerElement=document.querySelector(".quiz-time"),getTimeAttr=!!timerElement&&timerElement.hasAttribute("data-quiz-minute");if(timerElement&&getTimeAttr){let t=timerElement.getAttribute("data-quiz-minute"),e=60*t;function l(t){let e=Math.floor(t/60);return`${String(Math.floor(e/60)%60).padStart(2,"0")}:${String(e%60).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`}let r=setInterval(()=>{e<=0?(clearInterval(r),timerElement.textContent="00:00:00",!0==start&&$("#final-submit").submit()):e--,timerElement.textContent=l(e)},1e3);timerElement.textContent=l(e)}const cbc=document.querySelectorAll(".category-bg-color"),colors=["#F6F0E8","#F6F0E8","#F0F6E8","#F8F2F5","#FFF2F2","#F0FBF5","#F8F2E6","#F4F9FF",];cbc.forEach(t=>{t.style.backgroundColor=colors[Math.floor(Math.random()*colors.length)]}),function t(){let e=document.querySelectorAll(".lms-counter");e.length&&e.forEach(t=>{let e=t.getAttribute("data-value"),l=e/300,r=0;function i(t,e,l){return String(t).length<l?Array(l-String(t).length+1).join(e)+String(t):t}function a(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}let n=()=>{(r+=l)<e?(t.innerText=i(a(r.toFixed(0)),"0","2"),setTimeout(n,1)):t.innerText=i(a(e),"0","2")};n()})}();const circleRating=document.querySelectorAll(".circle-rating");circleRating.forEach(function(t){let e=t.getAttribute("data-rating");t.setAttribute("stroke-dasharray",300+24*(e||0))}),!0==start&&document.addEventListener("visibilitychange",function(){document.hidden&&$("#final-submit").submit()});const observer=lozad(document.querySelectorAll("img[data-src]"),{rootMargin:"200px 0px",threshold:.1});observer.observe();