$(function(){ //fullpage tl = TweenMax; tl.staggerFromTo($("#wrap header .logo"), 1, {opacity: 0, x: '50px'}, {opacity: 1, x: '0px', delay:1.5,ease: Power1.easeOut}); tl.staggerFromTo($("#wrap header .area_r"), 1, {opacity: 0, x: '-50px'}, {opacity: 1, x: '0px', delay:1.5,ease: Power1.easeOut}); tl.staggerFromTo($("#wrap header #nav [class*='menu'] > a > div p"), 0.6, {opacity: 0, y: '100%'}, {opacity: 1, y: '0%', delay:1.5, ease: Power1.easeOut},0.1); tl.staggerFromTo($(".sec1 .indicator"), 1.2, {opacity: 0, y: '70%'}, {opacity: 1, y: '0%', delay:1.8, ease: Power1.easeOut}); tl.staggerFromTo($(".fullpage_pagination"), 1.2, {opacity: 0, x: '100%'}, {opacity: 1, x: '0%', delay:1.8, ease: Power1.easeOut}); tl.staggerFromTo($(".sec1 .main_slider"), 2, {opacity: 0.2}, {opacity: 1, ease: Power1.easeOut}); tl.staggerFromTo($(".inquiry_btn .dot"), 0.4, {opacity:0, y:'30px'}, {opacity:1, y:'0%', repeat:-1, delay:2, repeatDelay: 2, ease: Power1.easeInOut},0.4); $(window).resize(function(){ var footerHeight = document.getElementById('footer').offsetHeight; $('.footer_area').css( "height", ""+(footerHeight)+"px" ); }).resize(); var $fullpage = $('.fullpage'); var main_fullpage_slider = new Swiper($fullpage, { direction: "vertical", effect: "slide", autoplay: false, slidesPerView: 'auto', speed:900, parallax: true, mousewheel: { releaseOnEdges: true }, allowTouchMove:false, simulateTouch:false, grabCursor: false, touchStartPreventDefault:false, mousewheelControl: true, watchSlidesProgress: true, watchSlidesVisibility: true, pagination: { el: '.fullpage_pagination .pagination', clickable: true, }, breakpoints: { 1279: { allowTouchMove:true, simulateTouch:true, grabCursor: true, }, }, on: { init : function () { if($('.section.dark').hasClass('swiper-slide-active')){ $('body').addClass('dark'); $('header').addClass('dark'); }else{ $('body').removeClass('dark'); $('header').removeClass('dark'); } }, transitionStart : function () { var secNum = this.activeIndex +1 $('.fullpage_wrap .pg'+secNum).addClass('on'); if($('.section:last-child').hasClass('swiper-slide-visible')){ $('.fullpage_pagination').fadeOut(); }else{ $('.fullpage_pagination').fadeIn(); } }, transitionEnd: function () { }, } }); $('.main_slider').slick({ fade: true, autoplay:true, infinite: true, autoplaySpeed:5200, slidesToShow: 1, slidesToScroll: 1, pauseOnHover:false, pauseOnFocus:false, cssEase:'linear', dots: true, appendDots: $('.indicator .dot'), prevArrow: $('.indicator').find('.prev'), nextArrow: $('.indicator').find('.next'), }); if(typeof $.fn.Slick === 'undefined'){ $('.main_slider').find('.item1').addClass('on'); $('.main_slider').on('beforeChange', function(event, slick, currentSlide, nextSlide){ $('.main_slider').find('div[class*="item"]').removeClass('on'); $('.main_slider').find('.item'+(nextSlide+1)).addClass('on'); }); $('.main_slider').on('afterChange', function(event, slick, currentSlide, nextSlide){ }); } var $cursor_primary = $('#custom_cursor'); var $cursor_secondary = $('#custom_cursor_text'); var $circle = $cursor_primary.find('.custom_cursor_circle'); var $cursor_txt = $cursor_secondary.find('.custom_cursor_txt'); $('body').mousemove(function(e) { TweenMax.to($cursor_primary, 0.7, {x: e.clientX,y: e.clientY,ease: Power3.easeOut}); TweenMax.to($cursor_secondary, 0.8, {x: e.clientX,y: e.clientY,ease: Power3.easeOut}); }); $(".view_more a, .mix_h").mouseenter(function () { $("#custom_cursor").addClass("on"); $("#custom_cursor_text").addClass("on"); }); $(".view_more, .mix_h").mouseleave(function(){ $("#custom_cursor").removeClass("on"); $("#custom_cursor_text").removeClass("on"); }); $(".sec2 .mouse_arrow.mouse_prev").mouseover(function(event){ $("#custom_cursor").addClass("prev"); $("#custom_cursor_text").addClass("prev"); }); $(".sec2 .mouse_arrow.mouse_prev").mouseleave(function(event){ $("#custom_cursor").removeClass("prev"); $("#custom_cursor_text").removeClass("prev"); }); $(".sec2 .mouse_arrow.mouse_next").mouseover(function(event){ $("#custom_cursor").addClass("next"); $("#custom_cursor_text").addClass("next"); }); $(".sec2 .mouse_arrow.mouse_next").mouseleave(function(event){ $("#custom_cursor").removeClass("next"); $("#custom_cursor_text").removeClass("next"); }); $(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%'; $(".view_more a, .mix_h").mouseenter(function () { $("#custom_cursor").addClass("on"); $("#custom_cursor_text").addClass("on"); }); if( $this.hasClass('drag') ){ $cursor_primary.addClass('drag'); $cursor_secondary.addClass('drag'); } $cursor_txt.find('> span').text( words ); TweenMax.killTweensOf($circle, $cursor_txt); TweenMax.to($circle, .3, {width: size,height: size,autoAlpha: 1,ease: Power0.easeNone}); TweenMax.to($cursor_txt, .3, {width: size,height: size,autoAlpha: 1,ease: Power0.easeNone}); }); $(document).on('mouseleave', '.custom_mousemove', function(){ var $this = $(this); if( $this.hasClass('drag') ){ $cursor_primary.removeClass('drag'); $cursor_secondary.removeClass('drag'); } $(".view_more, .mix_h").mouseleave(function(){ $("#custom_cursor").removeClass("on"); $("#custom_cursor_text").removeClass("on"); }); TweenMax.killTweensOf($circle, $cursor_txt); TweenMax.to($circle, .2, {width: '0%',height: '0%',autoAlpha: 0,ease: Power0.easeNone}); TweenMax.to($cursor_txt, .2, {width: '0%',height: '0%',autoAlpha: 0,ease: Power0.easeNone}); }); });