From 41df9abf303218abd86c277008415fea06732c25 Mon Sep 17 00:00:00 2001 From: Steven Haskell Date: Wed, 24 Oct 2018 02:12:59 -0400 Subject: [PATCH] Updated Yellow Plate and adjusted animation speeds Added border to yellow plate to make it easer to see. Adjusted animations to be more fluid. --- images/35lbs-Plate.svg | 9 +++++-- ...ght Calculation Script-Edited-Jquery-V4.js | 24 ++++++------------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/images/35lbs-Plate.svg b/images/35lbs-Plate.svg index 9ea65df..b90b00d 100644 --- a/images/35lbs-Plate.svg +++ b/images/35lbs-Plate.svg @@ -3,11 +3,16 @@ 35lbs-Plate Created with Sketch. - + + + - + + + + diff --git a/js/Weight Calculation Script-Edited-Jquery-V4.js b/js/Weight Calculation Script-Edited-Jquery-V4.js index 73a2318..ded5127 100644 --- a/js/Weight Calculation Script-Edited-Jquery-V4.js +++ b/js/Weight Calculation Script-Edited-Jquery-V4.js @@ -47,22 +47,22 @@ jQuery('.b-platevisual__plates--left').animate({ opacity: 0, left: "-16%", - }, {duration: 500, queue: false }); + }, {duration: 350, queue: false }); jQuery('.b-platevisual__plates--right').animate({ opacity: 0, left: "116%", - }, {duration: 500, queue: false }); + }, {duration: 350, queue: false }); } function animatePlatesIn() { jQuery('.b-platevisual__plates--left').animate({ opacity: 1, left: "21%", - }, {duration: 500, queue: false }); + }, {duration: 350, queue: false }); jQuery('.b-platevisual__plates--right').animate({ opacity: 1, left: "79%", - }, {duration: 500, queue: false }); + }, {duration: 350, queue: false }); } @@ -111,14 +111,12 @@ if (jQuery('.b-platevisual__plate').length > 0) { //animates plates off animatePlatesOut(); - //updates plates - // jQuery(".b-platevisual__plates").html(weighthtml); //updates plates - v2 setTimeout(function(){ jQuery(".b-platevisual__plates").html(weighthtml); }, 500); //animates plates back on - setTimeout(animatePlatesIn, 500); + setTimeout(animatePlatesIn, 350); } else { //updates plates jQuery(".b-platevisual__plates").html(weighthtml); @@ -145,7 +143,7 @@ // The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area $('html, body').animate({ scrollTop: $(hash).offset().top - }, 800, function(){ + }, 500, function(){ // Add hash (#) to URL when done scrolling (default click behavior) window.location.hash = hash; @@ -156,7 +154,6 @@ //show reset button on calculate jQuery(".input-calculate").click(function(){ jQuery(".b-infoentry__reset, .b-platevisual__weightfinal, .b-platevisual__weightdifference").show(); - }); //hide reset button on weight input @@ -168,14 +165,7 @@ jQuery(".b-infoentry__reset").click(function(){ jQuery(".input-weight, .input-weightsneeded").val(''); jQuery(".input-final, .input-difference").html('0'); - jQuery('.b-platevisual__plates--left').animate({ - opacity: 0, - left: "-16%", - }, {duration: 500, queue: false }); - jQuery('.b-platevisual__plates--right').animate({ - opacity: 0, - left: "116%", - }, {duration: 500, queue: false }); + animatePlatesOut(); jQuery(".b-infoentry__reset, .b-platevisual__weightfinal, .b-platevisual__weightdifference").hide(); });