$(function(){ $("body").addClass("ani"); //fullpage $('#fullpage').fullpage({ navigation: true, slidesToSections: false, scrollingSpeed: 1000, responsiveWidth: 1400, // ** afterLoad : function(anchorLink, index){ //active class $('.sec'+index).addClass('ani'); if(index == 2){ $(".sec2_cursor").show(); }else{ $(".sec2_cursor").hide(); } if(index == 3 || index == 5){ $.fn.fullpage.setAllowScrolling(false); }else{ $.fn.fullpage.setAllowScrolling(true); } }, // ** onLeave : function(index, direction){ //alert(direction) if(index == 7 && direction == 8){ $("#header").addClass("off"); }else{ $("#header").removeClass("off"); } }, }); /* visual */ var interleaveOffset = 0.75; var swiper1 = new Swiper('.visual', { effect:"fade", slidesPerView: 1, speed: 1200, loop: true, touchRatio: 0, watchSlidesProgress: true, navigation: { nextEl: '.vnext', prevEl: '.vprev', }, pagination: { el: '.vpaging', clickable: true, }, autoplay: { delay: 4000, }, on: { slideChangeTransitionEnd: function () { $('.swiper-slide').removeClass('active'); $('.swiper-slide').eq(this.activeIndex).addClass('active'); }, } }); swiper1.autoplay.stop(); startSwiper = function(){ swiper1.autoplay.start(); }; setTimeout(startSwiper,"5000"); startMotion = function(){ $(".swiper-slide").removeClass("ani"); }; setTimeout(startMotion,"4600"); /**/ imgno=0; rLength = $(".sec2 .conwrap .imgarea img").length - 1; function rollingImg(){ if(imgno == rLength){ imgno = 0; }else{ imgno++; } $(".sec2 .conwrap .imgarea img:eq("+imgno+")").addClass("on").siblings().removeClass("on"); } setInterval(rollingImg,"3000"); /* */ $circle = $(".sec2").find(".sec2_cursor"); $(".sec2 .conwrap").on('mousemove', function(e){ $circle.css("display","flex"); $circle.removeClass("off"); TweenLite.to($circle, 1, { css: { left: e.clientX , top: e.clientY }, ease: Power3.easeOut }); }); $(document).on('mouseleave',".sec2", function(){ $circle.addClass("off"); }); ww = $(window).width(); var swiper2 = undefined; var swiper3 = undefined; var countFuc = function(){ $('.count').each(function() { var $this = $(this), countTo = $this.attr('data-count'); $({ countNum: $this.text() }).animate({ countNum: countTo }, { duration: 1600, easing: 'linear', step: function() { $this.text(Math.floor(this.countNum)); }, complete: function() { $this.text(this.countNum); //alert('finished'); } }); }); }; function initSwiper(){ if (ww > 1383 && swiper2 == undefined) { swiper2 = new Swiper('.corevalue', { effect: 'fade', slidesPerView: 1, speed: 1400, loop: false, pagination: { el: '.sec3paging', clickable: true, }, allowTouchMove:false, simulateTouch:false, centeredSlides: true, grabCursor: false, parallax: true, mousewheel: { releaseOnEdges: true }, mousewheel: true, watchSlidesVisibility: true, watchSlidesProgress: true, on: { slideChangeTransitionEnd: function () { $(".sec3 .swiper-slide").removeClass("off"); if(this.realIndex == 0){ $(".sec3 .swiper-slide:eq(0)").addClass("off"); }else if(this.realIndex == 1){ $(".sec3 .swiper-slide:eq(1)").addClass("off"); }else if(this.realIndex == 2){ $(".sec3 .swiper-slide:eq(2)").addClass("off"); } }, slideChange: function () { }, }, }); }else{ swiper2 = undefined; swiper2 = new Swiper('.corevalue', { effect: 'fade', slidesPerView: 1, speed: 1400, loop: false, pagination: { el: '.sec3paging', clickable: true, }, centeredSlides: true, grabCursor: false, parallax: true, }); } if (ww > 1383 && swiper3 == undefined) { countchk = 0; swiper3 = new Swiper('.main_sec5', { loop:false, slidesPerView: "auto", spaceBetween : 0, speed: 1200, autoplay: false, centeredSlides: true, grabCursor: false, parallax: true, mousewheel: { releaseOnEdges: true }, mousewheel: true, watchSlidesVisibility: true, watchSlidesProgress: true, on: { slideChangeTransitionEnd: function () { $(".item").removeClass("off"); if(this.realIndex == 0){ $(".item1").addClass("off"); $(".sec5 .main_sec5").css("z-index","100"); }else if(this.realIndex == 1){ $(".item2").addClass("off"); //console.log("dd"); if(countchk == 0){ countFuc(); countchk = 1; } } }, slideChange: function () { if(this.realIndex == 0){ //$(".sec5 .main_sec5").css("z-index","100"); }else{ $(".sec5 .main_sec5").css("z-index","1000"); } }, }, }); }else if(ww < 1383 && swiper3 != undefined){ swiper3.destroy(); swiper3 = undefined; $(".item").removeClass("off"); } } /* $(window).resize(function(){ if(ww < 1383){ countFuc(); } })*/ initSwiper(); countchkM = 0; $(document).on("scroll", window, function(){ if($(".item").hasClass("in-view")){ if(countchkM == 0){ countFuc(); countchkM = 1; } } }) /* sec3 */ //// sec3 mousewheel $(document).on("DOMMouseScroll mousewheel wheel", ".pc .sec3", function(event,delta){ $.fn.fullpage.setAllowScrolling(false); if (delta > 0) { //마우스 휠을 올렸을때 if($(".sec3 .swiper-slide:eq(0)").hasClass("off")){ $.fn.fullpage.moveTo(2); } if($(".sec3 .swiper-slide:eq(2)").hasClass("off")){ $.fn.fullpage.setAllowScrolling(false); } }else if (delta < 0) { //마우스 휠을 내렸을때 if($(".sec3 .swiper-slide:eq(2)").hasClass("off")){ $.fn.fullpage.moveTo(4); }else{ $.fn.fullpage.setAllowScrolling(false); } } }) $(".sec3 .num li").click(function(){ $(this).each(function(){ num = $(this).index(); swiper2.slideTo(num) }) }) //sec5 //// sec5 mousewheel $(".fix").on("DOMMouseScroll mousewheel wheel", function(event,delta){ if (delta > 0) { //마우스 휠을 올렸을때 if($(".sec5 .item1").hasClass("off")){ $.fn.fullpage.moveTo(4); } if($(".sec5 .item2").hasClass("off")){ $.fn.fullpage.setAllowScrolling(false); } }else if (delta < 0) { //마우스 휠을 내렸을때 if($(".sec5 .item2").hasClass("off")){ $.fn.fullpage.moveTo(6); }else{ $.fn.fullpage.setAllowScrolling(false); } } }); /* sec6 */ $(".sec6 ul li").mouseover(function(){ sec6Num = $(".sec6 ul li").index($(this)); $(".sec6 .bg>div:eq("+sec6Num+")").addClass("on").siblings().removeClass(); }) $(window).resize(function(){ ww = $(window).width(); if(ww > 1383){ $("body").removeClass(); $("body").addClass("pc"); initSwiper(); }else{ $("body").removeClass(); $("body").addClass("mobile"); $(".item").removeClass("off"); } }).resize(); }); $(document).ready(function() { $("body").addClass("ani"); });