/* * Name : main.min.js * Version : 1.0.3 * Author : 1px studio * Date : 2023-07-19 * Desc : - * ------------------------------------------------- */ $(function(){if(null!=document.getElementById("isIndex")){!function e(){function t(e){e.hide()}$(".px-layer-popup .btn-cookie-close").on("click",function(e){let i=$(this).closest(".px-layer-popup"),s=i.attr("id");e.preventDefault(),$.cookie(s,"1",{expires:1}),t(i)}),$(".px-layer-popup .btn-normal-close").on("click",function(e){let i=$(this).closest(".px-layer-popup");e.preventDefault(),t(i)})}(),AOS.init({duration:1200}),t(),$(".text-box").eq(0).addClass("on"),$(window).resize(t),new Swiper(".main-swiper",{autoplay:{delay:4e3,disableOnInteraction:!1},speed:800,loop:!0,effect:"creative",creativeEffect:{prev:{translate:[0,0,-400]},next:{translate:["100%",0,0]}},navigation:{nextEl:".main-slide .swiper-button-next",prevEl:".main-slide .swiper-button-prev"},pagination:{el:".main-slide .swiper-pagination",type:"fraction",clickable:!0,formatFractionCurrent:function(e){return("0"+e).slice(-2)},formatFractionTotal:function(e){return("0"+e).slice(-2)}}}).on("slideChange",function(e){var t=e.realIndex+1;$(".text-box").removeClass("on"),$(".text-box[data-slide='"+t+"']").addClass("on")}),i(),window.addEventListener("resize",i),!function e(){if(0==$(".news table.article-list").length)return;let t=$(".news table.article-list > tbody > tr"),i=[];t.each((e,t)=>{let s=$(t).find(".board_output_gallery_img > a"),r=$(t).find("tr:last-child > td"),a=s.attr("href"),n=s.find("img").attr("src"),l=r.find(".board_output_gallery_subject a"),o=r.find(".board_output_gallery_description"),c=l.text().trim(),d=o.text().trim();l.remove(),o.remove();let p=r.text().trim();i.push({category:p,title:c,desc:d,href:a,src:n})}),$(".news table.article-list").remove();let s="";i.forEach(e=>{s+='
',s+='',s+='

'+e.category+"

",s+='

'+e.title+"

",s+='

'+e.desc+"

",s+="
"}),$(".news-swiper .swiper-wrapper").html(s)}(),new Swiper(".news-swiper",{slidesPerView:"auto",spaceBetween:20,slidesOffsetAfter:20,resizeObserver:!1,navigation:{nextEl:".news .swiper-button-next",prevEl:".news .swiper-button-prev"},scrollbar:{el:".swiper-scrollbar",draggable:!0}}),!function e(){if(0==$(".event table.board_output").length){let t=$(".event .preview-box .slide-img"),i="";t.each((e,t)=>{i+='
'}),$(".event-swiper-thumb .swiper-wrapper").html(i)}else{let s=$(".event table.board_output table.board_output > tbody > tr > td");if(0==s.length)return;let r=[];s.each((e,t)=>{let i=$(t).find(".board_output_gallery_img"),s=$(t).find("tr:last-child > td"),a=i.find("a").attr("href"),n=i.find("img").attr("src"),l=s.find(".board_output_gallery_subject").text().trim(),o=s.find(".board_output_gallery_description").text();r.push({title:l,desc:o,href:a,src:n})}),$(".event table.board_output").remove();let a="",n="";r.forEach(e=>{a+='
',a+='',a+='
',a+='
',a+='
'+e.title+"
",a+='
'+e.desc+"
",a+="
",n+='
'}),$(".event-swiper .swiper-wrapper").html(a),$(".event-swiper-thumb .swiper-wrapper").html(n)}}();var e=new Swiper(".event-swiper-thumb",{spaceBetween:10,slidesPerView:"auto",freeMode:!0,watchSlidesProgress:!0});new Swiper(".event-swiper",{spaceBetween:10,speed:800,navigation:{nextEl:".event .swiper-button-next",prevEl:".event .swiper-button-prev"},thumbs:{swiper:e}})}function t(){var e=$(".news-text").offset().left+320,t=$(window).width()-e;$("#main .news-slide").css("width",t+"px")}function i(){let e=$(".main-slide-img");if(!e[0].hasAttribute("data-src"))return!1;window.innerWidth<=1200&&!$(e[0]).hasClass("mb")?e.each((e,t)=>{var i=t.src;t.src=t.getAttribute("data-src"),t.setAttribute("data-src",i),t.className="main-slide-img mb"}):this.window.innerWidth>1200&&$(e[0]).hasClass("mb")&&e.each((e,t)=>{var i=t.src;t.src=t.getAttribute("data-src"),t.setAttribute("data-src",i),t.className="main-slide-img"})}});