init.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. new WOW().init();
  2. jQuery(document).ready(function($) {
  3. var COOKIE_NAME = 'windhamdavid-cookie';
  4. $go = $.cookie(COOKIE_NAME);
  5. if ($go == null) {
  6. $.cookie(COOKIE_NAME, 'yum-cookies', { path: '/', expires: 6 });
  7. }
  8. else {
  9. }
  10. $(window).bind("load", function () {
  11. $('#loader').fadeOut(100);
  12. //$('.terminal').modal('show');
  13. });
  14. $(function(){
  15. $(".typed").typed({
  16. strings: ["Hey,", "Hello,\n^10Welcome to ^10my domain ^10...^10", "Hello, \nWelcome to my little corner of the internet. \n^10It's nice to ", "Hello, \nWelcome to my little corner of the internet. \nIt's very nice to have you here!^10\n"],
  17. typeSpeed: -40,
  18. backSpeed: -70,
  19. startDelay: 0,
  20. backDelay: 0,
  21. loop: false,
  22. loopCount: false,
  23. attr: null,
  24. callback: function(){
  25. //shift();
  26. }
  27. });
  28. });
  29. function shift(){
  30. $('.leader').ScrollTo({
  31. duration: 1500,
  32. easing: 'linear',
  33. durationMode: 'all',
  34. callback: function(){
  35. thecollapse();
  36. }
  37. });
  38. }
  39. function thecollapse(){
  40. //$('.intro').collapse('hide')
  41. //$('.terminal').modal('hide')
  42. }
  43. $('#nav').affix({
  44. offset: {top: $('.intro').height()-$('#nav').height()}
  45. });
  46. $('.nav-toggle').on( 'click', function() {
  47. $( this ).toggleClass( 'active' );
  48. });
  49. $(function(){
  50. $('.calendar').fullCalendar ({
  51. firstDay : 1,
  52. height: 345,
  53. events: [
  54. {
  55. title: 'Project',
  56. start: '2014-09-27',
  57. end: '2014-10-02'
  58. },
  59. {
  60. title: 'Conf',
  61. start: '2014-10-11',
  62. end: '2014-10-13',
  63. borderColor: 'red'
  64. },
  65. {
  66. title: 'off',
  67. start: '2014-10-13',
  68. end: '2014-10-16'
  69. },
  70. {
  71. title: 'Contract',
  72. start: '2014-10-16',
  73. end: '2014-10-31'
  74. },
  75. {
  76. title: 'Contract',
  77. start: '2014-11-03',
  78. end: '2014-11-22'
  79. },
  80. {
  81. title: 'Project',
  82. start: '2014-12-01',
  83. end: '2014-12-06'
  84. },
  85. {
  86. title: 'Project',
  87. start: '2014-12-08',
  88. end: '2014-12-13'
  89. },
  90. {
  91. title: 'Holiday',
  92. start: '2014-12-22',
  93. end: '2015-01-05',
  94. borderColor: 'red'
  95. },
  96. {
  97. title: 'Project',
  98. start: '2015-01-06',
  99. end: '2015-01-25'
  100. },
  101. {
  102. title: 'Project',
  103. start: '2015-02-02',
  104. end: '2015-02-14'
  105. },
  106. {
  107. title: 'Holiday',
  108. start: '2015-02-14',
  109. end: '2015-02-19',
  110. borderColor: 'red'
  111. },
  112. ]
  113. })
  114. });
  115. ;(function ($) {
  116. 'use strict';
  117. var content = $('.transit').smoothState({
  118. onStart : {
  119. duration: 250,
  120. render: function () {
  121. content.toggleAnimationClass('is-exiting');
  122. }
  123. }
  124. }).data('smoothState');
  125. })(jQuery);
  126. var headerHeight = $('.navbar').height();
  127. $(window).on('scroll', { previousTop: 0 },
  128. function() {
  129. var currentTop = $(window).scrollTop();
  130. if (currentTop < this.previousTop) {
  131. if (currentTop > 0 && $('.navbar').hasClass('fixed')) {
  132. $('.navbar').addClass('visible');
  133. } else {
  134. $('.navbar').removeClass('visible fixed');
  135. }
  136. } else {
  137. $('.navbar').removeClass('visible');
  138. if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed');
  139. }
  140. this.previousTop = currentTop;
  141. });
  142. var commentsDiv = $('#comments');
  143. if (commentsDiv.length) {
  144. $(commentsDiv).hide();
  145. $('.toggle-comments').on('click', function(e) {
  146. e.preventDefault();
  147. $(commentsDiv).toggle('slow', function() {
  148. var anchor = $('.toggle-comments');
  149. var anchorText = anchor.text() === 'Hide Comments' ? 'Show Comments' : 'Hide Comments';
  150. $(anchor).text(anchorText);
  151. });
  152. });
  153. }
  154. });
  155. ;(function ($) {
  156. 'use strict';
  157. var $body = $('html, body'),
  158. content = $('#big-top').smoothState({
  159. prefetch: true,
  160. pageCacheSize: 4,
  161. onStart: {
  162. duration: 250,
  163. render: function (url, $container) {
  164. content.toggleAnimationClass('is-exiting');
  165. $body.animate({
  166. scrollTop: 0
  167. });
  168. }
  169. }
  170. }).data('smoothState');
  171. })(jQuery);