Skip to content

Commit

Permalink
Demo input now ranges from -2 to +6 with 10th of second precision. #32
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuNls committed Jul 7, 2015
1 parent 44f4e05 commit 24bfc83
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions assets/js/home.logic.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

var delta = Math.floor((Math.random() * 10) + 1) - 5;
var delta = (Math.random() * 6) + 1 - 2;
var d;

var activeIndex = 0;
Expand Down Expand Up @@ -32,7 +32,7 @@ $( document ).ready(function() {
$("#demo-pointer").removeAttr('style');

animationUnderWay = true;
var evt = window.event || e //equalize event object
var evt = window.event || e; //equalize event object
evt = evt.originalEvent ? evt.originalEvent : evt; //convert to originalEvent if possible
var delta = evt.detail ? evt.detail*(-40) : evt.wheelDelta //check for detail first, because it is used by Opera and FF

Expand Down Expand Up @@ -87,7 +87,7 @@ $( document ).ready(function() {
$("#demo-pointer").hide();
$("#demo-third-step").hide();
$("#demo-fourth-step").fadeToggle();
$(".watch-accuracy").html(result.toFixed(0));
$(".watch-accuracy").html(result.toFixed(1));
});


Expand Down Expand Up @@ -151,7 +151,7 @@ function similateInput(){

$("#inputUserTime").focus();

var seconds = (d.getSeconds() + Math.abs(delta));
var seconds = (d.getSeconds() + Math.floor(Math.abs(delta)));
if(seconds <= 9){
seconds = "0"+seconds;
}
Expand Down

0 comments on commit 24bfc83

Please sign in to comment.