init.js 3.8 KB

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