new WOW().init(); jQuery(document).ready(function($) { $(window).bind('load', function() { $('#loader').fadeOut(100); }); $('.nav-toggle').on('touchstart click', function(e) { e.preventDefault(); $( this ).toggleClass( 'active' ); }); $(function dw_hidenav() { var headerHeight = $('.navbar').height(); $(window).on('scroll', { previousTop: 0 }, function() { var currentTop = $(window).scrollTop(); if (currentTop < this.previousTop) { if (currentTop > 0 && $('.navbar').hasClass('fixed')) { $('.navbar').addClass('visible'); $('.site-title a').removeClass('light'); } else { $('.navbar').removeClass('visible fixed'); } } else { $('.navbar').removeClass('visible'); if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed'); } this.previousTop = currentTop; } ); }); $("#studio-caro").wallpaper({source: "../wp-content/themes/dw/img/clou.jpg"}); $('#caro').carousel({ interval: false, wrap: true, }); $(document).bind('keyup', function(e) { if(e.which === 39){ $('#caro').carousel('next'); } else if(e.which === 37){ $('#caro').carousel('prev'); } }); $('.studio-subnav a').click(function (e) { e.preventDefault() $(this).tab('show') }) $('#caro').on('slid.bs.carousel', function(event) { var consta = $(event.target); setTimeout(function() { if (consta.find('.item.active').data('id') === 0) { $('.studio-subnav a[href="#studio"]').tab('show') $('#studio-caro').addClass('caro-grad5').removeClass('caro-grad caro-grad3 caro-grad2 caro-grad5'); $('.carousel-indicators li').addClass('darken-carousel-indicators'); $("#studio-caro").wallpaper("destroy"); $("#studio-caro").wallpaper({source: "../wp-content/themes/dw/img/desk2.jpg"}); } if (consta.find('.item.active').data('id') === 1) { $('.studio-subnav a[href="#webdev"]').tab('show') $('.active #svg-imac.screen').delay(2500).queue(function(screenit){ $(this).attr('class', 'bg'); screenit(); }); $('#studio-caro').addClass('caro-grad').removeClass('caro-grad3 caro-grad2 caro-grad5'); $('.site-title a').addClass('light'); $('.carousel-indicators li').removeClass('darken-carousel-indicators'); $("#studio-caro").wallpaper("destroy"); } }, 10); }); $('#caro').on('slid.bs.carousel', function() { $('.active .animac').removeClass('hide-svg fade-svg'); var animac = new DrawFillSVG({elementId: 'svg-imac'}); var animac1 = new DrawFillSVG({elementId: 'sv'}); var animac2 = new DrawFillSVG({elementId: 'svg-mac'}); var animac3 = new DrawFillSVG({elementId: 'svg-device'}); animac.replay(); animac1.replay(); animac2.replay(); animac3.replay(); }); });