/*================================================================ PR001 Module JS Version : 1.0 Release : 2018-01-16 Copyright by ONEPIXEL-STUDIO All Rights Reserved. ================================================================*/ (function($) { 'use strict'; /*================================ GET URL PARAMETER FUNCTION ================================*/ $.urlParam = function(name){ var results = new RegExp('[\?&]' + name + '=([^]*)').exec(window.location.href); if (results==null){ return null; } else{ return decodeURI(results[1]) || 0; } } /*================================ PREVENT VERTICAL SCROLL FOR CAROUSEL ================================*/ window.blockMenuHeaderScroll = false; $(window).on('touchstart', function(e) { if ($(e.target).closest('.owl-carousel').length == 1) { blockMenuHeaderScroll = true; } }); $(window).on('touchend', function() { blockMenuHeaderScroll = false; }); $(window).on('touchmove', function(e) { if (blockMenuHeaderScroll) { e.preventDefault(); } }); /*================================ PRELOADER ================================*/ var preloader = $('#preloader'); if(enableLoadEffect == false) preloader.remove(); $(window).bind('load', function() { preloader.find('.spinner').fadeOut(400); preloader.delay(400).fadeOut(400, function() { preloader.remove(); }); }); /*================================ WOW ANIMATION ================================*/ if(useScrollAnimation === true) { var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 100, scrollContainer: null }); wow.init(); } else { $('.wow').css({visibility:'visible'}); } /*================================ MAIN PAGE ================================*/ /* Key Visual */ $(document).ready(function() { $('#keyVisual .owl-carousel').owlCarousel({ loop: true, // ¹«ÇѼøȯ ¿©ºÎ items: 1, // ¾ÆÀÌÅÛ °³¼ö margin: 0, // ¾ÆÀÌÅÛ°£ ¿©¹é smartSpeed: 800, // ½½¶óÀÌµå ¾Ö´Ï¸ÞÀÌ¼Ç ¼Óµµ (´ÜÀ§ : ¹Ð¸®ÃÊ) cssEase: 'ease-in', // °¡¼Ó ¾Ö´Ï¸ÞÀÌ¼Ç (easing) nav: false, // Á¿ì ÄÁÆ®·Ñ »ç¿ë ¿©ºÎ navText: ['', ''], // Á¿ì ÄÁÆ®·Ñ ¹®±¸ autoplay: true, // ÀÚµ¿Àç»ý ¿©ºÎ autoplayTimeout: keyVisualTimeout, // ÀÚµ¿Àç»ý °£°Ý (´ÜÀ§ : ¹Ð¸®ÃÊ) autoplayHoverPause: true // ¸¶¿ì½º ¿À¹ö½Ã ÀÚµ¿Àç»ý ÀϽÃÁ¤Áö ¿©ºÎ }); }); /* Notice Slider */ $(document).ready(function() { var slideIdx = 0; var slideWrap = $('#noticeBanner .noticeSlider'); var slideBody = slideWrap.find('table'); var slideItems = slideBody.find('tr'); var slideCount = slideItems.length; var slideHeight; var slideDuration; if(slideWrap.data('duration')) { slideDuration = slideWrap.data('duration'); } else { slideDuration = 2500; // ±âº» ÀÚµ¿Àç»ý ÁÖ±â } var slideReady = function() { slideHeight = slideItems.outerHeight(); slideBody.find('tbody').prepend(slideBody.find('tr:last')); slideBody.css({top:-slideHeight}); }; var noticeSlide = function() { slideHeight = slideItems.outerHeight(); slideBody.stop().animate({top:-slideHeight}, 500, function() { slideBody.find('tr:last').after(slideBody.find('tr:first')); slideBody.css({top:0}); }); }; slideReady(); var autoPlay = setInterval(function() { noticeSlide(); }, slideDuration); }); /* Works */ $(document).ready(function() { var postContent = $('#works.main-section .board_output_gallery_description'); $('#works.main-section .works-items').owlCarousel({ loop: false, // ¹«ÇѼøȯ ¿©ºÎ margin: 30, // ¾ÆÀÌÅÛ°£ ¿©¹é smartSpeed: 400, // ½½¶óÀÌµå ¾Ö´Ï¸ÞÀÌ¼Ç ¼Óµµ (´ÜÀ§ : ¹Ð¸®ÃÊ) cssEase: 'ease-in', // °¡¼Ó ¾Ö´Ï¸ÞÀÌ¼Ç (easing) autoplay: false, // ÀÚµ¿Àç»ý ¿©ºÎ dots: false, // ÆäÀÌÁö³×ÀÌ¼Ç »ç¿ë ¿©ºÎ navText: ['', ''], responsiveClass: true, // ¹ÝÀÀÇü ó¸® ¿©ºÎ responsive: { 0: { items: 1, nav: true }, 768: { items: 2, nav: true }, 1024: { items: 3, nav: true } } }); if(postContent.length) postContent.html(postContent.html().replace(/ /gi,'')); }); /* Parallax */ $(document).ready(function() { $('#parallax.main-section').parallax('50%', 0.3); }); /* Partners */ $(document).ready(function() { $('#partners.main-section .partners-items').owlCarousel({ loop: false, // ¹«ÇѼøȯ ¿©ºÎ margin: 30, // ¾ÆÀÌÅÛ°£ ¿©¹é smartSpeed: 200, // ½½¶óÀÌµå ¾Ö´Ï¸ÞÀÌ¼Ç ¼Óµµ (´ÜÀ§ : ¹Ð¸®ÃÊ) dots: true, // ÆäÀÌÁö³×ÀÌ¼Ç »ç¿ë ¿©ºÎ nav: false, // Á¿ì ÄÁÆ®·Ñ »ç¿ë ¿©ºÎ responsiveClass: true, // ¹ÝÀÀÇü ó¸® ¿©ºÎ responsive: { 0: { items: 2 }, 480: { items: 3 }, 768: { items: 5 }, 1024: { items: 6 } } }); }); /* interior */ $(document).ready(function() { var $largeSlider = $(".main-interior-slider"); var $thumbs = $(".main-interior-thumbs"); var syncedSecondary = true; $largeSlider .owlCarousel({ items: 1, slideSpeed: 10000, nav: true, autoplay: true, dots: false, loop: true, smartSpeed: 600, fluidSpeed: 600, navSpeed: 600, responsiveRefreshRate: 200, navText: ['', ''], }) .on("changed.owl.carousel", syncPosition); $thumbs .on("initialized.owl.carousel", function() { $thumbs .find(".owl-item") .eq(0) .addClass("current"); }) .owlCarousel({ items: 6, dots: true, nav: false, margin: 5, smartSpeed: 600, fluidSpeed: 600, navSpeed: 600, slideBy: 6, responsiveRefreshRate: 100, responsive: { 0: { items: 2 }, 768: { items: 3 }, 1024: { items: 6 } } }) .on("changed.owl.carousel", syncPosition2); function syncPosition(el) { //if loop is set to false, then you have to uncomment the next line //var current = el.item.index; //to disable loop, comment this block var count = el.item.count - 1; var current = Math.round(el.item.index - el.item.count / 2 - 0.5); if (current < 0) { current = count; } if (current > count) { current = 0; } //to this $thumbs .find(".owl-item") .removeClass("current") .eq(current) .addClass("current"); var onscreen = $thumbs.find(".owl-item.active").length - 1; var start = $thumbs .find(".owl-item.active") .first() .index(); var end = $thumbs .find(".owl-item.active") .last() .index(); if (current > end) { $thumbs.data("owl.carousel").to(current, 100, true); } if (current < start) { $thumbs.data("owl.carousel").to(current - onscreen, 100, true); } } function syncPosition2(el) { if (syncedSecondary) { var number = el.item.index; $largeSlider.data("owl.carousel").to(number, 100, true); } } $thumbs.on("click", ".owl-item", function(e) { e.preventDefault(); var number = $(this).index(); $largeSlider.data("owl.carousel").to(number, 300, true); }); }); /*================================ HEADER ================================*/ var scrollTopBtn = $('#btnToTop'); var gnbNav = $('#gnb > li'); var gnbMobile = $('#header nav'); var gnbToggle = $('#nav-toggle'); var gnbMask = $('#header .nav-overlay'); var headerInit = function() { gnbNav.each(function() { if ($(this).find('.subnav').length) $(this).addClass('has-subdepth'); }); }; /* sticky header */ var stickyHeader = function() { var window_w = $(window).width(); var header = $('#header'); var header_h = header.find('.header-top').outerHeight(); var scrollTop = $(window).scrollTop(); if (window_w > 1299) { if (scrollTop >= header_h) { if (!header.hasClass('sticky')) { header.addClass('sticky'); } } else { header.removeClass('sticky'); } } else { header.removeClass('sticky'); } }; /* gnb active (2019-05-27 Ãß°¡) */ var activeGnb = function() { var url = $(location).attr('href'); gnbNav.each(function() { if( url.indexOf($(this).find('>a').attr('href') ) > -1) $(this).addClass('is-active'); }); console.log($('#header').find('.is-active').length); if ( !$('#header').find('.is-active').length ) gnbNav.eq(0).addClass('is-active'); }; activeGnb(); /* show gnb */ var showGnb = function() { gnbToggle.addClass('open'); gnbMobile.stop().slideDown(600, 'easeOutQuint'); gnbMask.stop().fadeIn(600); }; /* hide gnb */ var hideGnb = function() { gnbToggle.removeClass('open'); gnbMobile.stop().slideUp(600, 'easeOutQuint'); gnbMask.stop().fadeOut(600); }; /* hamburger button */ gnbToggle.click(function() { $('#header .member-wrapper').removeClass('open'); if (!$(this).hasClass('open')) { showGnb(); } else { hideGnb(); } }); /* member function for under pc devices */ $('#header .member-wrapper > a').on('click', function() { var window_w = $(window).width(); var parent = $(this).parent(); if (window_w < 1025) parent.toggleClass('open'); }); /* gnb click event for under pc devices */ $('#gnb > li > a').click(function(e) { var window_w = $(window).width(); var parent = $(this).parent(); if (window_w < 1025) { if (parent.hasClass('has-subdepth')) { e.preventDefault(); if (!parent.hasClass('open')) { gnbNav.find('.subnav').stop().slideUp(300); gnbNav.removeClass('open'); parent.addClass('open'); $(this).siblings('.subnav').stop().slideDown(300); } else { parent.removeClass('open'); $(this).siblings('.subnav').stop().slideUp(300); } } } }); gnbMask.click(function() { hideGnb(); }); /* go to top button */ var showTopButton = function() { var header_h = $('#header').height(); var scrollTop = $(window).scrollTop(); if (scrollTop >= header_h) { if (!scrollTopBtn.hasClass('show')) { scrollTopBtn.addClass('show'); } } else { scrollTopBtn.removeClass('show'); } }; headerInit(); $(window).bind('scroll', function() { stickyHeader(); showTopButton(); }).scroll(); scrollTopBtn.click(function() { $('html, body').animate({ scrollTop: 0 }, 650, 'easeInOutQuint'); }); /*================================ FLOATING QUICK MENU ================================*/ $(window).on('scroll', function() { var $quick = $('#quick-menu'); var $is_sticky = $('#header').attr('class'); var $winWidth = $(this).width(); var $pos; $is_sticky == 'sticky' ? $pos = 110 : $pos = 383; if ( $winWidth >= 1300 ) { $quick.stop().animate({top:$(window).scrollTop() + $pos + 'px'}, 400); } }).scroll(); /*================================ FOOTER ================================*/ function instafeed() { var userFeed = new Instafeed({ get: 'user', userId: 8963087088, sortBy: "most-recent", limit: 12, target: "instafeed", resolution: 'standard_resolution', template: '
', accessToken: '8963087088.ebfd6cd.b92df9667744458ba57e4cc337e15e35', after: function() { $('.insta-feed-section .insta-slider').owlCarousel({ loop: true, margin: 20, nav: true, navText: ['', ''], dots: false, responsive: { 0: { items: 2, margin: 10 }, 768: { items: 3 }, 1024: { items: 6 } } }); } }); userFeed.run(); } $(document).ready(function() { if ($('#instafeed').length) instafeed(); }); $(document).ready(function() { // client slider $('.client-slider-section .client-slider').owlCarousel({ loop: true, margin: 50, nav: true, navText: ['', ''], dots: false, responsive: { 0: { items: 2, margin: 10 }, 768: { items: 3, margin: 20 }, 1024: { items: 6, margin: 40 } } }); }); /*================================ SUB PAGE ================================*/ /* Sub Navigation Active */ $(document).ready(function() { var url = $(location).attr('href'); var navItems = $('#subVisual nav ul > li'); navItems.each(function() { if(url.indexOf($(this).find('>a').attr('href')) > -1) $(this).addClass('active'); }); $('#subVisual nav > a').text($('#subVisual nav ul > li.active').text()); }); /* Sub Navigation for for under pc devices */ var navWrap = $('#subVisual nav'); var navDrop = navWrap.find('>a'); $(document).ready(function() { navDrop.click(function() { $(this).parent().toggleClass('open'); $(this).parent().find('ul').stop().slideToggle(400); }); }).on('click', function(e) { if(!$(e.target).is('#subVisual nav>a')) { navWrap.removeClass('open'); navWrap.find('ul').stop().slideUp(400); } }); /* About Company Type2 - skill bar */ $(document).ready(function() { var skillBar = $('#container .about-skill-type2 .skill>.skill-wrap'); skillBar.each(function() { var bar = $(this).find('>.progress-bar'); bar.css({width:bar.data('percent') + '%'}); bar.find('>.percent').text(bar.data('percent') + '%'); }); }); /* Subpage Parallax */ $(document).ready(function() { $('#subVisual').parallax('50%', 0.3); $('#container .about-video-type2').parallax('50%', 0.3); $('#container .about-count-type2').parallax('50%', 0.3); $('#container .business-overview-mid').parallax('50%', 0.3); $('#container .business-contact').parallax('50%', 0.3); }); /* About Company Type2 - Promotion Modal */ $(document).ready(function() { var modal = ''; var modalMask = ''; var modalHTML = ''; var modalBtn = $('#container .about-video-type2 .btn-video'); var openPromotion = function(src) { if($('#modalPromotion').length) $('#modalPromotion').remove(); modalHTML += '