new WOW().init(); jQuery(document).ready(function($) { $(window).bind('load', function() { $('#loader').fadeOut(2000); }); $(function () { $('[data-toggle="tooltip"]').tooltip() }) var person = localStorage.getItem('person'); $('.nav-toggle').on('touchstart click', function(e) { e.preventDefault(); $( this ).toggleClass( 'active' ); }); $(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; } ); }); var vidout = document.getElementById('tv'); vidout.play(); $('#caro-lead').carousel({ interval: 5000, cycle: true, wrap: true }); $('#caro-lead').on('slid.bs.carousel', function(event) { var consta = $('#caro-lead li.active'); console.log('target: ' + consta.data('target') + ' value: ' + ' slide-to: ' + consta.data('slideTo')); $('.carousel-caption').fadeIn(600); setTimeout(function() { if (consta.data('slideTo') === 0) { } if (consta.data('slideTo') === 1) { } if (consta.data('slideTo') === 2) { } }, 10); }); $('#caro-lead').on('slid.bs.carousel', function() { $('.active .animac').removeClass('hide-svg fade-svg'); var animac = new DrawFillSVG({elementId: 'brain'}); animac.replay(); }); $(document).bind('keyup', function(e) { if(e.which === 39){ $('#caro-lead').carousel('next'); } else if(e.which === 37){ $('#caro-lead').carousel('prev'); } }); /*============================================ 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); } }); /*============================================ Calendar ==============================================*/ var calendarEl = document.getElementById('calendar'); var calendar = new FullCalendar.Calendar(calendarEl, { plugins: [ 'dayGrid', 'googleCalendar' ], header: { left: 'title ', center: '', right: 'prev,next ' }, firstDay : 1, height: 345, defaultView: 'dayGridMonth', googleCalendarApiKey: 'AIzaSyAGowGJYx6dOaQvG_vSUI73uT88VWOTcNQ', events: { googleCalendarId: 'davidawindham.com_bvrht1f8n2vgldgjenpgfdd4bk@group.calendar.google.com', className: 'gcal-event' }, eventRender: function(info) { }, eventClick: function(info) { info.jsEvent.preventDefault(); } }); calendar.render(); });