$(function () { // ---------------------- 초기 로딩 ---------------------- custom_cursor(); $("body").addClass("on"); $(".mainslide").addClass("on"); mo_effect(); value(); // ---------------------- Slick 슬라이더 ---------------------- // 메뉴 슬라이더 $('.menu_row1').slick({ infinite: true, slidesToShow: 4, slidesToScroll: 1, arrows: true, dots: true, autoplay: false, responsive: [ { breakpoint: 1440, settings: { slidesToShow: 3 } }, { breakpoint: 1024, settings: { slidesToShow: 2 } }, { breakpoint: 767, settings: { slidesToShow: 1 } } ] }); // 매출안내 슬라이더 $('.gall_money').slick({ slidesToShow: 4, arrows: true, dots: true, autoplay: true, autoplaySpeed: 2000, responsive: [ { breakpoint: 1440, settings: { slidesToShow: 3 } }, { breakpoint: 1024, settings: { slidesToShow: 2 } }, { breakpoint: 767, settings: { slidesToShow: 1 } } ] }); // 연혁 슬라이더 $('.gall_history').slick({ slidesToShow: 3, arrows: true, dots: true, autoplay: true, autoplaySpeed: 2000, responsive: [ { breakpoint: 1024, settings: { slidesToShow: 2 } }, { breakpoint: 767, settings: { slidesToShow: 1 } } ] }); // 리뷰 슬라이더 $('.gall_review').slick({ centerMode: true, centerPadding: '5.3%', slidesToShow: 5, autoplay: true, arrows: true, dots: true, autoplaySpeed: 2000, responsive: [ { breakpoint: 1279, settings: { slidesToShow: 3 } }, { breakpoint: 767, settings: { centerPadding: '20%', slidesToShow: 1 } } ] }); // 슬라이드 재생/정지 버튼 공통 처리 $('.pause').click(function () { $(this).siblings("div, ul").slick('slickPause'); $(this).hide().siblings(".play").show(); }); $('.play').click(function () { $(this).siblings("div, ul").slick('slickPlay'); $(this).hide().siblings(".pause").show(); }); // 슬라이더 위치 조정 시 함수 연결 (value 효과용) $('.gall_mbgtxt, .menu_big, .menu_row1').on('setPosition', function () { value(); }); // ---------------------- Swiper 슬라이더 ---------------------- new Swiper('.mainslide', { effect: "fade", speed: 800, autoplay: { delay: 5000 }, allowTouchMove: false, simulateTouch: false, grabCursor: false, touchStartPreventDefault: false, pagination: { el: '.main_pagination', clickable: true, }, navigation: { nextEl: '.main_next', prevEl: '.main_prev', } }); new Swiper('.product_slide', { effect: "slide", speed: 800, autoplay: { delay: 3000 }, parallax: true, allowTouchMove: false, simulateTouch: false, grabCursor: false, touchStartPreventDefault: false, navigation: { nextEl: '.product_next', prevEl: '.product_prev', }, loop: true, }); new Swiper('.product_text', { effect: "fade", speed: 900, autoplay: { delay: 3000 }, allowTouchMove: false, simulateTouch: false, grabCursor: false, touchStartPreventDefault: false, navigation: { nextEl: '.product_next', prevEl: '.product_prev', }, loop: true, }); new Swiper('.store_slide', { slidesPerView: 'auto', autoplay: true, speed: 1000, pagination: { el: '.store_pagination', type: 'progressbar', }, }); // ---------------------- 기타 기능 ---------------------- // 텍스트 흐름 애니메이션 시작 $('.txt_bg_wrap').show(); textAniTop(); }); // ---------------------- 커스텀 커서 ---------------------- function custom_cursor() { if ($('html').hasClass('mobile') || $('html').hasClass('ie10')) return; $('body').mousemove(function (e) { TweenMax.to($('#custom_cursor, #custom_cursor_text'), 1.3, { x: e.clientX, y: e.clientY, ease: Power3.easeOut }); }); } // ---------------------- 브랜드 value 효과 ---------------------- function value() { $(".value_section .con_box li").on("mouseenter", function () { $(".value_section .con_box li").removeClass('active'); $(this).addClass('active'); }); $(".value_section .con_box li").each(function (index, item) { var bg_num = index + 1; $(item).on("mouseenter", function () { $(".value_img .bg_box").removeClass("active"); $(".value_img .bg_box_0" + bg_num).addClass("active"); $(".value_section .tab_box .tabMenu li").removeClass("active"); $(".value_section .tab_box .tabMenu .tab_menu_0" + bg_num).addClass("active"); }); }); $(".value_section .tab_box .tabMenu li").click(function () { var activeTab = $(this).attr("data-tabNumb"); $(".value_section .tab_box .tabMenu li").removeClass("active"); $(this).addClass("active"); $(".value_section .con_box li").removeClass("active"); $("#" + activeTab).addClass("active"); $(".value_img .bg_box").removeClass("active"); $("#" + activeTab + "_bg").addClass("active"); }); } function mo_effect() { setTimeout(function () { $(".value_section .con_box li:first-of-type").addClass("mo_active"); $(".value_section .value_img .bg_box:first-of-type").addClass("mo_active"); }, 200); } function textAniTop() { $(".txt_top").stop().css({ right: 0 }); $(".txt_top").animate({ right: '-=1800px', }, 25000, 'linear', function () { textAniTop(); }); } document.addEventListener('DOMContentLoaded', () => { const cursor = document.getElementById('custom_cursor'); let mouseX = 0, mouseY = 0; let currentX = 0, currentY = 0; const speed = 0.1; document.addEventListener('mousemove', (e) => { mouseX = e.clientX; mouseY = e.clientY; }); function animate() { currentX += (mouseX - currentX) * speed; currentY += (mouseY - currentY) * speed; cursor.style.left = `${currentX}px`; cursor.style.top = `${currentY}px`; requestAnimationFrame(animate); } animate(); });