about.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. new WOW().init();
  2. jQuery(document).ready(function($) {
  3. $(window).bind('load', function() {
  4. $('#loader').fadeOut(700);
  5. });
  6. $(function () {
  7. $('[data-toggle="tooltip"]').tooltip()
  8. })
  9. var person = localStorage.getItem('person');
  10. /*============================================
  11. Navigation
  12. ==============================================*/
  13. $('.nav-toggle').on('touchstart click', function(e) {
  14. e.preventDefault();
  15. $( this ).toggleClass( 'active' );
  16. });
  17. $('#nav').affix({
  18. //offset: {top: $('.intro').height()-$('.navbar').height()}
  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. /*============================================
  43. Carousel
  44. ==============================================*/
  45. $('#caro-lead').carousel({
  46. interval: 5777,
  47. wrap: true,
  48. pause: false
  49. });
  50. function dw_caro(){
  51. $('#caro-lead').carousel({
  52. interval: 5777,
  53. wrap: true,
  54. pause: false
  55. });
  56. var vidout = document.getElementById('tv');
  57. vidout.play();
  58. }
  59. $('#caro-lead').on('slide.bs.carousel', function(event) {
  60. $('.carousel-caption').fadeIn(600);
  61. var consta = $(event.target);
  62. setTimeout(function() {
  63. if (consta.find('.item.active').data('id') === 1) {
  64. $('#tv').removeClass('unblur').addClass('blur');
  65. var anistars = new DrawFillSVG({elementId: 'sites'});
  66. anistars.replay();
  67. $('#tv').delay(100).queue(function(pauseit){
  68. var vidin = document.getElementById('tv');
  69. vidin.pause();
  70. pauseit();
  71. });
  72. }
  73. if (consta.find('.item.active').data('id') === 2) {
  74. $('#tv').removeClass('unblur').addClass('blur');
  75. var anibrain = new DrawFillSVG({elementId: 'brain'});
  76. anibrain.replay();
  77. $('#tv').delay(100).queue(function(pauseit){
  78. var vidin = document.getElementById('tv');
  79. vidin.pause();
  80. pauseit();
  81. });
  82. }
  83. if (consta.find('.item.active').data('id') === 3) {
  84. $('.leader').delay(100).queue(function(closeit){
  85. dw_caro_hide();
  86. closeit();
  87. });
  88. }
  89. }, 10);
  90. });
  91. function dw_caro_hide(){
  92. $('.leader').fadeTo(500,0, function() {
  93. $('#caro-lead').carousel('pause');
  94. })
  95. }
  96. $('#caro-lead').on('slid.bs.carousel', function() {
  97. $('.carousel-caption').fadeOut(600);
  98. $('#tv').delay(3200).queue(function(playit){
  99. $('#tv').addClass('unblur').removeClass('blur');
  100. var vidout = document.getElementById('tv');
  101. vidout.play();
  102. playit();
  103. });
  104. });
  105. $('.caro-grad').appear();
  106. $('.caro-grad').one('appear', dw_appear);
  107. function dw_appear() {
  108. $('#caro').carousel({
  109. interval: 5555,
  110. wrap: false,
  111. pause: false
  112. });
  113. var anima = new DrawFillSVG({elementId: 'sv'});
  114. anima.replay();
  115. };
  116. $(document).bind('keyup', function(e) {
  117. if(e.which === 39){
  118. //$('#caro-lead').carousel('next');
  119. $('#caro').carousel('next');
  120. }
  121. else if(e.which === 37){
  122. //$('#caro-lead').carousel('prev');
  123. $('#caro').carousel('prev');
  124. }
  125. });
  126. /*============================================
  127. SVG Animate
  128. ==============================================*/
  129. $('#caro').on('slid.bs.carousel', function() {
  130. $('.active .animac').removeClass('hide-svg fade-svg');
  131. var animac = new DrawFillSVG({elementId: 'svg-mac'});
  132. var animac1 = new DrawFillSVG({elementId: 'svg-imac'});
  133. var animac2 = new DrawFillSVG({elementId: 'svg'});
  134. animac.replay();
  135. animac1.replay();
  136. animac2.replay();
  137. });
  138. $('#caro').on('slide.bs.carousel', function() {
  139. $('.active #svg-imac.bg').attr('class', 'svg screen');
  140. $('.active .animac').addClass('fade-svg').delay(1000).queue(function(hideit){
  141. $(this).addClass('hide-svg');
  142. hideit();
  143. });
  144. });
  145. $('#caro').on('slid.bs.carousel', function() {
  146. $('.active #svg-imac.screen').delay(2500).queue(function(screenit){
  147. $(this).attr('class', 'bg');
  148. screenit();
  149. });
  150. });
  151. /*============================================
  152. Form
  153. ==============================================*/
  154. $('#commentform').validate({
  155. rules: {
  156. author: {
  157. required: true,
  158. minlength: 2
  159. },
  160. email: {
  161. required: true,
  162. email: true
  163. },
  164. comment: {
  165. required: true,
  166. minlength: 3
  167. }
  168. },
  169. messages: {
  170. author: 'Please enter in your name.',
  171. email: 'Please enter a valid email address.',
  172. comment: 'Nothing to Say?'
  173. },
  174. errorElement: 'div',
  175. errorPlacement: function(error, element) {
  176. element.before(error);
  177. }
  178. });
  179. /*============================================
  180. SmoothState
  181. ==============================================*/
  182. /*============================================
  183. Calendar
  184. ==============================================*/
  185. $('.calendar').fullCalendar ({
  186. firstDay : 1,
  187. height: 345,
  188. events: [
  189. {
  190. title: 'Holiday',
  191. start: '2015-12-22',
  192. end: '2016-01-05',
  193. borderColor: 'red'
  194. },
  195. {
  196. title: 'Project',
  197. start: '2016-01-05',
  198. end: '2016-02-05'
  199. },
  200. {
  201. title: 'Contract',
  202. start: '2016-02-06',
  203. end: '2016-02-13',
  204. borderColor: 'blue'
  205. },
  206. {
  207. title: 'Holiday',
  208. start: '2016-02-13',
  209. end: '2016-02-16',
  210. borderColor: 'red'
  211. },
  212. {
  213. title: 'Contract',
  214. start: '2016-02-16',
  215. end: '2016-04-01',
  216. borderColor: 'blue'
  217. },
  218. {
  219. title: 'Holiday',
  220. start: '2016-04-01',
  221. end: '2016-04-10',
  222. borderColor: 'red'
  223. },
  224. {
  225. title: 'Contract',
  226. start: '2016-04-12',
  227. end: '2016-06-01',
  228. borderColor: 'blue'
  229. },
  230. {
  231. title: 'Project',
  232. start: '2016-06-01',
  233. end: '2016-07-01'
  234. },
  235. {
  236. title: 'Holiday',
  237. start: '2016-07-01',
  238. end: '2016-07-06',
  239. borderColor: 'red'
  240. }
  241. ]
  242. });
  243. });