123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- jQuery(document).ready(function($) {
- $(window).bind('load', function() {
- $('#loader').fadeOut(2000);
- });
- $('.nav-toggle').on('touchstart click', function(e) {
- e.preventDefault();
- $( this ).toggleClass( 'active' );
- });
- new WOW().init();
- $(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');
- $('.site-title a').addClass('light');
- }
- }
- else {
- $('.navbar').removeClass('visible');
- if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed');
- }
- this.previousTop = currentTop;
- }
- );
- });
- $('#caro').carousel({
- interval: 5000,
- 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')
- })
- $("#studio-caro").backstretch("../wp-content/themes/daw/img/desk2.jpg");
- $('#caro').on('slid.bs.carousel', function(event) {
- var consta = $('#caro li.active');
- //console.log('target: ' + consta.data('target') + ' value: ' + consta.data('value') + ' slide-to: ' + consta.data('slideTo'));
- //var consta = $(event.target);
- setTimeout(function() {
- if (consta.data('slideTo') === 0) {
- $('.studio-subnav a[href="#studio"]').tab('show')
- $('#studio-caro').addClass('caro-grad5').removeClass('caro-grad caro-grad3 caro-grad2 caro-grad5');
- $('.site-title a').addClass('light');
- $('.carousel-indicators li').removeClass('darken-carousel-indicators');
- $("#studio-caro").backstretch({url:'../wp-content/themes/daw/img/desk2.jpg', fade: 250 });
- }
- if (consta.data('slideTo') === 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").backstretch('destroy');
- }
- if (consta.data('slideTo') === 2) {
- $('.studio-subnav a[href="#ux"]').tab('show')
- $('#studio-caro').addClass('caro-grad2').removeClass('caro-grad caro-grad3 caro-grad5');
- $('.site-title a').addClass('light');
- $('.carousel-indicators li').removeClass('darken-carousel-indicators');
- $("#studio-caro").backstretch('destroy');
- }
- if (consta.data('slideTo') === 3) {
- $('.studio-subnav a[href="#graphic"]').tab('show')
- $( '#studio-caro' ).addClass('caro-grad3').removeClass('caro-grad2 caro-grad caro-grad5');
- $('.site-title a').removeClass('light');
- $('.carousel-indicators li').addClass('darken-carousel-indicators');
- $("#studio-caro").backstretch('destroy');
- }
- if (consta.data('slideTo') === 4) {
- $('.studio-subnav a[href="#media"]').tab('show')
- $('#studio-caro').removeClass('caro-grad caro-grad3').addClass('caro-grad5');
- $('.site-title a').addClass('light');
- $('.carousel-indicators li').removeClass('darken-carousel-indicators');
- $("#studio-caro").backstretch({isVideo: true, url:'../wp-content/themes/dw/img/camera.mp4', poster:'../wp-content/themes/dw/img/camera.jpg'});
- }
- if (consta.data('slideTo') === 5) {
- $('.studio-subnav a[href="#art"]').tab('show')
- $( '#studio-caro' ).addClass('caro-grad5').removeClass('caro-grad2 caro-grad caro-grad3');
- $('.site-title a').addClass('light');
- $('.carousel-indicators li').removeClass('darken-carousel-indicators');
- $("#studio-caro").backstretch({url:'../wp-content/themes/dw/img/paints2.jpg', fade: 250 });
- }
- }, 10);
- });
- $('#caro').on('slide.bs.carousel', function() {
- $('.active #svg-imac.bg').attr('class', 'svg screen');
- $('.active .animac').addClass('fade-svg').delay(1000).queue(function(hideit){
- $(this).addClass('hide-svg');
- hideit();
- });
- });
- $('#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();
- });
- });
|