$(function () { /* * Slideshow */ $('.slideshow').each(function () { // º¯¼öÀÇ Áغñ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - var $container = $(this), // a $slideGroup = $container.find('.slideshow-slides'), // b $slides = $slideGroup.find('.slide'), // c $nav = $container.find('.slideshow-nav'), // d $indicator = $container.find('.slideshow-indicator'), // e // ½½¶óÀÌµå ¼îÀÇ °¢ ¿ä¼ÒÀÇ jQuery °´Ã¼ // a ½½¶óÀÌµå ¼î Àüü ÄÁÅ×ÀÌ³Ê // b ¸ðµç ½½¶óÀ̵åÀÇ Á¤¸® (½½¶óÀÌµå ±×·ì) // c °¢ ½½¶óÀ̵å // d ³×ºñ°ÔÀÌ¼Ç (Prev/Next) // e Àεð°ÔÀÌÅÍ («É«Ã«È) slideCount = $slides.length, // ½½¶óÀ̵å Á¡¼ö indicatorHTML = '', // Àεð°ÔÀÌÅÍ ÄÜÅÙÆ® currentIndex = 0, // ÇöÀç ½½¶óÀ̵åÀÇ À妽º duration = 500, // ´ÙÀ½ ½½¶óÀ̵忡 ¾Ö´Ï¸ÞÀ̼ÇÀÇ ¼Ò¿ä ½Ã°£ easing = 'easeInOutExpo', // ´ÙÀ½ ½½¶óÀ̵忡 ¾Ö´Ï¸ÞÀ̼ÇÀÇ ¿©À¯ Á¾·ù interval = 5000, // ÀÚµ¿À¸·Î ´ÙÀ½ ½½¶óÀ̵å·Î ¿Å±æ ¶§±îÁöÀÇ ½Ã°£ timer; // ŸÀÌ¸Ó // HTML ¿ä¼ÒÀÇ ¹èÄ¡ »ý¼º »ðÀÔ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // °¢ ½½¶óÀ̵åÀÇ À§Ä¡¸¦ °áÁ¤ÇÏ°í, // ÇØ´ç Ç¥½Ã±âÀÇ ¾ÞÄ¿¸¦ »ý¼º $slides.each(function (i) { $(this).css({ left: 100 * i + '%' }); indicatorHTML += '' + (i + 1) + ''; }); // Àεð°ÔÀÌÅÍ¿¡ ÄÁÅÙÃ÷¸¦ »ðÀÔ $indicator.html(indicatorHTML); // ÇÔ¼öÀÇ Á¤ÀÇ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // ¸ðµç ½½¶óÀ̵带 Ç¥½ÃÇÏ´Â ÇÔ¼ö function goToSlide (index) { // ½½¶óÀÌµå ±×·ìÀ» ´ë»ó À§Ä¡¿¡ ¸Â°Ô À̵¿ $slideGroup.animate({ left: - 100 * index + '%' }, duration, easing); // ÇöÀç ½½¶óÀ̵åÀÇ À妽º¸¦ µ¤¾î¾²±â currentIndex = index; // Ž»ö ¹× Ç¥½Ã »óŸ¦ ¾÷µ¥ÀÌÆ® updateNav(); } // ½½¶óÀ̵åÀÇ »óÅ¿¡ µû¶ó Ž»ö ¹× Ç¥½Ã¸¦ ¾÷µ¥ÀÌÆ®ÇÏ´Â ÇÔ¼ö function updateNav () { var $navPrev = $nav.find('.prev'), // Prev (µÚ·Î) ¸µÅ© $navNext = $nav.find('.next'); // Next (¾ÕÀ¸·Î) ¸µÅ© // ¸¸¾à ù ¹ø° ½½¶óÀ̵åÀ̶ó¸é Prev Ž»öÀ» ÇØÁ¦ if (currentIndex === 0) { $navPrev.addClass('disabled'); } else { $navPrev.removeClass('disabled'); } // ¸¸¾à ¸¶Áö¸· ½½¶óÀ̵åÀ̶ó¸é Next Ž»öÀ» ÇØÁ¦ if (currentIndex === slideCount - 1) { $navNext.addClass('disabled'); } else { $navNext.removeClass('disabled'); } // ÇöÀç ½½¶óÀ̵åÀÇ Ç¥½Ã¸¦ ÇØÁ¦ $indicator.find('a').removeClass('active') .eq(currentIndex).addClass('active'); } // ŸÀ̸Ӹ¦ ½ÃÀÛÇÏ´Â ÇÔ¼ö function startTimer () { // º¯¼ö interval¿¡¼­ ¼³Á¤ ÇÑ ½Ã°£ÀÌ °æ°ú ÇÒ ¶§¸¶´Ù ÀÛ¾÷À» ¼öÇà timer = setInterval(function () { // ÇöÀç ½½¶óÀ̵åÀÇ À妽º¿¡ µû¶ó ´ÙÀ½ Ç¥½Ã ÇÒ ½½¶óÀ̵åÀÇ °áÁ¤ // ¸¸¾à ¸¶Áö¸· ½½¶óÀ̵åÀ̶ó¸é ù ¹ø° ½½¶óÀ̵忡 var nextIndex = (currentIndex + 1) % slideCount; goToSlide(nextIndex); }, interval); } // ŸÀ̸Ӹ¦ ÁßÁöÀÖ´Â ÇÔ¼ö function stopTimer () { clearInterval(timer); } // Àκ¥Å丮 µî·Ï // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // ³×ºñ°ÔÀÌ¼Ç ¸µÅ©¸¦ Ŭ¸¯Çϸé ÇØ´ç ½½¶óÀ̵带 Ç¥½Ã $nav.on('click', 'a', function (event) { event.preventDefault(); if ($(this).hasClass('prev')) { goToSlide(currentIndex - 1); } else { goToSlide(currentIndex + 1); } }); // Àεð°ÔÀÌÅÍÀÇ ¸µÅ©¸¦ Ŭ¸¯Çϸé ÇØ´ç ½½¶óÀ̵带 Ç¥½Ã $indicator.on('click', 'a', function (event) { event.preventDefault(); if (!$(this).hasClass('active')) { goToSlide($(this).index()); } }); // ¸¶¿ì½º¿À¹ö¸é ŸÀ̸Ӹ¦ Á¤Áö ±×·¸Áö ¾ÊÀ¸¸é ½ÃÀÛ $container.on({ mouseenter: stopTimer, mouseleave: startTimer }); // ½½¶óÀÌµå ¼î ½ÃÀÛ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // ù ¹ø° ½½¶óÀ̵带 Ç¥½Ã goToSlide(currentIndex); // ŸÀ̸Ӹ¦ ½ÃÀÛ startTimer(); }); /* * Sticky header */ $('.page-header').each(function () { var $window = $(window), // Window °´Ã¼ $header = $(this), // Çì´õ // Çì´õÀÇ º¹Á¦ $headerClone = $header.contents().clone(), // Çì´õ º¹Á¦ ÄÁÅ×ÀÌ³Ê $headerCloneContainer = $('
'), // HTMLÀÇ À§ÂÊ¿¡¼­ Çì´õÀÇ Àúº¯±îÁöÀÇ °Å¸® = Çì´õÀÇ ÃÖ°í À§Ä¡ + Çì´õÀÇ ³ôÀÌ threshold = $header.offset().top + $header.outerHeight(); // ÄÁÅ×ÀÌ³Ê Çì´õÀÇ º¹Á¦¸¦ »ðÀÔ $headerCloneContainer.append($headerClone); // ÄÁÅ×À̳ʸ¦ body¿¡ »ðÀÔ $headerCloneContainer.appendTo('body'); // ½ºÅ©·Ñ½Ã¿¡ ÀÛ¾÷À» ¼öÇàÇÏÁö¸¸, Ƚ¼ö¸¦ 1 ÃÊ´ç 15±îÁö Á¦ÇÑ $window.on('scroll', $.throttle(1000 / 15, function () { if ($window.scrollTop() > threshold) { $headerCloneContainer.addClass('visible'); } else { $headerCloneContainer.removeClass('visible'); } })); // ½ºÅ©·Ñ À̺¥Æ®¸¦ ¹ß»ý½ÃÄÑ Ãʱâ À§Ä¡¸¦ °áÁ¤ $window.trigger('scroll'); }); /* * Tabs */ $('.work-section').each(function () { var $container = $(this), // a $navItems = $container.find('.tabs-nav li'), // b $highlight = $container.find('.tabs-highlight'); // c // ÅÇÀÇ °¢ ¿ä¼Ò¸¦ jQuery °´Ã¼ È­ // a ÅÇ°ú ÆгÎÀ» Æ÷ÇÔÇÑ Àüü ÄÁÅ×ÀÌ³Ê // b ÅÇÀÇ ¸ñ·Ï // c ¼±ÅÃÇÑ ÅÇÀÇ ÇÏÀ̶óÀÌÆ® // jQuery UI Tabs¸¦ ½ÇÇà $container.tabs({ // ¼û±æ ¶§ÀÇ ¾Ö´Ï¸ÞÀÌ¼Ç hide: { duration: 250 }, // º¼ ¶§ ¾Ö´Ï¸ÞÀÌ¼Ç show: { duration: 125 }, // ·Îµå½Ã¿Í ÅÇ ¼±Åýÿ¡ ÇÏÀ̶óÀÌÆ®ÀÇ À§Ä¡¸¦ Á¶Á¤ create: moveHighlight, activate: moveHighlight }); // ÇÏÀ̶óÀÌÆ®ÀÇ À§Ä¡¸¦ Á¶Á¤ÇÏ´Â ÇÔ¼ö function moveHighlight (event, ui) { var $newTab = ui.newTab || ui.tab, // »õ·Î ¼±ÅÃµÈ ÅÇÀÇ jQuery °´Ã¼ left = $newTab.position().left; // »õ·Î ¼±ÅÃµÈ ÅÇÀÇ ¿ÞÂÊ À§Ä¡ // ÇÏÀ̶óÀÌÆ®ÀÇ À§Ä¡¸¦ ¾Ö´Ï¸ÞÀÌ¼Ç $highlight.animate({ left: left }, 500, 'easeOutExpo'); } }); /* * Back-toTop button (Smooth scroll) */ $('.back-to-top').on('click', function () { // Smooth Scroll Ç÷¯±×ÀÎÀ» ½ÇÇà $.smoothScroll({ easing: 'easeOutExpo', // ÀÌ¡ÀÇ Á¾·ù speed: 500 // ¼Ò¿ä ½Ã°£ }); }); // Google Maps function initMap () { var mapContainer = document.getElementById('map-container'), mapImageSrc = mapContainer.getElementsByTagName('img')[0].getAttribute('src'), mapParams = decodeURIComponent(mapImageSrc.split('?')[1]).split('&'), mapData = {}, mapStyleName = 'Mono', mapStyles = [ { featureType: 'all', elementType: 'all', stylers: [ { visibility: 'on' }, { hue: '#105ea7' }, { saturation: -100 }, { invert_lightness: true } ] }, { elementType: 'labels.icon', stylers: [ { visibility: 'off' } ] } ], latLng, mapOptions, map, marker, markerLatLng, i, len, pair; for (i = 0, len = mapParams.length; i < len; i++) { pair = mapParams[i].split('='); mapData[pair[0]] = pair[1]; } markerLatLng = mapData.markers? mapData.markers.split(','): null; latLng = mapData.center? mapData.center.split(','): markerLatLng; mapOptions = { center: new google.maps.LatLng(latLng[0], latLng[1]), disableDefaultUI: true, panControl: true, zoom: +mapData.zoom || 16, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL } }; map = new google.maps.Map(mapContainer, mapOptions); map.mapTypes.set(mapStyleName, new google.maps.StyledMapType(mapStyles, { name: mapStyleName })); map.setMapTypeId(mapStyleName); if (mapData.markers) { marker = new google.maps.Marker({ position: new google.maps.LatLng(markerLatLng[0], markerLatLng[1]), map: map }); } } initMap(); });