new WOW().init(); jQuery(document).ready(function($) { $(window).bind('load', function() { $('#loader').fadeOut(700); }); $(function () { $('[data-toggle="tooltip"]').tooltip() }) var person = localStorage.getItem('person'); /*============================================ Navigation ==============================================*/ $('.nav-toggle').on('touchstart click', function(e) { e.preventDefault(); $( this ).toggleClass( 'active' ); }); $('#nav').affix({ //offset: {top: $('.intro').height()-$('.navbar').height()} }); $(function dw_hidenav() { var headerHeight = $('.navbar').height(); $(window).on('scroll', { previousTop: 0 }, function() { var currentTop = $(window).scrollTop(); if (currentTop < this.previousTop) { if (currentTop > 0 && $('.navbar').hasClass('fixed')) { $('.navbar').addClass('visible'); $('.site-title a').removeClass('light'); } else { $('.navbar').removeClass('visible fixed'); $('.site-title a').addClass('light'); } } else { $('.navbar').removeClass('visible'); if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed'); } this.previousTop = currentTop; } ); }); /*============================================ Carousel ==============================================*/ $('#caro-lead').carousel({ interval: 5777, wrap: true, pause: false }); function dw_caro(){ $('#caro-lead').carousel({ interval: 5777, wrap: true, pause: false }); var vidout = document.getElementById('tv'); vidout.play(); } $('#caro-lead').on('slide.bs.carousel', function(event) { $('.carousel-caption').fadeIn(600); var consta = $(event.target); setTimeout(function() { if (consta.find('.item.active').data('id') === 1) { $('#tv').removeClass('unblur').addClass('blur'); var anistars = new DrawFillSVG({elementId: 'sites'}); anistars.replay(); $('#tv').delay(100).queue(function(pauseit){ var vidin = document.getElementById('tv'); vidin.pause(); pauseit(); }); } if (consta.find('.item.active').data('id') === 2) { $('#tv').removeClass('unblur').addClass('blur'); var anibrain = new DrawFillSVG({elementId: 'brain'}); anibrain.replay(); $('#tv').delay(100).queue(function(pauseit){ var vidin = document.getElementById('tv'); vidin.pause(); pauseit(); }); } if (consta.find('.item.active').data('id') === 3) { $('.leader').delay(100).queue(function(closeit){ dw_caro_hide(); closeit(); }); } }, 10); }); function dw_caro_hide(){ $('.leader').fadeTo(500,0, function() { $('#caro-lead').carousel('pause'); }) } $('#caro-lead').on('slid.bs.carousel', function() { $('.carousel-caption').fadeOut(600); $('#tv').delay(3200).queue(function(playit){ $('#tv').addClass('unblur').removeClass('blur'); var vidout = document.getElementById('tv'); vidout.play(); playit(); }); }); $('.caro-grad').appear(); $('.caro-grad').one('appear', dw_appear); function dw_appear() { $('#caro').carousel({ interval: 5555, wrap: false, pause: false }); var anima = new DrawFillSVG({elementId: 'sv'}); anima.replay(); }; $(document).bind('keyup', function(e) { if(e.which === 39){ //$('#caro-lead').carousel('next'); $('#caro').carousel('next'); } else if(e.which === 37){ //$('#caro-lead').carousel('prev'); $('#caro').carousel('prev'); } }); /*============================================ SVG Animate ==============================================*/ $('#caro').on('slid.bs.carousel', function() { $('.active .animac').removeClass('hide-svg fade-svg'); var animac = new DrawFillSVG({elementId: 'svg-mac'}); var animac1 = new DrawFillSVG({elementId: 'svg-imac'}); var animac2 = new DrawFillSVG({elementId: 'svg'}); animac.replay(); animac1.replay(); animac2.replay(); }); $('#caro').on('slide.bs.carousel', function() { $('.active #svg-imac.bg').attr('class', 'svg screen'); $('.active .animac').addClass('fade-svg').delay(1000).queue(function(hideit){ $(this).addClass('hide-svg'); hideit(); }); }); $('#caro').on('slid.bs.carousel', function() { $('.active #svg-imac.screen').delay(2500).queue(function(screenit){ $(this).attr('class', 'bg'); screenit(); }); }); /*============================================ Form ==============================================*/ $('#commentform').validate({ rules: { author: { required: true, minlength: 2 }, email: { required: true, email: true }, comment: { required: true, minlength: 3 } }, messages: { author: 'Please enter in your name.', email: 'Please enter a valid email address.', comment: 'Nothing to Say?' }, errorElement: 'div', errorPlacement: function(error, element) { element.before(error); } }); /*============================================ SmoothState ==============================================*/ /*============================================ Calendar ==============================================*/ $('.calendar').fullCalendar ({ firstDay : 1, height: 345, events: [ { title: 'Holiday', start: '2015-12-22', end: '2016-01-05', borderColor: 'red' }, { title: 'Project', start: '2016-01-05', end: '2016-02-05' }, { title: 'Contract', start: '2016-02-06', end: '2016-02-13', borderColor: 'blue' }, { title: 'Holiday', start: '2016-02-13', end: '2016-02-16', borderColor: 'red' }, { title: 'Contract', start: '2016-02-16', end: '2016-04-01', borderColor: 'blue' }, { title: 'Holiday', start: '2016-04-01', end: '2016-04-10', borderColor: 'red' }, { title: 'Contract', start: '2016-04-12', end: '2016-06-01', borderColor: 'blue' }, { title: 'Project', start: '2016-06-01', end: '2016-07-01' }, { title: 'Holiday', start: '2016-07-01', end: '2016-07-06', borderColor: 'red' }, { title: 'Project', start: '2016-08-01', end: '2016-09-01' }, { title: 'Project', start: '2016-09-01', end: '2016-10-01' }, { title: 'Project', start: '2016-10-01', end: '2016-11-01' }, { title: 'Holiday', start: '2016-12-15', end: '2017-01-10', borderColor: 'red' }, { title: 'Project', start: '2017-01-24', end: '2017-03-31', }, { title: 'Contract', start: '2017-04-01', end: '2017-07-03', borderColor: 'blue' }, { title: 'Holiday', start: '2017-07-04', end: '2017-07-15', borderColor: 'red' }, { title: 'Project', start: '2017-07-18', end: '2017-09-30' }, { title: 'Contract', start: '2017-10-02', end: '2017-10-18', borderColor: 'blue' }, { title: 'Holiday', start: '2017-10-19', end: '2017-10-24', borderColor: 'red' }, { title: 'Contract', start: '2017-10-25', end: '2017-11-21', borderColor: 'blue' }, { title: 'Holiday', start: '2017-11-22', end: '2017-11-26', borderColor: 'red' }, { title: 'Project', start: '2017-11-27', end: '2017-12-22', }, { title: 'Holiday', start: '2017-12-23', end: '2018-01-05', borderColor: 'red' }, { title: 'Contract', start: '2018-01-08', end: '2018-03-30', borderColor: 'blue' }, { title: 'Contract', start: '2018-04-01', end: '2018-06-30', borderColor: 'blue' }, { title: 'Project', start: '2018-05-01', end: '2018-07-30' }, { title: 'Project', start: '2018-07-01', end: '2018-08-30' }, { title: 'Contract', start: '2018-08-01', end: '2018-11-01', borderColor: 'blue' }, { title: 'Project', start: '2018-10-01', end: '2018-12-23' }, { title: 'Holiday', start: '2018-11-22', end: '2018-11-26', borderColor: 'red' }, { title: 'Holiday', start: '2018-12-23', end: '2019-01-05', borderColor: 'red' }, { title: 'Project', start: '2019-01-01', end: '2019-03-30' }, { title: 'Project', start: '2019-03-05', end: '2019-04-29' }, { title: 'Contract', start: '2019-05-01', end: '2019-08-01', borderColor: 'blue' }, { title: 'Holiday', start: '2019-06-15', end: '2019-06-22', borderColor: 'red' }, { title: 'Holiday', start: '2019-08-01', end: '2019-08-08', borderColor: 'red' }, { title: 'Project', start: '2019-08-09', end: '2019-08-30' }, { title: 'Project', start: '2019-09-03', end: '2019-09-28' }, { title: 'Project', start: '2019-10-01', end: '2019-10-06' }, { title: 'Project', start: '2019-10-01', end: '2019-11-01' }, { title: 'Contract', start: '2019-11-01', end: '2020-01-31', borderColor: 'blue' }, { title: 'Holiday', start: '2019-11-26', end: '2019-12-01', borderColor: 'red' }, { title: 'Holiday', start: '2019-12-23', end: '2020-01-05', borderColor: 'red' }, { title: 'Contract', start: '2020-02-01', end: '2020-03-31', borderColor: 'blue' } ] }); });