$(function(){ custom_cursor(); $("body").addClass("on"); $(".mainslide").addClass("on"); $(document).ready(function(){ if($("body").addClass("on")){ } }); var mainSlide = new Swiper('.mainslide', { effect: "fade", autoplay: true, speed: 1000, allowTouchMove:false, simulateTouch:false, grabCursor: false, touchStartPreventDefault:false, pagination: { el: '.main_pagination', clickable: true, }, navigation: { nextEl: '.main_next', prevEl: '.main_prev', }, }); var productSlide = new Swiper('.product_slide', { effect: "slide", speed: 800, autoplay:false, parallax: true, allowTouchMove:false, simulateTouch:false, grabCursor: false, touchStartPreventDefault:false, navigation: { nextEl: '.product_next', prevEl: '.product_prev', }, loop:true, }); var productText = new Swiper('.product_text', { effect: "fade", speed: 900, autoplay:false, allowTouchMove:false, simulateTouch:false, grabCursor: false, touchStartPreventDefault:false, navigation: { nextEl: '.product_next', prevEl: '.product_prev', }, loop:true, }); var showroomSlide = new Swiper('.showroom_slide', { //effect: "fade", autoplay: false, speed: 1000, loop:true, parallax: true, allowTouchMove:false, simulateTouch:false, grabCursor: false, touchStartPreventDefault:false, navigation: { nextEl: '.showroom_next', prevEl: '.showroom_prev', }, }); var gallerySlide = new Swiper('.gallery_slide', { slidesPerView: 'auto', //effect: "fade", autoplay: false, speed: 1000, pagination: { el: '.gallery_pagination', type: 'progressbar', }, //parallax: true, //allowTouchMove:false, //simulateTouch:false, //grabCursor: false, //touchStartPreventDefault:false, }); var snsSlide = new Swiper('.sns_slide', { slidesPerView: 'auto', centeredSlides: true, //effect: "fade", autoplay: true, speed:1000, loop:true, //parallax: true, //allowTouchMove:false, //simulateTouch:false, //grabCursor: false, //touchStartPreventDefault:false, }); }); function custom_cursor(){ var $cursor = null; var $inner = null; var $circle = null; var $txt = null; 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 }); }); // global cursor $(document).on({ mouseenter: function(){ $cursor = $('#custom_cursor, #custom_cursor_text'); $inner = $cursor.find('.custom_cursor_inner'); $circle = $cursor.find('.custom_hover_circle'); $txt = $cursor.find('.custom_hover_text'); var $this = $(this); var words = ( $this.data('hover') != undefined ) ? $this.data('hover') : ''; if( $this.hasClass('drag') ){ $cursor.addClass('drag'); } if( $this.hasClass('custom_simple_cursor') ){ words = ''; var size = ( $this.data('size') != undefined ) ? $this.data('size') : '48'; TweenMax.to($inner, .1, {width: size,height: size,ease: Power0.easeNone}); } $txt.find('> span').text( words ); TweenMax.killTweensOf($circle, $txt); TweenMax.to($circle, .3, {width: '100%',height: '100%',autoAlpha: 1,ease: Power0.easeNone}); TweenMax.to($txt, .3, {width: '100%',height: '100%',autoAlpha: 1,ease: Power0.easeNone}); }, mouseleave: function(){ $cursor = $('#custom_cursor, #custom_cursor_text'); $inner = $cursor.find('.custom_cursor_inner'); $circle = $cursor.find('.custom_hover_circle'); $txt = $cursor.find('.custom_hover_text'); var $this = $(this); if( $this.hasClass('drag') ){ $cursor.removeClass('drag'); } if( $this.hasClass('custom_simple_cursor') ){ TweenMax.to($inner, .2, {width: '100%',height: '100%',ease: Power0.easeNone}); } TweenMax.killTweensOf($circle, $txt); TweenMax.to($circle, .2, {width: '0%',height: '0%',autoAlpha: 0,ease: Power0.easeNone}); TweenMax.to($txt, .2, {width: '0%',height: '0%',autoAlpha: 0,ease: Power0.easeNone}); } }, '.custom_hover'); } // -------------------------------------------------------버튼 효과 function btn_effect(){ $('.btn_box').each(function() { var $circlesTopLeft = $(this).find('.circle.top-left'); var $circlesBottomRight = $(this).find('.circle.bottom-right'); var tl = new TimelineLite(); var tl2 = new TimelineLite(); var btTl = new TimelineLite({ paused: true }); tl.to($circlesTopLeft, 1.2, { x: -25, y: -25, scaleY: 2, ease: SlowMo.ease.config(0.1, 0.7, false) }); tl.to($circlesTopLeft.eq(0), 0.1, { scale: 0.2, x: '+=6', y: '-=2' }); tl.to($circlesTopLeft.eq(1), 0.1, { scaleX: 1, scaleY: 0.8, x: '-=10', y: '-=7' }, '-=0.1'); tl.to($circlesTopLeft.eq(2), 0.1, { scale: 0.2, x: '-=15', y: '+=6' }, '-=0.1'); tl.to($circlesTopLeft.eq(0), 1, { scale: 0, x: '-=5', y: '-=15', opacity: 0 }); tl.to($circlesTopLeft.eq(1), 1, { scaleX: 0.4, scaleY: 0.4, x: '-=10', y: '-=10', opacity: 0 }, '-=1'); tl.to($circlesTopLeft.eq(2), 1, { scale: 0, x: '-=15', y: '+=5', opacity: 0 }, '-=1'); var tlBt1 = new TimelineLite(); var tlBt2 = new TimelineLite(); tlBt1.set($circlesTopLeft, { x: 0, y: 0, rotation: -45 }); tlBt1.add(tl); tl2.set($circlesBottomRight, { x: 0, y: 0 }); tl2.to($circlesBottomRight, 1.1, { x: 30, y: 30, ease: SlowMo.ease.config(0.1, 0.7, false) }); tl2.to($circlesBottomRight.eq(0), 0.1, { scale: 0.2, x: '-=6', y: '+=3' }); tl2.to($circlesBottomRight.eq(1), 0.1, { scale: 0.8, x: '+=7', y: '+=3' }, '-=0.1'); tl2.to($circlesBottomRight.eq(2), 0.1, { scale: 0.2, x: '+=15', y: '-=6' }, '-=0.2'); tl2.to($circlesBottomRight.eq(0), 1, { scale: 0, x: '+=5', y: '+=15', opacity: 0 }); tl2.to($circlesBottomRight.eq(1), 1, { scale: 0.4, x: '+=7', y: '+=7', opacity: 0 }, '-=1'); tl2.to($circlesBottomRight.eq(2), 1, { scale: 0, x: '+=15', y: '-=5', opacity: 0 }, '-=1'); tlBt2.set($circlesBottomRight, { x: 0, y: 0, rotation: 45 }); tlBt2.add(tl2); btTl.add(tlBt1); btTl.to($(this).parent().find('.button.effect-button'), 0.8, { scaleY: 1.1 }, 0.1); btTl.add(tlBt2, 0.2); btTl.to($(this).parent().find('.button.effect-button'), 1.8, { scale: 1, ease: Elastic.easeOut.config(1.2, 0.4) }, 1.2); btTl.timeScale(2.6); $(this).on('mouseenter', function() { btTl.restart(); }); }); } // -------------------------------------------------------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"); }); } $(document).ready(function(){ value(); btn_effect(); });