diff --git a/assets/js/home.logic.js b/assets/js/home.logic.js index e26c5677..06dffb8c 100644 --- a/assets/js/home.logic.js +++ b/assets/js/home.logic.js @@ -2,9 +2,6 @@ var delta = (Math.random() * 6) + 1 - 2; var d; -var activeIndex = 0; -var possibleIndex = ["home-video", "demo-screen", "mosa-screen", "publication_footer"]; -var animationUnderWay = false; var timeouts = []; $( window ).resize(function() { @@ -15,94 +12,53 @@ $( window ).resize(function() { $( document ).ready(function() { - - var mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel" //FF doesn't recognize mousewheel as of FF3.x + var mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel" //FF doesn't recognize mousewheel as of FF3.x $(window).bind(mousewheelevt, function(e){ - - if(!animationUnderWay){ - for (var i=0; i 0) { - activeIndex = activeIndex -1; - } else { - activeIndex = activeIndex +1; - } - - if(activeIndex === -1){ - activeIndex = 0; - }else if(activeIndex === 4){ - activeIndex = 3; - } - if(activeIndex!==0){ - $('header').addClass('blue'); - }else{ - $('header').removeClass('blue'); - } - - if(activeIndex === 1){ - timeouts.push(setTimeout(countDownDisplay, 1000)); - } - var scrollTo = $("#"+possibleIndex[activeIndex]).offset().top - $(".navbar").height(); - console.log(scrollTo); - $('html, body').animate({ - scrollTop: scrollTo - }, 2000, function() { - animationUnderWay = false; - }); - }else{ - e.preventDefault(); - } - - }); + if(document.body.scrollTop > $('.home-intro').height()){ + $('header').addClass('blue'); + }else{ + $('header').removeClass('blue'); + } - $("#demo-third-step").hide(); - $("#demo-fourth-step").hide(); + }); - initSize(); + initCounDown(); + initSize(); - - $('video,audio').mediaelementplayer({ - enableAutosize: true, - features: [] - }); + $('video,audio').mediaelementplayer({ + enableAutosize: true, + features: [] + }); - $( "#demo-cta" ).click(function() { + $( "#demo-cta" ).click(function() { - var result = delta; + var result = delta; - $("#demo-pointer").hide(); - $("#demo-third-step").hide(); - $("#demo-fourth-step").fadeToggle(); - $(".watch-accuracy").html(result.toFixed(1)); + $("#demo-pointer").hide(); + $("#demo-third-step").hide(); + $("#demo-fourth-step").fadeToggle(); + $(".watch-accuracy").html(result.toFixed(1)); }); }); function initCounDown(){ - + $("#demo-second-step").show(); + $("#demo-third-step").hide(); + $("#demo-fourth-step").hide(); + $("#demo-sync-time").html(5); + $("#inputUserTime").val(""); + $("#demo-pointer").removeAttr('style'); + timeouts.push(setTimeout(countDownDisplay, 1000)); } function initSize(){ - var windowHeight = $(window).height(); + var windowHeight = $(window).height(); - var headerHeight = $('header').height(); + var headerHeight = $('header').height(); var sloganHeight = $(".slogan-home"); var windowRealHeight = windowHeight - headerHeight; //var align = dispoDisplay / 2 - sloganHeight / 2; @@ -139,10 +95,10 @@ function similateInput(){ $("#demo-second-step").hide(); $("#demo-third-step").fadeToggle("slow", function (){ - var leftDelta = $("#demo-pointer").position().left + var leftDelta = $("#demo-pointer").position().left - $("#inputUserTime").position().left; - var topDelta = $("#demo-pointer").position().top + var topDelta = $("#demo-pointer").position().top - $("#inputUserTime").position().top - $("#inputUserTime").height() /2; $( "#demo-pointer" ).animate({ @@ -150,8 +106,6 @@ function similateInput(){ marginLeft: "-="+leftDelta }, 2000, function(){ - $("#inputUserTime").focus(); - var seconds = (d.getSeconds() + Math.floor(Math.abs(delta))); if(seconds <= 9){ seconds = "0"+seconds; @@ -197,4 +151,7 @@ function clickCTA(){ }, 2000, function(){ $("#demo-cta").click(); }); -} \ No newline at end of file + + timeouts = []; + setTimeout(initCounDown, 10000); +} diff --git a/assets/videos/Omega.mp4 b/assets/videos/Omega.mp4 old mode 100644 new mode 100755 index 842414fa..914e4efb Binary files a/assets/videos/Omega.mp4 and b/assets/videos/Omega.mp4 differ diff --git a/assets/videos/Rolex.mp4 b/assets/videos/Rolex.mp4 old mode 100644 new mode 100755 index 317051b7..93801b66 Binary files a/assets/videos/Rolex.mp4 and b/assets/videos/Rolex.mp4 differ diff --git a/assets/videos/Vacheron.mp4 b/assets/videos/Vacheron.mp4 old mode 100644 new mode 100755 index 3dbff24c..52c6dc8d Binary files a/assets/videos/Vacheron.mp4 and b/assets/videos/Vacheron.mp4 differ diff --git a/assets/videos/Zenith.mp4 b/assets/videos/Zenith.mp4 old mode 100644 new mode 100755