/* * Initialize switcher on conact section from address view to contat form. * We use bxSlider for this. * More information and documentation on http://bxslider.com/ */ $('.contact-slider').bxSlider({ nextSelector: '#contact-form', prevSelector: '#go-to-address', autoControls: false, pager: false, nextText: "Envoyer un message", prevText: "Voir adresse", }); /* * Initialize slider for team members. * We use bxSlider for this. * More information and documentation on http://bxslider.com/ */ $('#slider').bxSlider({ pagerCustom: '#person-pager', autoControls: false, controls: false, }); /* * Initialize lightbox for images in portfolio. * We use ColorBox for this. * More information and documentation http://www.jacklmoore.com/colorbox/ */ $(".portfolio-search").colorbox({ rel:'portfolio-search', height:"75%" }); /* * Show or hide offsite navigation. * */ $('#nav-expander').on('click', function(e) { e.preventDefault(); $('.main-nav').toggleClass('nav-expanded'); $('.navbar-default').toggleClass('expanded'); }); $('.main-nav .close').on('click', function(e) { e.preventDefault(); $('.main-nav').toggleClass('nav-expanded'); $('.navbar-default').toggleClass('expanded'); }); /* * Link navigation and webpage sections. * */ $(window).load(function() { function filterPath(string) { return string.replace(/^\//, '').replace(/(index|default).[a-zA-Z]{3,4}$/, '').replace(/\/$/, ''); } $('a[href*=#]').each(function() { if (filterPath(location.pathname) == filterPath(this.pathname) && location.hostname == this.hostname && this.hash.replace(/#/, '')) { var $targetId = $(this.hash), $targetAnchor = $('[name=' + this.hash.slice(1) + ']'); var $target = $targetId.length ? $targetId : $targetAnchor.length ? $targetAnchor : false; if ($target) { $(this).click(function() { var targetOffset = $target.offset().top - 63; $('html, body').animate({ scrollTop: targetOffset }, 800); return false; }); } } }); }); /* * Initialize main slider with BxSlider. http://bxslider.com/ */ $('#main-slider').bxSlider({ auto: true, autoControls: false, pager: false, controls: false, mode: 'fade', onSlideAfter: function($slideElement, oldIndex, newIndex) { $slideElement.find('.mask h1').addClass("current animated bounce"); $slideElement.find('.mask p').addClass("current animated bounce"); }, onSlideBefore: function($slideElement, oldIndex, newIndex) { $slideElement.find('.mask h1').removeClass("current animated bounce"); $slideElement.find('.mask p').removeClass("current animated bounce"); } }); /* * Initialize quote slider with BxSlider. http://bxslider.com/ */ $('#quote-slider').bxSlider({ auto: true, autoControls: false, pager: false, controls: false, mode: 'fade', speed: 700, pause: 6000, onSlideAfter: function($slideElement, oldIndex, newIndex) { $slideElement.find('.container .quote-text').addClass("current animated pulse"); $slideElement.find('.container .quote-text').addClass("current animated pulse"); }, onSlideBefore: function($slideElement, oldIndex, newIndex) { $slideElement.find('.container .quote-text').removeClass("current animated pulse"); $slideElement.find('.container .quote-text').removeClass("current animated pulse"); } }); /* * Generate "We are good at" pie charts. For this we use http://rendro.github.io/easy-pie-chart/ */ $('.chart').easyPieChart({ barColor: '#E12B1D', trackColor: '#202835', lineWidth: 10, lineCap: 'butt', size: 130, scaleLength: 0, easing: 'easeOutBounce', onStep: function(from, to, percent) { $(this.el).find('.percent').text(Math.round(percent)); } }); /* * This function initialize google map. More info on * https://developers.google.com/maps/documentation/javascript/ */