$(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: 3, arrows: true, dots: true, // 자동 롤링 autoplay: true, autoplaySpeed: 2000, // 마우스/손가락 제어 draggable: true, swipe: true, touchMove: true, // 건드린 후에도 자동 계속 pauseOnHover: false, pauseOnFocus: false, pauseOnDotsHover: false, infinite: true, responsive: [ { breakpoint: 1440, settings: { slidesToShow: 3, centerPadding: '80px' } }, { breakpoint: 1024, settings: { slidesToShow: 1, centerPadding: '180px' } }, { breakpoint: 767, settings: { slidesToShow: 1, centerPadding: '70px' } }, { breakpoint: 450, settings: { slidesToShow: 1, centerPadding: '0px' } } ] }); // 창업주인터뷰 슬라이더 $('.gall_history').slick({ // 중앙 크게 + 양옆 잘림 slidesToShow: 1, centerMode: true, centerPadding: '28%', arrows: true, dots: true, // 자동 롤링 autoplay: true, autoplaySpeed: 2000, // 마우스/손가락 제어 draggable: true, swipe: true, touchMove: true, // 건드린 후에도 자동 계속 pauseOnHover: false, pauseOnFocus: false, pauseOnDotsHover: false, infinite: true, responsive: [ { breakpoint: 1440, settings: { centerPadding: '22%' } }, { breakpoint: 1024, settings: { centerPadding: '13%' } }, { breakpoint: 767, settings: { centerPadding: '0' } } ] }); $('.gall_review1').slick({ infinite: true, slidesToShow:4, slidesToScroll: 1, speed: 3000, cssEase: 'linear', autoplay: true, autoplaySpeed: 0, pauseOnHover: false, pauseOnFocus: false, pauseOnDotsHover: false, draggable: true, swipe: true, touchMove: true, arrows: false, dots: false, waitForAnimate: false, accessibility: false, // ✅ PC 기본값: 세로 슬라이드 vertical: true, verticalSwiping: true, responsive: [ { breakpoint: 1024, // 모바일/태블릿 settings: { vertical: false, verticalSwiping: false, slidesToShow:4, rtl: false // ✅ 좌 → 우 } }, { breakpoint: 767, settings: { vertical: false, verticalSwiping: false, slidesToShow:3, rtl: false // ✅ 좌 → 우 } } ] }); $('.gall_review2').slick({ infinite: true, slidesToShow:4, slidesToScroll: 1, speed: 3000, cssEase: 'linear', autoplay: true, autoplaySpeed: 0, pauseOnHover: false, pauseOnFocus: false, pauseOnDotsHover: false, draggable: true, swipe: true, touchMove: true, arrows: false, dots: false, waitForAnimate: false, accessibility: false, // ✅ PC 기본값: 세로 슬라이드 vertical: true, verticalSwiping: true, responsive: [ { breakpoint: 1024, // 모바일/태블릿 settings: { vertical: false, verticalSwiping: false, slidesToShow:4, rtl: false // ✅ 좌 → 우 } }, { breakpoint: 767, settings: { vertical: false, verticalSwiping: false, slidesToShow:3, rtl: false // ✅ 좌 → 우 } } ] }); $('.yt-thumb').on('click', function(){ var videoId = $(this).data('video'); $('#ytFrame').attr( 'src', 'https://www.youtube.com/embed/' + videoId + '?autoplay=1&rel=0&controls=1' ); $('#ytPopup').fadeIn(); }); // 닫기 $('.yt-close, #ytPopup').on('click', function(e){ if(e.target !== this) return; $('#ytPopup').fadeOut(function(){ $('#ytFrame').attr('src',''); // 재생 정지 }); }); // 슬라이드 재생/정지 버튼 공통 처리 $('.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, disableOnInteraction: false, // ⭐ 핵심: 건드려도 자동재생 유지 }, // 마우스 + 손가락 제어 allowTouchMove: true, simulateTouch: true, grabCursor: true, touchStartPreventDefault: false, pagination: { el: '.main_pagination', clickable: true, }, navigation: { nextEl: '.main_next', prevEl: '.main_prev', } }); 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(); });