init.js 4.3 KB

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