desk.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. new WOW().init();
  2. jQuery(document).ready(function($) {
  3. $(window).bind('load', function() {
  4. $('#loader').fadeOut(100);
  5. });
  6. $('.nav-toggle').on('touchstart click', function(e) {
  7. e.preventDefault();
  8. $( this ).toggleClass( 'active' );
  9. });
  10. $(function dw_hidenav() {
  11. var headerHeight = $('.navbar').height();
  12. $(window).on('scroll', { previousTop: 0 },
  13. function() {
  14. var currentTop = $(window).scrollTop();
  15. if (currentTop < this.previousTop) {
  16. if (currentTop > 0 && $('.navbar').hasClass('fixed')) {
  17. $('.navbar').addClass('visible');
  18. $('.site-title a').removeClass('light');
  19. } else {
  20. $('.navbar').removeClass('visible fixed');
  21. }
  22. }
  23. else {
  24. $('.navbar').removeClass('visible');
  25. if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed');
  26. }
  27. this.previousTop = currentTop;
  28. }
  29. );
  30. });
  31. $("#studio-caro").wallpaper({source: "../wp-content/themes/dw/img/clou.jpg"});
  32. $('#caro').carousel({
  33. interval: false,
  34. wrap: true,
  35. });
  36. $(document).bind('keyup', function(e) {
  37. if(e.which === 39){
  38. $('#caro').carousel('next');
  39. }
  40. else if(e.which === 37){
  41. $('#caro').carousel('prev');
  42. }
  43. });
  44. $('.studio-subnav a').click(function (e) {
  45. e.preventDefault()
  46. $(this).tab('show')
  47. })
  48. $('#caro').on('slid.bs.carousel', function(event) {
  49. var consta = $(event.target);
  50. setTimeout(function() {
  51. if (consta.find('.item.active').data('id') === 0) {
  52. $('.studio-subnav a[href="#studio"]').tab('show')
  53. $('#studio-caro').addClass('caro-grad5').removeClass('caro-grad caro-grad3 caro-grad2 caro-grad5');
  54. $('.carousel-indicators li').addClass('darken-carousel-indicators');
  55. $("#studio-caro").wallpaper("destroy");
  56. $("#studio-caro").wallpaper({source: "../wp-content/themes/dw/img/desk2.jpg"});
  57. }
  58. if (consta.find('.item.active').data('id') === 1) {
  59. $('.studio-subnav a[href="#webdev"]').tab('show')
  60. $('.active #svg-imac.screen').delay(2500).queue(function(screenit){
  61. $(this).attr('class', 'bg');
  62. screenit();
  63. });
  64. $('#studio-caro').addClass('caro-grad').removeClass('caro-grad3 caro-grad2 caro-grad5');
  65. $('.site-title a').addClass('light');
  66. $('.carousel-indicators li').removeClass('darken-carousel-indicators');
  67. $("#studio-caro").wallpaper("destroy");
  68. }
  69. }, 10);
  70. });
  71. $('#caro').on('slid.bs.carousel', function() {
  72. $('.active .animac').removeClass('hide-svg fade-svg');
  73. var animac = new DrawFillSVG({elementId: 'svg-imac'});
  74. var animac1 = new DrawFillSVG({elementId: 'sv'});
  75. var animac2 = new DrawFillSVG({elementId: 'svg-mac'});
  76. var animac3 = new DrawFillSVG({elementId: 'svg-device'});
  77. animac.replay();
  78. animac1.replay();
  79. animac2.replay();
  80. animac3.replay();
  81. });
  82. });