$(function(){ tl = TweenMax; startJs(); custom_cursor(); allMenuJs(); }); $(document).on('click', 'a[href="#none"]', function(e) { e.preventDefault(); }); //기본js function startJs(){ $('body').addClass('ani'); setTimeout(function() { $('body').addClass('init'); }, 1000); $("header a,footer a,footer button").addClass('custom_mousemove small_h'); //모바일구분 $(window).resize(function(){ windowWidth = $(window).width(); if(windowWidth <= 767){ //m $('#wrap').removeClass('pc'); $('body').removeClass('pc'); $('body').addClass('tm'); $('body').removeClass('t'); $('body').addClass('m'); }else if($(window).width() <= 1279){ //tablet $('#wrap').removeClass('pc'); $('body').removeClass('pc'); $('body').addClass('tm'); $('body').addClass('t'); $('body').removeClass('m'); }else{ //pc $('#wrap').addClass('pc'); $('body').addClass('pc'); $('body').removeClass('tm'); $('body').removeClass('t'); $('body').removeClass('m'); } }).resize(); $(document).on('click', 'a[href="#none"]', function(e) {e.preventDefault()}); if($('html').is('.ie67, .ie7, .ie8, .ie9')) { $('div.ie_alert_text').show().html('현재 사이트는 IE9 미만의 하위브라우저를 지원하지 않습니다.
브라우저를 최신 버전으로 업데이트해 주세요.'); } WebFont.load({google: {families: ['Noto Sans KR', 'Montserrat']}}); $('.follow_btn').each(function(){ var $this = $(this); var $pointer = $this.find('.i'); var pointer_size = ( $this.data('size') != undefined ) ? $this.data('size') : parseInt($this.width()); var $pointer_extend = null; if( $this.find('.follow').length > 0 ) { $pointer_extend = $this.find('.follow'); } $this.on({ mouseenter: function(){ $this.bind('mousemove', function(e){ var center_x = $pointer.offset().left + $pointer.width()/10; var center_y = $pointer.offset().top + $pointer.height()/10; var tween_x = e.pageX - center_x; var tween_y = e.pageY - center_y; if( $pointer_extend != null ) { TweenMax.to($pointer_extend, .3, {x: tween_x / 5.0,y: tween_y /5.0,ease: Power3.easeOut}); } }); }, mouseleave: function(){ if( $pointer_extend != null ) { TweenMax.to($pointer_extend, .2, {x: 0,y: 0,ease: Power0.easeNone}); } $this.unbind('mousemove'); } }); }); } function custom_cursor(){ var $cursor_primary = $('#custom_cursor'); var $circle = $cursor_primary.find('.custom_cursor_circle'); $('body').mousemove(function(e) { TweenMax.to($cursor_primary, 0.7, {opacity:1, x: e.clientX,y: e.clientY,ease: Power3.easeOut}); }); $(document).on('mouseenter', '.custom_mousemove', function(){ var $this = $(this); var words = ( $this.data('hover') != undefined ) ? $this.data('hover') : ''; var size = ( $this.data('size') != undefined ) ? $this.data('size') : '100%'; if( $this.hasClass('small_h') ){ $cursor_primary.addClass('small'); }else{ $cursor_primary.removeClass('small'); } TweenMax.killTweensOf($circle); TweenMax.to($circle, .3, {width: size,height: size,autoAlpha: 1,ease: Power0.easeNone}); }); $(document).on('mouseleave', '.custom_mousemove', function(){ var $this = $(this); TweenMax.killTweensOf($circle); TweenMax.to($circle, .2, {width: '20px',height: '20px',ease: Power0.easeNone}); }); } function allMenuJs(){ //visual height 모바일 높이 대응 function resetHeight(){ $('header,#allmenu').css('height', $(window).innerHeight()); } window.addEventListener("resize", resetHeight); resetHeight(); var footerH = $('footer').outerHeight(true); var $navStatus = 0; $(document).on("click","header .hamburger_btn.open",function(){ if($navStatus == 0) { $navStatus = 1; $(this).removeClass('open'); $(this).addClass('close'); $('body').stop().addClass('menu_open'); $("#allmenu").stop().show(); $("#wrap header .side_bar").attr('data-scroll-target','#wrap'); $("body.pc.menu_open.end #wrap header .side_bar").css('top','calc('+footerH+'px - 80px)'); var ClassName = $('body').attr('class'); if(ClassName == ClassName) { }else{ $navStatus = 0; } } //태블릿,모바일 아코디언 allmenu $(window).on('resize', function() { var windowSize = $(window).width(); if(windowSize < 1280) { //init $('#allmenu .sub_menu').hide(); $('#allmenu .dep1').removeClass('act'); } else { //init $('#allmenu .dep1').removeClass('act'); $('#allmenu .sub_menu').show(); } }).resize(); }); $(document).on("click","header .hamburger_btn.close",function(){ $navStatus = 0; $(this).removeClass('close'); $(this).addClass('open'); $('body').stop().removeClass('menu_open'); $("#allmenu").stop().fadeOut(); $("#wrap header .side_bar").attr('data-scroll-target','#sub_page_wrap'); $("body.pc #wrap header .side_bar").css('top','0px'); }); $(document).on("click","#allmenu .dep1",function(){ $(this).toggleClass('act'); if($(this).hasClass('act')){ $('#allmenu .dep1').removeClass('act'); $(this).addClass('act'); $(this).parents('.menu').siblings().find('.sub_menu').stop(true).slideUp(); $(this).next().stop(true).slideDown(); }else{ $('#allmenu .dep1').removeClass('act'); $(this).next().stop(true).slideUp(); } }); }