$(function(){ //메인 시작 모션 $("body").addClass("intro"); //전체 세로 슬라이드 var fullSwiper = new Swiper('.full_slider', { slidesPerView:'auto', direction: "vertical", effect: "slide", autoplay: false, speed: 800, parallax: true, allowTouchMove:true, simulateTouch:true, grabCursor: true, touchStartPreventDefault:true, watchSlidesProgress: true, watchSlidesVisibility: true, mousewheel: { releaseOnEdges: true }, mousewheelControl: true, pagination: { el: '.full_pagination', clickable:true, }, on: { init: function(){ //section1 시작 class $(".section1").addClass("on"); //스크롤 버튼 - section2 이동 $(".main_slider .scroll_btn").on("click",function(){ fullSwiper.slideTo(1,500); }); $(".top_btn").on("click",function(){ fullSwiper.slideTo(0,500); }); }, transitionStart: function(){ var currIndex = this.activeIndex; //헤더 다크 모드 if(currIndex != 0){ $("body").addClass("dark"); $(".top_btn").fadeIn(300); }else { $("body").removeClass("dark"); $(".top_btn").fadeOut(300); } //전체 슬라이드 페이징 다크 모드 if(currIndex == 1){ $(".full_pagination").addClass("dark"); }else { $(".full_pagination").removeClass("dark"); } //section motion class if($(".section:eq("+currIndex+")").hasClass("swiper-slide-active")){ $(".section:eq("+currIndex+")").addClass("on"); } if($(".section3").hasClass("on")){ gsap.to(".business_story_item",0.9, {opacity: 1,x:'0%', stagger: 0.05, delay:1.3}); } //푸터 슬라이드시 parallax 값 삭제 if($(".footer_section").hasClass("swiper-slide-visible")){ $(".section4 .inner").css("transform","translateY(0px)"); $(window).on("resize",function(){ var footHgt = $("#footer").height(); $(".top_btn").css("bottom",footHgt + 20); }).resize(); }else { $(".top_btn").css("bottom",20); } }, }, breakpoints: { 1280: { allowTouchMove:false, simulateTouch:false, grabCursor: false, touchStartPreventDefault:false, }, }, }); //메인 이미지 슬라이드 var mainVisualSwiper = new Swiper('.main_bg_slider', { effect:'fade', watchSlidesProgress: true, allowTouchMove:false, }); //메인 타이틀 슬라이드 var mainTitleSwiper = new Swiper('.main_tit_slider', { effect:'fade', autoplay: { delay: 5000, disableOnInteraction: false, }, pagination: { el: '.main_pagination', }, navigation: { nextEl: ".main_next", prevEl: ".main_prev", }, thumbs: { swiper: mainVisualSwiper, }, allowTouchMove:false, }); //기업스토리 슬라이드 var businessStorySwiper = new Swiper('.business_story_slider', { /*autoplay: { delay: 5000, disableOnInteraction: false, },*/ slidesPerView:'auto', pagination: { el: '.business_story_pagination', type:"progressbar", }, navigation: { nextEl: ".business_story_next", prevEl: ".business_story_prev", }, //allowTouchMove:false, }); });