/*
* Name : main.min.js
* Version : 1.0.0
* 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);
});
})(),
new Swiper(".main-swiper", {
speed: 1e3,
loop: !0,
slidesPerView: 1,
spaceBetween: 0,
navigation: { nextEl: ".main-slide .swiper-button-next", prevEl: ".main-slide .swiper-button-prev" },
pagination: {
el: ".main-slide .swiper-pagination",
clickable: !0,
renderBullet: function (e, t) {
let i = [];
return (
$(".main-slide .swiper-slide").each(function () {
i.push($(this).find(".main-slide-title").html());
}),
'0' + (e + 1) + "" + i[e + 1] + ""
);
},
},
autoplay: { delay: 3500, disableOnInteraction: !1 },
on: {
init: function () {
$(".main-swiper").addClass("load-init");
},
slideChange: function (e) {
for (let t = 0; t < e.slides.length; t++) {
let i,
s = (e.activeIndex == t ? 0 : e.activeIndex - t) * (0.5 * e.width);
(e.slides[t].querySelector(".main-slide-bg-wrap").style.transform = "translate3d(" + s + "px, 0, 0)"), $(".main-swiper").removeClass("load-init");
}
},
touchStart: function (e) {
for (let t = 0; t < e.slides.length; t++) e.slides[t].style.transition = "";
},
setTransition: function (e, t) {
for (let i = 0; i < e.slides.length; i++) (e.slides[i].style.transition = t + "ms"), (e.slides[i].querySelector(".main-slide-bg-wrap").style.transition = t + "ms");
},
},
}),
!(function e() {
if (0 == $(".product .article-list").length) return;
let t = $(".product .article-list > tbody > tr"),
i = '
';
t.each(function () {
let e = $(this).find("a").attr("href"),
t = $(this).find(".board_output_imgs").attr("src"),
s = $(this).find(".board_output_gallery_subject a").text().trim();
i += `
`;
}),
(i += "
"),
$("section.product .prod-swiper").empty().html(i);
})();
var e = new Swiper(".prod-swiper", {
loop: true,
slidesPerView: 2,
slidesPerGroup: 1,
spaceBetween: 15,
navigation: { nextEl: ".product .swiper-button-next", prevEl: ".product .swiper-button-prev" },
breakpoints: { 480: { slidesPerView: 2, spaceBetween: 20, }, 768: { slidesPerView: 3, spaceBetween: 20, }, 1100: { slidesPerView: 4, spaceBetween: 20, } },
});
e.on("reachEnd", function () {
$(".prod-swiper .smooth-edge").addClass("left");
}),
e.on("reachBeginning", function () {
$(".prod-swiper .smooth-edge").removeClass("left");
}),
!(function e() {
if (0 == $(".event .article-list").length) return;
function t(e) {
let t = e.split("년"),
i = t[0].substr(2, 2),
s;
return i + "." + (t = t[1].split("월"))[0].trim() + "." + t[1].replace("일", "").trim();
}
let i = $(".event .article-list > tbody > tr > td"),
s = "";
i.each(function (e) {
if (0 == $(this).html().trim().length) return !1;
let i = $(this).find("a").attr("href"),
n = $(this).find(".board_output_imgs").attr("src"),
l = $(this).find(".board_output_gallery_subject").text().trim(),
r = $(this).find(".board_output_gallery_etc").eq(0).text();
r = t(r);
let o = $(this).find(".board_output_gallery_etc").eq(1).text();
s += `
`;
}),
$("section.event .event-swiper .swiper-wrapper").empty().html(s);
})();
var t = new Swiper(".event-swiper", { loop: true, slidesPerView: "auto", spaceBetween: 20, resizeObserver: !1, navigation: { nextEl: ".event .swiper-button-next", prevEl: ".event .swiper-button-prev" } });
t.on("reachEnd", function () {
$(".event-swiper .smooth-edge").addClass("left");
}),
t.on("reachBeginning", function () {
$(".event-swiper .smooth-edge").removeClass("left");
}),
!(function e() {
if (0 == $(".notice .article-list").length) return;
let t = $(".notice .article-list tr"),
i = "",
s = 0;
t.each(function (e) {
let t = $(this).find("a"),
s = t.attr("href"),
n = t.text().trim(),
l = $(this).find("td").eq(2).text(),
r;
i += `
${n}
${$(this).find("td").last().text()}
`;
}),
$("section.notice .notice-content").html(i),
$("section.notice .article-list").remove(),
(s += 150);
})(),
$("section.notice .notice-title").on("click", function (e) {
$(this).next(".notice-text").toggleClass("open");
}),
AOS.init({ duration: 600, once: !0 });
}
});