about.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. new WOW().init();
  2. jQuery(document).ready(function($) {
  3. $(window).bind('load', function() {
  4. $('#loader').fadeOut(2000);
  5. });
  6. $(function () {
  7. $('[data-toggle="tooltip"]').tooltip()
  8. })
  9. var person = localStorage.getItem('person');
  10. console.log('person ' + person + ' from localstorage' )
  11. $('.nav-toggle').on('touchstart click', function(e) {
  12. e.preventDefault();
  13. $( this ).toggleClass( 'active' );
  14. });
  15. $(function dw_hidenav() {
  16. var headerHeight = $('.navbar').height();
  17. $(window).on('scroll', { previousTop: 0 },
  18. function() {
  19. var currentTop = $(window).scrollTop();
  20. if (currentTop < this.previousTop) {
  21. if (currentTop > 0 && $('.navbar').hasClass('fixed')) {
  22. $('.navbar').addClass('visible');
  23. $('.site-title a').removeClass('light');
  24. } else {
  25. $('.navbar').removeClass('visible fixed');
  26. $('.site-title a').addClass('light');
  27. }
  28. }
  29. else {
  30. $('.navbar').removeClass('visible');
  31. if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed');
  32. }
  33. this.previousTop = currentTop;
  34. }
  35. );
  36. });
  37. var vidout = document.getElementById('tv');
  38. vidout.play();
  39. $('#caro-lead').carousel({
  40. interval: 5000,
  41. wrap: true
  42. });
  43. $(document).on('keyup', function(e) {
  44. if(e.which === 39){
  45. $('#caro-lead').carousel('next');
  46. }
  47. else if(e.which === 37){
  48. $('#caro-lead').carousel('prev');
  49. }
  50. });
  51. $('#caro-lead').on('slid.bs.carousel', function(event) {
  52. var consta = $('#caro-lead li.active');
  53. //console.log('target: ' + consta.data('target') + ' value: ' + ' slide-to: ' + consta.data('slideTo'));
  54. $('.carousel-caption').fadeIn(600);
  55. setTimeout(function() {
  56. if (consta.data('slideTo') === 0) {
  57. }
  58. if (consta.data('slideTo') === 1) {
  59. }
  60. if (consta.data('slideTo') === 2) {
  61. }
  62. }, 10);
  63. });
  64. $('#caro-lead').on('slid.bs.carousel', function() {
  65. $('.active .animac').removeClass('hide-svg fade-svg');
  66. var animac = new DrawFillSVG({elementId: 'brain'});
  67. animac.replay();
  68. });
  69. /*============================================
  70. Form
  71. ==============================================*/
  72. $('#commentform').validate({
  73. rules: {
  74. author: {
  75. required: true,
  76. minlength: 2
  77. },
  78. email: {
  79. required: true,
  80. email: true
  81. },
  82. comment: {
  83. required: true,
  84. minlength: 3
  85. }
  86. },
  87. messages: {
  88. author: 'Please enter in your name.',
  89. email: 'Please enter a valid email address.',
  90. comment: 'Nothing to Say?'
  91. },
  92. errorElement: 'div',
  93. errorPlacement: function(error, element) {
  94. element.before(error);
  95. }
  96. });
  97. /*============================================
  98. Calendar
  99. ==============================================*/
  100. var calendarEl = document.getElementById('calendar');
  101. var calendar = new FullCalendar.Calendar(calendarEl, {
  102. headerToolbar: {
  103. start: 'title',
  104. center: '',
  105. end: 'prev,next'
  106. },
  107. firstDay : 1,
  108. height: 380,
  109. views: {
  110. dayGrid: { hiddenDays: [ 0,6,7 ] },
  111. timeGrid: {
  112. slotMinTime: '08:00:00',
  113. slotMaxTime: '17:00:00',
  114. dayHeaderFormat: { weekday: 'short' },
  115. hiddenDays: [ 0,6,7 ]
  116. },
  117. },
  118. googleCalendarApiKey: 'AIzaSyAGowGJYx6dOaQvG_vSUI73uT88VWOTcNQ',
  119. events: {
  120. googleCalendarId: 'davidawindham.com_bvrht1f8n2vgldgjenpgfdd4bk@group.calendar.google.com',
  121. className: 'gcal-event'
  122. },
  123. eventDataTransform: function(event) { event.url = ""; return event; },
  124. eventClick: function(info) { info.jsEvent.preventDefault(); }
  125. });
  126. calendar.render();
  127. });