studio.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. const studioCarouselElement = document.querySelector('#caro')
  2. const carousel = new bootstrap.Carousel(studioCarouselElement, {
  3. interval: 5000,
  4. wrap: true
  5. });
  6. jQuery(document).ready(function($) {
  7. $(window).bind('load', function() {
  8. $('#loader').fadeOut(2000);
  9. });
  10. $('.nav-toggle').on('touchstart click', function(e) {
  11. e.preventDefault();
  12. $( this ).toggleClass( 'active' );
  13. });
  14. new WOW().init();
  15. $(function dw_hidenav() {
  16. var headerHeight = $('.navbar').height();
  17. $(window).on('scroll', { previousTop: 0 },
  18. function() {
  19. var currentTop = $(window).scrollTop();
  20. if (currentTop < this.previousTop) {
  21. if (currentTop > 0 && $('.navbar').hasClass('fixed')) {
  22. $('.navbar').addClass('visible');
  23. $('.site-title a').removeClass('light');
  24. } else {
  25. $('.navbar').removeClass('visible fixed');
  26. $('.site-title a').addClass('light');
  27. }
  28. }
  29. else {
  30. $('.navbar').removeClass('visible');
  31. if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed');
  32. }
  33. this.previousTop = currentTop;
  34. }
  35. );
  36. });
  37. $("#studio-caro").backstretch("../wp-content/themes/daw/img/studio.jpg");
  38. $('#caro').on('slid.bs.carousel', function(e) {
  39. var consta = e.to;
  40. console.log('target: ' + consta );
  41. setTimeout(function() {
  42. if (consta === 0) {
  43. $('a[href="#studio"]').tab('show')
  44. $('#studio-caro').addClass('caro-grad5').removeClass('caro-grad caro-grad3 caro-grad2 caro-grad5');
  45. $('.site-title a').addClass('light');
  46. $('.carousel-indicators li').removeClass('darken-carousel-indicators');
  47. $("#studio-caro").backstretch({url:'../wp-content/themes/daw/img/studio.jpg', fade: 250 });
  48. }
  49. if (consta === 1) {
  50. $('a[href="#webdev"]').tab('show')
  51. $('.active #svg-imac.screen').delay(2500).queue(function(screenit){
  52. $(this).attr('class', 'bg');
  53. screenit();
  54. });
  55. $('#studio-caro').addClass('caro-grad').removeClass('caro-grad3 caro-grad2 caro-grad5');
  56. $('.site-title a').addClass('light');
  57. $('.carousel-indicators li').removeClass('darken-carousel-indicators');
  58. $("#studio-caro").backstretch('destroy');
  59. }
  60. if (consta === 2) {
  61. $('a[href="#ux"]').tab('show')
  62. $('#studio-caro').addClass('caro-grad2').removeClass('caro-grad caro-grad3 caro-grad5');
  63. $('.site-title a').addClass('light');
  64. $('.carousel-indicators li').removeClass('darken-carousel-indicators');
  65. $("#studio-caro").backstretch('destroy');
  66. }
  67. if (consta === 3) {
  68. $('a[href="#graphic"]').tab('show')
  69. $( '#studio-caro' ).addClass('caro-grad3').removeClass('caro-grad2 caro-grad caro-grad5');
  70. $('.site-title a').removeClass('light');
  71. $('.carousel-indicators li').addClass('darken-carousel-indicators');
  72. $("#studio-caro").backstretch('destroy');
  73. }
  74. if (consta === 4) {
  75. $('a[href="#media"]').tab('show')
  76. $('#studio-caro').removeClass('caro-grad caro-grad3').addClass('caro-grad5');
  77. $('.site-title a').addClass('light');
  78. $('.carousel-indicators li').removeClass('darken-carousel-indicators');
  79. $("#studio-caro").backstretch({isVideo: true, url:'../wp-content/themes/daw/img/camera.mp4', poster:'../wp-content/themes/daw/img/camera.jpg'});
  80. }
  81. if (consta === 5) {
  82. $('a[href="#art"]').tab('show')
  83. $( '#studio-caro' ).addClass('caro-grad5').removeClass('caro-grad2 caro-grad caro-grad3');
  84. $('.site-title a').addClass('light');
  85. $('.carousel-indicators li').removeClass('darken-carousel-indicators');
  86. $("#studio-caro").backstretch({url:'../wp-content/themes/daw/img/paints2.jpg', fade: 250 });
  87. }
  88. }, 10);
  89. });
  90. $('#caro').on('slide.bs.carousel', function() {
  91. $('.active #svg-imac.bg').attr('class', 'svg screen');
  92. $('.active .animac').addClass('fade-svg').delay(1000).queue(function(hideit){
  93. $(this).addClass('hide-svg');
  94. hideit();
  95. });
  96. });
  97. $('#caro').on('slid.bs.carousel', function() {
  98. $('.active .animac').removeClass('hide-svg fade-svg');
  99. var animac = new DrawFillSVG({elementId: 'svg-imac'});
  100. var animac1 = new DrawFillSVG({elementId: 'sv'});
  101. var animac2 = new DrawFillSVG({elementId: 'svg-mac'});
  102. var animac3 = new DrawFillSVG({elementId: 'svg-device'});
  103. animac.replay();
  104. animac1.replay();
  105. animac2.replay();
  106. animac3.replay();
  107. });
  108. });