;(function () { // animate-box /*var contentWayPoint = function() { $('.animate-box').waypoint( function( direction ) { if( direction === 'down' && !$(this).hasClass('animated') ) { $(this.element).addClass('fadeInUp animated'); } } , { offset: '75%' } ); };*/ // Burger Menu var burgerMenu = function() { $('body').on('click', '.js-fh5co-nav-toggle', function(event){ if ( $('#navbar').is(':visible') ) { $(this).removeClass('active'); } else { $(this).addClass('active'); } event.preventDefault(); }); }; // Reflect scrolling in navigation var navActive = function(section) { var $el = $('#navbar > ul'); $el.find('li').removeClass('active'); $el.each(function(){ $(this).find('a[data-nav-section="'+section+'"]').closest('li').addClass('active'); }); }; // Window Scroll var windowScroll = function() { var lastScrollTop = 0; $(window).scroll(function(event){ var header = $('#fh5co-header'), scrlTop = $(this).scrollTop(); if ( scrlTop > 500 && scrlTop <= 2000 ) { header.addClass('navbar-fixed-top fh5co-animated slideInDown'); } else if ( scrlTop <= 500) { if ( header.hasClass('navbar-fixed-top') ) { header.addClass('navbar-fixed-top fh5co-animated slideOutUp'); setTimeout(function(){ header.removeClass('navbar-fixed-top fh5co-animated slideInDown slideOutUp'); }, 100 ); } } }); }; // Animations // About Us var aboutAnimate = function() { if ( $('#about-us').length > 0 ) { $('#about-us .to-animate').each(function( k ) { var el = $(this); setTimeout ( function () { el.addClass('fadeInUp animated'); }, k * 200, 'easeInOutExpo' ); }); } }; // Team var teamAnimate = function() { if ( $('#team').length > 0 ) { $('#team .to-animate').each(function( k ) { var el = $(this); setTimeout ( function () { el.addClass('fadeInUp animated'); }, k * 200, 'easeInOutExpo' ); }); } }; var teamWayPoint = function() { if ( $('#team').length > 0 ) { $('#team').waypoint( function( direction ) { if( direction === 'down' && !$(this).hasClass('animated') ) { setTimeout(teamAnimate, 200); $(this.element).addClass('animated'); } } , { offset: '95%' } ); } }; // Services var servicesAnimate = function() { if ( $('#fh5co-our-services').length > 0 ) { $('#fh5co-our-services .to-animate').each(function( k ) { var el = $(this); setTimeout ( function () { el.addClass('fadeInUp animated'); }, k * 200, 'easeInOutExpo' ); }); } }; var servicesWayPoint = function() { if ( $('#fh5co-our-services').length > 0 ) { $('#fh5co-our-services').waypoint( function( direction ) { if( direction === 'down' && !$(this).hasClass('animated') ) { setTimeout(servicesAnimate, 200); $(this.element).addClass('animated'); } } , { offset: '95%' } ); } }; // Features var featuresAnimate = function() { if ( $('#fh5co-features').length > 0 ) { $('#fh5co-features .to-animate').each(function( k ) { var el = $(this); setTimeout ( function () { el.addClass('fadeInUp animated'); }, k * 200, 'easeInOutExpo' ); }); } }; var featuresWayPoint = function() { if ( $('#fh5co-features').length > 0 ) { $('#fh5co-features').waypoint( function( direction ) { if( direction === 'down' && !$(this).hasClass('animated') ) { setTimeout(function(){ $('.animate-features-1').addClass('animated fadeIn'); }, 100); setTimeout(function(){ $('.animate-features-2').addClass('animated fadeIn'); }, 200); setTimeout(featuresAnimate, 500); setTimeout(function(){ $('.animate-features-3').addClass('animated fadeInUp'); }, 1400); $(this.element).addClass('animated'); } } , { offset: '95%' } ); } }; // testimonials var testimonialsAnimate = function() { if ( $('#fh5co-testimonials').length > 0 ) { $('#fh5co-testimonials .to-animate').each(function( k ) { var el = $(this); setTimeout ( function () { el.addClass('fadeInUp animated'); }, k * 200, 'easeInOutExpo' ); }); } }; var testimonialsWayPoint = function() { if ( $('#fh5co-testimonials').length > 0 ) { $('#fh5co-testimonials').waypoint( function( direction ) { setTimeout(testimonialsAnimate, 200); $(this.element).addClass('animated'); } , { offset: '95%' } ); } }; // Pricing var pricingAnimate = function() { if ( $('#fh5co-pricing').length > 0 ) { $('#fh5co-pricing .to-animate').each(function( k ) { var el = $(this); setTimeout ( function () { el.addClass('fadeInUp animated'); }, k * 200, 'easeInOutExpo' ); }); } }; var pricingWayPoint = function() { if ( $('#fh5co-pricing').length > 0 ) { $('#fh5co-pricing').waypoint( function( direction ) { setTimeout(function(){ $('.animate-pricing-1').addClass('animated fadeIn'); }, 200); setTimeout(function(){ $('.animate-pricing-2').addClass('animated fadeIn'); }, 300); setTimeout(pricingAnimate, 700); $(this.element).addClass('animated'); } , { offset: '95%' } ); } }; // Pricing var pressAnimate = function() { if ( $('#fh5co-press').length > 0 ) { $('#fh5co-press .to-animate').each(function( k ) { var el = $(this); setTimeout ( function () { el.addClass('fadeInUp animated'); }, k * 200, 'easeInOutExpo' ); }); } }; var pressWayPoint = function() { if ( $('#fh5co-press').length > 0 ) { $('#fh5co-press').waypoint( function( direction ) { setTimeout(function(){ $('.animate-press-1').addClass('animated fadeIn'); }, 200); setTimeout(function(){ $('.animate-press-2').addClass('animated fadeIn'); }, 300); setTimeout(pressAnimate, 700); $(this.element).addClass('animated'); } , { offset: '95%' } ); } }; // 레이어 팝업 var layerObj = function(){ var toggleBtn = $('.js-toggle-btn'), layerPopup = $('.layer_popup'), closeBtn = $('.js-layer-close'); var layerView = function(target) { var targetId = target.attr('data-layer'), targetLayer = $(targetId), targetPopup = targetLayer.find('.layer_popup'); targetLayer.show().attr('aria-hidden','false'); if (/Mobi|Android/i.test(navigator.userAgent)||(/Mobi/.test(navigator.userAgent))) { scrollLock(true); }; setTimeout(function(){ targetPopup.on('clickoutside', function(){ $(this).find('.js-layer-close').triggerHandler('click'); }); }, 100); } var layerClose = function(targetLayer) { targetLayer.hide().attr('aria-hidden','true'); if (/Mobi|Android/i.test(navigator.userAgent)||(/Mobi/.test(navigator.userAgent))) { scrollLock(false); }; targetLayer.find('.layer_popup').off('clickoutside'); } toggleBtn.on('click', function(e){ e.preventDefault(); var target = $(e.currentTarget); // 참가신청 마감 if(target.hasClass('lnk_apply_private')) { alert('삼성금융 Open Collaboration 참가 지원이 마감되었습니다.'); } else { layerView(target); } }) closeBtn.on('click', function(e){ e.preventDefault(); var targetLayer = $(e.currentTarget).closest('.js-layer-area'); layerClose(targetLayer); $('html, body').css({ 'overflow': 'initial', 'height': '100%' }); $('#content').off('scroll touchmove mousewheel'); }); var openNoticeLayer = function(){ var targetLayer = $('#layer_presentation'), targetPopup = targetLayer.find('.layer_popup'); targetLayer.show().attr('aria-hidden','false'); if (/Mobi|Android/i.test(navigator.userAgent)||(/Mobi/.test(navigator.userAgent))) { scrollLock(true); }; setTimeout(function(){ targetPopup.on('clickoutside', function(){ $(this).find('.js-layer-close').triggerHandler('click'); }); }, 100); }; //오픈 컬래버레이션 var openCollaborationLayer = function(){ var targetLayer = $('#layer_opencollaboration'), targetPopup = targetLayer.find('.layer_popup'); targetLayer.show().attr('aria-hidden','false'); if (/Mobi|Android/i.test(navigator.userAgent)||(/Mobi/.test(navigator.userAgent))) { scrollLock(true); }; var targetWinHeight = 0, targetWinWidth = 0, targetLayerCont = $('#layer_opencollaboration .layer_cont'); function setContSize() { targetWinHeight = window.innerHeight; targetWinWidth = window.innerWidth; targetLayerCont.height(`${targetWinHeight - 100}px`); if (targetWinWidth <= 375){ targetLayerCont.height(`${targetWinHeight - 185}px`); } } $('html, body').css({ 'overflow': 'hidden', 'height': '100%' }); // 모달팝업 중 html,body의 scroll을 hidden시킴 $('#content').on('scroll touchmove mousewheel', function (event) { // 터치무브와 마우스휠 스크롤 방지 event.preventDefault(); event.stopPropagation(); return false; }); //오늘 하루 닫기버튼 // 닫기 버튼 클릭시 $("#todayClose").click(function (event) { // 링크의 페이지 이동 속성 강제 차단 event.preventDefault(); if ($('#check_today #check_btn').is(":checked")) { // 쿠키값을 "Y"로 하여 하루동안 저장시킴 $.cookie("noPopup", "Y", { expires: 1 // espires : 만료일, 1 : day기준 }); } // 팝업창 닫기 $("#layer_opencollaboration").css('display', 'none'); }); setVideo(); setContSize(); $(window).resize(setContSize); }; if($('body').hasClass('main')) { if ($.cookie("noPopup_invite") != "Y") { openInviteLayer(); } else { $("#layer_invite").css('display', 'none'); } // 저장된 쿠키값이 Y가 아니라면 팝업창을 생성 if ($.cookie("noPopup") != "Y") { openCollaborationLayer(); } else { $("#layer_opencollaboration").css('display', 'none'); } } } // Document on load. $(function(){ burgerMenu(); windowScroll(); teamWayPoint(); servicesWayPoint(); featuresWayPoint(); testimonialsWayPoint(); pricingWayPoint(); pressWayPoint(); layerObj(); }); }());