about.js 3.7 KB

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