about.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. $('.nav-toggle').on('touchstart click', function(e) {
  11. e.preventDefault();
  12. $( this ).toggleClass( 'active' );
  13. });
  14. $(function dw_hidenav() {
  15. var headerHeight = $('.navbar').height();
  16. $(window).on('scroll', { previousTop: 0 },
  17. function() {
  18. var currentTop = $(window).scrollTop();
  19. if (currentTop < this.previousTop) {
  20. if (currentTop > 0 && $('.navbar').hasClass('fixed')) {
  21. $('.navbar').addClass('visible');
  22. $('.site-title a').removeClass('light');
  23. } else {
  24. $('.navbar').removeClass('visible fixed');
  25. $('.site-title a').addClass('light');
  26. }
  27. }
  28. else {
  29. $('.navbar').removeClass('visible');
  30. if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed');
  31. }
  32. this.previousTop = currentTop;
  33. }
  34. );
  35. });
  36. var vidout = document.getElementById('tv');
  37. vidout.play();
  38. $('#caro-lead').carousel({
  39. interval: 5000,
  40. cycle: true,
  41. wrap: true
  42. });
  43. $('#caro-lead').on('slid.bs.carousel', function(event) {
  44. var consta = $('#caro-lead li.active');
  45. console.log('target: ' + consta.data('target') + ' value: ' + ' slide-to: ' + consta.data('slideTo'));
  46. $('.carousel-caption').fadeIn(600);
  47. setTimeout(function() {
  48. if (consta.data('slideTo') === 0) {
  49. }
  50. if (consta.data('slideTo') === 1) {
  51. }
  52. if (consta.data('slideTo') === 2) {
  53. }
  54. }, 10);
  55. });
  56. $('#caro-lead').on('slid.bs.carousel', function() {
  57. $('.active .animac').removeClass('hide-svg fade-svg');
  58. var animac = new DrawFillSVG({elementId: 'brain'});
  59. animac.replay();
  60. });
  61. $(document).bind('keyup', function(e) {
  62. if(e.which === 39){
  63. $('#caro-lead').carousel('next');
  64. }
  65. else if(e.which === 37){
  66. $('#caro-lead').carousel('prev');
  67. }
  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. plugins: [ 'dayGrid', 'googleCalendar' ],
  103. header: {
  104. left: 'title ',
  105. center: '',
  106. right: 'prev,next '
  107. },
  108. firstDay : 1,
  109. height: 345,
  110. defaultView: 'dayGridMonth',
  111. googleCalendarApiKey: 'AIzaSyAGowGJYx6dOaQvG_vSUI73uT88VWOTcNQ',
  112. events: {
  113. googleCalendarId: 'davidawindham.com_bvrht1f8n2vgldgjenpgfdd4bk@group.calendar.google.com',
  114. className: 'gcal-event'
  115. },
  116. eventRender: function(info) {
  117. },
  118. eventClick: function(info) {
  119. info.jsEvent.preventDefault();
  120. }
  121. });
  122. calendar.render();
  123. });