From 8a708a7cad050c96dc0e57f1eddbfeb1afea08da Mon Sep 17 00:00:00 2001 From: stevenhaskell Date: Tue, 23 Oct 2018 22:37:52 -0400 Subject: [PATCH] Updated plate animation script Updated the plate animation to slide the plates off as the weight is recalculated and then slides them back on. Still need to delay the html code update. --- .DS_Store | Bin 6148 -> 6148 bytes ...ght Calculation Script-Edited-Jquery-V4.js | 72 +++++------------- 2 files changed, 21 insertions(+), 51 deletions(-) diff --git a/.DS_Store b/.DS_Store index ef07dc3810fd09c4b6571c08b51f7e8e5156548e..22eaa187f8266d1da539d7205126c80fc19d22e2 100644 GIT binary patch delta 52 zcmZoMXfc@J&nUDpU^gS9&}1H_D$bPRp&IsWnk0K#?= AY5)KL delta 35 rcmZoMXfc@J&nU1lU^gS9z+@h#s>w5%o^77MT+TAFKxH#K$6tN`(`yV0 diff --git a/js/Weight Calculation Script-Edited-Jquery-V4.js b/js/Weight Calculation Script-Edited-Jquery-V4.js index 7222b10..2fe665f 100644 --- a/js/Weight Calculation Script-Edited-Jquery-V4.js +++ b/js/Weight Calculation Script-Edited-Jquery-V4.js @@ -43,27 +43,27 @@ // var plateloader = jQuery(".b-platevisual__plates").html(''); // console.log(plateloader); -function animatePlatesOut () { - 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 }); -} + function animatePlatesOut() { + 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 }); + } -function animatePlatesIn () { - jQuery('.b-platevisual__plates--left').animate({ - opacity: 1, - left: "21%", - }, {duration: 500, queue: false }); - jQuery('.b-platevisual__plates--right').animate({ - opacity: 1, - left: "79%", - }, {duration: 500, queue: false }); -} + function animatePlatesIn() { + jQuery('.b-platevisual__plates--left').animate({ + opacity: 1, + left: "21%", + }, {duration: 500, queue: false }); + jQuery('.b-platevisual__plates--right').animate({ + opacity: 1, + left: "79%", + }, {duration: 500, queue: false }); + } //plate calulation function @@ -109,46 +109,16 @@ function animatePlatesIn () { //replaces and animates html for plates required to bar. //if statment works but need to figureout how to step animation. if (jQuery('.b-platevisual__plate').length > 0) { - console.log("If Statment Fired") //animates plates off - /*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 }); - //updates plates - jQuery(".b-platevisual__plates").html(weighthtml); - //animates plates back on - jQuery('.b-platevisual__plates--left').animate({ - opacity: 1, - left: "21%", - }, {duration: 500, queue: false }); - jQuery('.b-platevisual__plates--right').animate({ - opacity: 1, - left: "79%", - }, {duration: 500, queue: false });*/ - //animates plates off animatePlatesOut(); //updates plates jQuery(".b-platevisual__plates").html(weighthtml); //animates plates back on - setTimeout(animatePlatesIn(), 250); + setTimeout(animatePlatesIn, 500); } else { //updates plates jQuery(".b-platevisual__plates").html(weighthtml); //animates plates back on - /*jQuery('.b-platevisual__plates--left').animate({ - opacity: 1, - left: "21%", - }, {duration: 500, queue: false }); - jQuery('.b-platevisual__plates--right').animate({ - opacity: 1, - left: "79%", - }, {duration: 500, queue: false });*/ - //animates plates back on animatePlatesIn(); } }