//실시간 문의 function icontranform() { if ($('#collapseside').hasClass('show')) { $('#collapseside').removeClass('show'); $('.left-down').addClass('fa-rotate-180'); } else { $('#collapseside').addClass('show'); $('.left-down').removeClass('fa-rotate-180'); } } /* * Name : common.min.js * Version : 1.1.0 * Product : prime05 * Author : 1px studio * Date : 2024.06.19 * Desc : 포인트컬러(style preview) 적용 --------------------------------------------------- */ $(function(){let e;(e=document.getElementById("isIndex"))&&"Y"==e.value?(document.getElementById("sjs").remove(),document.getElementById("scss").remove()):(document.getElementById("mjs").remove(),document.getElementById("mcss").remove());let t;window.onload=(t=$("#page-loader"),void(t.find(".loader-stage").fadeOut("slow",function(){setTimeout(function(){t.fadeOut("slow")},100)}),null==document.getElementById("isIndex")&&$(".hero").addClass("--load")));let o=new Lenis({duration:.8,easing:e=>1-Math.pow(1-e,3),wheelMultiplier:2});function n(e){o.raf(e),requestAnimationFrame(n)}o.on("scroll",e=>{}),requestAnimationFrame(n);let s=0,r=null,i=$("#header");function l(){clearTimeout(r)}function a(){l();$("#hamburger").hasClass("open")&&window.outerWidth<1280||(r=setTimeout(function(){i.addClass("hide")},2500))}function c(){let e=$("#header .gnb > ul > li"),t=!1;if($.each(e,function(e){if(0==$(this).outerWidth()){$("#header").attr("data-gnb",0),t=!0;return}$(this).css("width",$(this).outerWidth()+"px"),$("#header").attr("data-gnb",1)}),!t){let o=$("#header .gnb > ul > li .gnb-sub");$.each(o,function(e){$(this).css("width",$(this).outerWidth()+"px")})}}$(window).on("scroll",function(){let e=$(window).scrollTop();s>e&&i.removeClass("hide"),e>=200?(i.addClass("fixed"),a(),$("#quick-btns").addClass("show")):(i.removeClass("fixed"),l(),$("#quick-btns").removeClass("show")),s=e}),i.on("mouseover",function(e){l()}),i.on("mouseout",function(e){a()}),c(),$(window).on("resize",()=>{!1==$("#header").attr("data-gnb")&&window.outerWidth>1280&&c()});let d=$("#header-mb"),u=!1;$("#hamburger").on("click",function(e){if($(this).hasClass("open")){if(u)return!1;u=!0,$(this).removeClass("open"),gsap.to(d,{opacity:0,duration:.8,ease:"power2.out"}).then(function(){gsap.set(d,{display:"none"}).then(function(){u=!1,a()})})}else{if(u)return!1;u=!0,l(),$(this).addClass("open"),gsap.set(d,{display:"block"}).then(function(){gsap.to(d,{opacity:1,duration:.8,ease:"power2.out"}).then(function(){u=!1})})}}),$("#header-mb .gnb-top").on("click",function(e){let t=$(this).next(".gnb-sub");if(t.hasClass("open")){t.removeClass("open");return}$("#header-mb .gnb-sub").removeClass("open"),t.addClass("open")}),!function e(){if(/Mobi/i.test(window.navigator.userAgent)){$(".px-cursor").remove();return}let t=document.querySelector(".cursor-ball"),o=document.querySelector(".cursor-inner");$(document).on("mousemove",function e(o){TweenMax.to(t,.6,{x:o.clientX-34,y:o.clientY-34})}),$(document).on("mouseenter","a, button",function e(){TweenMax.to(t,.3,{scale:.5})}),$(document).on("mouseleave","a, button",function e(){TweenMax.to(t,.3,{scale:1})}),$(".hero-buttons *").on("mouseenter",function e(n){$(o).addClass("big");let s=$(n.target).attr("data-cursor");$(t).css({"mix-blend-mode":"unset"}),$(t).append('
'+s+"
")}),$(".hero-buttons *").on("mouseleave",function e(){$(o).removeClass("big"),$(t).css({"mix-blend-mode":"difference"}),$(t).find(".text").remove()})}(),$("#footer .footer-email").on("click",function(e){let t=$(this).children().eq(0).text();window.navigator.clipboard.writeText(t).then(()=>{}).catch(e=>{e&&alert(`[알림] 실제 사이트에서는 버튼에 기재된 메일 주소(${t})가 자동으로 복사되나, 브라우저 정책으로 상품 미리보기(iframe)에서는 실행되지 않으니 참고 바랍니다.`)}).finally(()=>{$("#footer .footer-email div").css("transform","translateY(-200%)"),setTimeout(function(){$("#footer .footer-email div").removeAttr("style")},2e3)})}),$("#quick-btns .quick-more").on("click",function(e){$("#quick-btns .quick-list").toggleClass("active")}),$("#color-set .color").on("click",function(e){let t=$(this).data("point");$(this).hasClass("no0")?(document.documentElement.style.removeProperty("--point"),document.documentElement.style.removeProperty("--point-middle"),document.documentElement.style.removeProperty("--point-light"),document.documentElement.style.setProperty("--primary","#202020")):(document.documentElement.style.setProperty("--point",t),document.documentElement.style.setProperty("--point-middle",t+"cf"),document.documentElement.style.setProperty("--point-light",t+"0d"),document.documentElement.style.setProperty("--primary",t)),$("#color-set .color").removeClass("selected"),$(this).addClass("selected")}),$("#color-set .header-set").on("click",function(e){$(this).hasClass("point")?$("#header").attr("data-color","point"):$("#header").removeAttr("data-color"),$("#color-set .header-set").removeClass("selected"),$(this).addClass("selected")}),$("#header-hide").on("change",function(e){this.checked?$("#header").addClass("fixed-important"):$("#header").removeClass("fixed-important")}),$("#color-set .color-set-hide").on("click",function(e){$("#color-set").toggleClass("hide")})});