123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466 |
- ;(function () {
-
- 'use strict';
-
- var isMobile = {
- Android: function() {
- return navigator.userAgent.match(/Android/i);
- },
- BlackBerry: function() {
- return navigator.userAgent.match(/BlackBerry/i);
- },
- iOS: function() {
- return navigator.userAgent.match(/iPhone|iPad|iPod/i);
- },
- Opera: function() {
- return navigator.userAgent.match(/Opera Mini/i);
- },
- Windows: function() {
- return navigator.userAgent.match(/IEMobile/i);
- },
- any: function() {
- return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
- }
- };
-
-
-
- // iPad and iPod detection
- var isiPad = function(){
- return (navigator.platform.indexOf("iPad") != -1);
- };
-
- var isiPhone = function(){
- return (
- (navigator.platform.indexOf("iPhone") != -1) ||
- (navigator.platform.indexOf("iPod") != -1)
- );
- };
-
- var fullHeight = function() {
-
- if ( !isMobile.any() ) {
- $('.js-fullheight').css('height', $(window).height());
- $(window).resize(function(){
- $('.js-fullheight').css('height', $(window).height());
- });
- }
-
- };
-
- // Parallax
- var parallax = function() {
- if ( !isMobile.any() ) {
- $(window).stellar();
- }
- };
-
-
- // Page Nav
- var clickMenu = function() {
-
- $('#navbar a:not([class="external"])').click(function(event){
- var section = $(this).data('nav-section'),
- navbar = $('#navbar');
-
- if ( $('[data-section="' + section + '"]').length ) {
- $('html, body').animate({
- scrollTop: $('[data-section="' + section + '"]').offset().top - 0
- }, 500);
- }
-
- if ( navbar.is(':visible')) {
- navbar.removeClass('in');
- navbar.attr('aria-expanded', 'false');
- $('.js-fh5co-nav-toggle').removeClass('active');
- }
-
- event.preventDefault();
- return false;
- });
-
-
- };
-
- // 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');
- });
-
- };
-
- var navigationSection = function() {
-
- var $section = $('section[data-section]');
-
- $section.waypoint(function(direction) {
-
- if (direction === 'down') {
- navActive($(this.element).data('section'));
- }
- }, {
- offset: '150px'
- });
-
- $section.waypoint(function(direction) {
- if (direction === 'up') {
- navActive($(this.element).data('section'));
- }
- }, {
- offset: function() { return -$(this.element).height() + 155; }
- });
-
- };
-
- // 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
- // Home
- var homeAnimate = function() {
- if ( $('#fh5co-home').length > 0 ) {
-
- $('#fh5co-home').waypoint( function( direction ) {
-
- if( direction === 'down' && !$(this.element).hasClass('animated') ) {
-
-
- setTimeout(function() {
- $('#fh5co-home .to-animate').each(function( k ) {
- var el = $(this);
-
- setTimeout ( function () {
- el.addClass('fadeInUp animated');
- }, k * 200, 'easeInOutExpo' );
-
- });
- }, 200);
-
-
- $(this.element).addClass('animated');
-
- }
- } , { offset: '80%' } );
-
- }
- };
-
- var exploreAnimate = function() {
-
- var explore = $('#fh5co-explore');
- if ( explore.length > 0 ) {
-
- explore.waypoint( function( direction ) {
-
- if( direction === 'down' && !$(this.element).hasClass('animated') ) {
-
-
- setTimeout(function() {
- explore.find('.to-animate').each(function( k ) {
- var el = $(this);
-
- setTimeout ( function () {
- el.addClass('fadeInUp animated');
- }, k * 200, 'easeInOutExpo' );
-
- });
- }, 200);
-
- setTimeout(function() {
- explore.find('.to-animate-2').each(function( k ) {
- var el = $(this);
-
- setTimeout ( function () {
- el.addClass('bounceIn animated');
- }, k * 200, 'easeInOutExpo' );
-
- });
- }, 700);
-
- setTimeout(function() {
- explore.find('.to-animate-3').each(function( k ) {
- var el = $(this);
-
- setTimeout ( function () {
- el.addClass('fadeInRight animated');
- }, k * 200, 'easeInOutExpo' );
-
- });
- }, 1000);
-
-
- $(this.element).addClass('animated');
-
- }
- } , { offset: '80%' } );
-
- }
- };
-
- var gettingStartedAnimate = function() {
- var started = $('.getting-started-1');
- if ( started.length > 0 ) {
-
- started.waypoint( function( direction ) {
-
- if( direction === 'down' && !$(this.element).hasClass('animated') ) {
-
-
- setTimeout(function() {
- started.find('.to-animate').each(function( k ) {
- var el = $(this);
-
- setTimeout ( function () {
- el.addClass('fadeInUp animated');
- }, k * 200, 'easeInOutExpo' );
-
- });
- }, 200);
-
- setTimeout(function() {
- started.find('.to-animate-2').each(function( k ) {
- var el = $(this);
-
- setTimeout ( function () {
- el.addClass('fadeInRight animated');
- }, k * 200, 'easeInOutExpo' );
-
- });
- }, 200);
-
-
- $(this.element).addClass('animated');
-
- }
- } , { offset: '80%' } );
-
- }
- };
-
-
- var pricingAnimate = function() {
- var pricing = $('#fh5co-pricing');
- if ( pricing.length > 0 ) {
-
- pricing.waypoint( function( direction ) {
-
- if( direction === 'down' && !$(this.element).hasClass('animated') ) {
-
-
- setTimeout(function() {
- pricing.find('.to-animate').each(function( k ) {
- var el = $(this);
-
- setTimeout ( function () {
- el.addClass('fadeIn animated');
- }, k * 200, 'easeInOutExpo' );
-
- });
- }, 200);
-
- setTimeout(function() {
- pricing.find('.to-animate-2').each(function( k ) {
- var el = $(this);
-
- setTimeout ( function () {
- el.addClass('fadeInUp animated');
- }, k * 200, 'easeInOutExpo' );
-
- });
- }, 200);
-
-
- $(this.element).addClass('animated');
-
- }
- } , { offset: '80%' } );
-
- }
- };
-
-
- var servicesAnimate = function() {
- var services = $('#fh5co-services');
- if ( services.length > 0 ) {
-
- services.waypoint( function( direction ) {
-
- if( direction === 'down' && !$(this.element).hasClass('animated') ) {
-
-
- var sec = services.find('.to-animate').length,
- sec = parseInt((sec * 200) + 400);
-
- setTimeout(function() {
- services.find('.to-animate').each(function( k ) {
- var el = $(this);
-
- setTimeout ( function () {
- el.addClass('fadeInUp animated');
- }, k * 200, 'easeInOutExpo' );
-
- });
- }, 200);
-
- setTimeout(function() {
- services.find('.to-animate-2').each(function( k ) {
- var el = $(this);
-
- setTimeout ( function () {
- el.addClass('bounceIn animated');
- }, k * 200, 'easeInOutExpo' );
-
- });
- }, sec);
-
-
- $(this.element).addClass('animated');
-
- }
- } , { offset: '80%' } );
-
- }
- };
-
-
- var teamAnimate = function() {
- var team = $('#fh5co-team');
- if ( team.length > 0 ) {
-
- team.waypoint( function( direction ) {
-
- if( direction === 'down' && !$(this.element).hasClass('animated') ) {
-
- var sec = team.find('.to-animate').length,
- sec = parseInt((sec * 200) + 400);
-
- setTimeout(function() {
- team.find('.to-animate').each(function( k ) {
- var el = $(this);
-
- setTimeout ( function () {
- el.addClass('fadeIn animated');
- }, k * 200, 'easeInOutExpo' );
-
- });
- }, 200);
-
- setTimeout(function() {
- team.find('.to-animate-2').each(function( k ) {
- var el = $(this);
-
- setTimeout ( function () {
- el.addClass('fadeInUp animated');
- }, k * 200, 'easeInOutExpo' );
-
- });
- }, sec);
-
-
- $(this.element).addClass('animated');
-
- }
- } , { offset: '80%' } );
-
- }
- };
-
-
- var footerAnimate = function() {
- var footer = $('#fh5co-footer');
- if ( footer.length > 0 ) {
-
- footer.waypoint( function( direction ) {
-
- if( direction === 'down' && !$(this.element).hasClass('animated') ) {
-
- setTimeout(function() {
- footer.find('.to-animate').each(function( k ) {
- var el = $(this);
-
- setTimeout ( function () {
- el.addClass('fadeIn animated');
- }, k * 200, 'easeInOutExpo' );
-
- });
- }, 200);
-
-
- $(this.element).addClass('animated');
-
- }
- } , { offset: '80%' } );
-
- }
- };
-
-
- var counter = function() {
- $('.js-counter').countTo({
- formatter: function (value, options) {
- return value.toFixed(options.decimals);
- },
- });
- };
-
- var counterWayPoint = function() {
- if ($('#fh5co-counter-section').length > 0 ) {
- $('#fh5co-counter-section').waypoint( function( direction ) {
-
- if( direction === 'down' && !$(this.element).hasClass('animated') ) {
- setTimeout( counter , 400);
- $(this.element).addClass('animated');
-
- }
- } , { offset: '90%' } );
- }
- };
-
- // Document on load.
- $(function(){
- parallax();
- fullHeight();
- clickMenu();
- windowScroll();
- navigationSection();
-
- // Animations
- homeAnimate();
- exploreAnimate();
- gettingStartedAnimate();
- pricingAnimate();
- servicesAnimate();
- teamAnimate();
- footerAnimate();
- counter();
- counterWayPoint();
-
- });
-
-
- }());
|