/* * Name : main.min.js * Version : 1.0.3 * Product : prime05 * Author : 1px studio * Date : 2024.10.10 * Desc : 섹션 다수 + 공지사항 fix + swiper ver 11.2.0 --------------------------------------------------- */ $(function () { if (null == document.getElementById("isIndex")) return; !(function e() { function t(e) { e.hide(); } $(".px-layer-popup .btn-cookie-close").on("click", function (e) { let i = $(this).closest(".px-layer-popup"), o = i.attr("id"); e.preventDefault(), $.cookie(o, "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); }); })(), !(function e() { let t = $("#hero .progress-inner"), i = new Swiper(".swiper.hero-swiper", { speed: 1e3, loop: !0, slidesPerView: 1, spaceBetween: 0, autoplay: { delay: 4500, disableOnInteraction: !1, pauseOnMouseEnter: !0 }, navigation: { nextEl: "#hero .hero-next", prevEl: "#hero .hero-prev" }, effect: "fade", pagination: { el: "#hero .swiper-page", clickable: !0, bulletClass: "hero-bullet", bulletActiveClass: "hero-bullet-active" }, on: { autoplayTimeLeft(e, i, o) { let l = (1 - o) * 100; (l = l > 100 ? 100 : l), t.height(l + "%"); }, slideChange: function (e) { hero_stop = !1; let t = e.realIndex + 1 > 9 ? e.realIndex + 1 : "0" + (e.realIndex + 1); $("#hero .progress-num").text(t); }, }, }), o = $("#hero .hero-text-box[data-slide]"), l = o.last(); function r(e) { let t = e.realIndex, i = o.eq(t); gsap.to(l, { opacity: 0, display: "none", duration: 0.5, onComplete() { gsap.fromTo(i, { opacity: 0, display: "flex" }, { opacity: 1, duration: 1.2, ease: "power4.out", delay: 0.3 }), gsap.fromTo(i.find("[up-transition]"), { y: "100px" }, { y: "0%", duration: 1, ease: "power4.out", delay: 0.3 }), (l = i); }, }); } let a = $("#hero [up-transition]"); $.each(a, function () { $(this).wrap("
"); }), i.on("realIndexChange", function (e) { r(e); }), r(i), $(".hero-more").on("mouseover", function () { i.autoplay.pause(); }), $(".hero-more").on("mouseout", function () { i.autoplay.resume(); }); })(), !(function e() { if (0 == $("section.notice table.article-list").length) return; let t = RegExp(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/), i = $("section.notice table.article-list > tbody > tr"), o = []; i.each((e, i) => { let l = $(i).find("a"), r = l.text().trim(), a = l.attr("href"), s = $(i).find("td").last().text().trim(), n = $(i).find("td").eq(2), c = ""; n.length > 0 && t.test(n.text()) && (c = n.text().replaceAll("-", ".")), o.push({ date: c, title: r, desc: s, href: a }); }), $("section.notice table.article-list").remove(); let l = ""; o.forEach((e) => { (l += '"); }), $("section.notice .notice-swiper .swiper-wrapper").html(l); })(), new Swiper(".notice .notice-swiper", { direction: "vertical", effect: "slide", slidesPerView: 1, loop: !0, navigation: { nextEl: ".notice .notice-next", prevEl: ".notice .notice-prev" } }), $(".counter").counterUp({ delay: 10, time: 1e3 }); let e = $("#video-popup"), t = $("#video-popup .video-wrapper"), i = t.children().data("video"), o, l; "youtube" == i && ((l = $("#ytplayer").attr("video-id")), window.YT.ready(function () { o = new YT.Player("ytplayer", { videoId: l, playerVars: { origin: location.origin, playlist: l } }); })), $("#video-view").on("click", function () { gsap.fromTo( e, { opacity: 0, display: "flex" }, { opacity: 1, duration: 0.5, ease: "power4.out", onComplete() { gsap.fromTo( t, { y: "-50%", opacity: 0, display: "flex" }, { y: "0%", opacity: 1, duration: 0.5, ease: "power4.out", onComplete() { "vimeo" == i ? new Vimeo.Player($("#video-popup iframe")).play() : "youtube" == i ? o.playVideo() : "ftp" == i && t[0].children[0].play(); }, } ); }, } ); }), $("#video-popup .close-cover").on("click", function () { gsap.fromTo( t, { y: "0%" }, { y: "-50%", opacity: 0, display: "none", duration: 0.5, ease: "power4.out", onComplete() { if ("vimeo" == i) { let e = new Vimeo.Player($("#video-popup iframe")); e.pause(), e.setCurrentTime(0); } else if ("youtube" == i) o.stopVideo(); else if ("ftp" == i) { let l = t[0].children[0]; l.pause(), (l.currentTime = 0); } }, } ), gsap.fromTo(e, { opacity: 1 }, { opacity: 0, display: "none", duration: 0.5, ease: "power4.out" }); }); let r; (r = $(".product")), $.each(r, function (e, t) { var i = "#" + t.id + " "; (function e(t) { if (0 == $(t + "table.article-list").length) return; let i = $(t + "table.article-list > tbody > tr"), o = []; i.each((e, t) => { let i = $(t).find(".board_output_gallery_img > a"), l = $(t).find("tr:last-child > td"), r = i.attr("href"), a = i.find("img").attr("src"), s = l.find(".board_output_gallery_subject a"), n = l.find(".board_output_gallery_description"), c = s.text().trim(), d = n.text().trim(); s.remove(), n.remove(); let p = l.text().trim(); o.push({ category: p, title: c, desc: d, href: r, src: a }); }), $(t + "table.article-list").remove(); let l = ""; o.forEach((e) => { (l += '"); }), $(t + ".product-swiper .swiper-wrapper").html(l); })(i), new Swiper(i + ".product-swiper", { slidesPerView: 4, spaceBetween: 22, freeMode: !1, navigation: { nextEl: i + ".swiper-next", prevEl: i + ".swiper-prev" }, breakpoints: { 480: { slidesPerView: 1.5 }, 768: { slidesPerView: 2.5, freeMode: { enabled: !0, sticky: !1 } } }, }); new Swiper(i + ".product-swiper.product-swiper2", { slidesPerView: 3, spaceBetween: 22, freeMode: !1, navigation: { nextEl: i + ".swiper-next", prevEl: i + ".swiper-prev" }, breakpoints: { 480: { slidesPerView: 1.25 }, 768: { slidesPerView: 2, freeMode: { enabled: !0, sticky: !1 } } }, }); new Swiper(i + ".product-swiper.product-swiper3", { slidesPerView: 3, spaceBetween: 22, freeMode: !1, navigation: { nextEl: i + ".swiper-next", prevEl: i + ".swiper-prev" }, breakpoints: { 480: { slidesPerView: 1.25 }, 768: { slidesPerView: 2, freeMode: { enabled: !0, sticky: !1 } } }, }); }), $(".product .swiper-mobile-buttons button").on("click", function (e) { $(this).hasClass("prev") ? $(".product .swiper-prev").trigger("click") : $(".product .swiper-next").trigger("click"); }), $(".client-box").marquee({ speed: 80, duplicated: !0, pauseOnHover: !0 }); let a; (a = $(".blog")), $.each(a, function (e, t) { !(function e(t) { if (0 == $(t + "table.article-list").length) return; let i = $(t + "table.article-list > tbody > tr"), o = RegExp(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/), l = []; i.each((e, t) => { let i = $(t).find("a"), r = i.attr("href"), a = i.find("img").attr("src"), s = $(t).find(".bd_out1").text().trim(), n = $(t).find("td").eq(3).text().trim(); o.test(n) && (n = n.substr(5, 5).replace("-", ".")), l.push({ title: s, date: n, href: r, src: a }); }), $(t + "table.article-list").remove(); let r = '