new WOW().init(); const aboutCarouselElement = document.querySelector('#caro-lead') const carousel = new bootstrap.Carousel(aboutCarouselElement, { interval: 5000, wrap: false }); jQuery(document).ready(function($) { $(window).bind('load', function() { $('#loader').fadeOut(2000); }); $(function () { $('[data-toggle="tooltip"]').tooltip() }) var person = localStorage.getItem('person'); console.log('person ' + person + ' from localstorage' ) $('.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(); $(document).on('keyup', function(e) { if(e.which === 39){ $('#caro-lead').carousel('next'); } else if(e.which === 37){ $('#caro-lead').carousel('prev'); } }); $('#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 #brain').delay(5000).removeClass('hide-svg fade-svg'); var animac = new DrawFillSVG({elementId: 'brain'}); animac.replay(); }); /*============================================ 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, { headerToolbar: { start: 'title', center: '', end: 'prev,next' }, firstDay : 1, height: 380, views: { dayGrid: { hiddenDays: [ 0,6,7 ] }, timeGrid: { slotMinTime: '08:00:00', slotMaxTime: '17:00:00', dayHeaderFormat: { weekday: 'short' }, hiddenDays: [ 0,6,7 ] }, }, googleCalendarApiKey: 'AIzaSyAGowGJYx6dOaQvG_vSUI73uT88VWOTcNQ', events: { googleCalendarId: 'davidawindham.com_bvrht1f8n2vgldgjenpgfdd4bk@group.calendar.google.com', className: 'gcal-event' }, eventDataTransform: function(event) { event.url = ""; return event; }, eventClick: function(info) { info.jsEvent.preventDefault(); } }); calendar.render(); });