From 1fd65136aff5b11eb46c9792fa05c5a647180b84 Mon Sep 17 00:00:00 2001 From: stevenhaskell Date: Tue, 16 Oct 2018 13:20:27 -0400 Subject: [PATCH] Plate visuals now get added on calculation. Plate visuals now get added each time you calculate a weight. Still need to have the plates be animated. Instead of putting in a string it needs to append and add the weights each time. Make a function to append and then animate each weight. --- css/appstyling-v2.css | 8 +++ images/.DS_Store | Bin 0 -> 6148 bytes images/2halflbs-Plate.svg | 2 +- ...ght Calculation Script-Edited-Jquery-V4.js | 51 ++++++++++-------- whatareyouliftingapp-V5.html | 12 +++++ 5 files changed, 51 insertions(+), 22 deletions(-) create mode 100644 images/.DS_Store diff --git a/css/appstyling-v2.css b/css/appstyling-v2.css index b1541b6..dd47fd6 100644 --- a/css/appstyling-v2.css +++ b/css/appstyling-v2.css @@ -130,6 +130,7 @@ p.subheading { .b-platevisual__plates{ position: absolute; + display: inline-flex; } @@ -137,6 +138,7 @@ p.subheading { top: 50%; transform: translate(-100%, -50%); left: 21%; + flex-direction: row-reverse; } @@ -146,6 +148,12 @@ p.subheading { left: 79%; } +.b-platevisual__plate{ + position: relative; + margin: 0px 1px; + vertical-align: middle; +} + .b-calulatorinputs { height: 40vh; width: auto; diff --git a/images/.DS_Store b/images/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T02 . 5 \ No newline at end of file +2.5 \ No newline at end of file diff --git a/js/Weight Calculation Script-Edited-Jquery-V4.js b/js/Weight Calculation Script-Edited-Jquery-V4.js index a72ff1c..f94bea2 100644 --- a/js/Weight Calculation Script-Edited-Jquery-V4.js +++ b/js/Weight Calculation Script-Edited-Jquery-V4.js @@ -1,3 +1,4 @@ +// jQuery( document ).ready(function() { // calculation function starts here function startcalc() { @@ -40,8 +41,12 @@ } + // var plateloader = jQuery(".b-platevisual__plates").html(''); + // console.log(plateloader); + //plate calulation function function platecalculator ( plateWeights, platesAvailable, target, finalWeight) { + var weighthtml = ""; //iterates though the plates availble. for (var i = 0; i < platesAvailable.length; i++) { //checks if the plate is less than or equal to the weight of plates needed @@ -59,6 +64,7 @@ //Adds plates required if (weightToAdd > 0) { jQuery(".input-weightsneeded").eq(i).val(weightToAdd); + //instead of putting in a string and updating all at once. append the weights each time. Make function and append and then animate. Replace this block. } //sets the offset @@ -69,31 +75,34 @@ } } + //replaces html for plates required to bar. + jQuery(".b-platevisual__plates").html(weighthtml); } -//Smooth Scrolling + //Smooth Scrolling -$(document).ready(function(){ - // Add smooth scrolling to all links - $("a").on('click', function(event) { + $(document).ready(function(){ + // Add smooth scrolling to all links + $("a").on('click', function(event) { - // Make sure this.hash has a value before overriding default behavior - if (this.hash !== "") { - // Prevent default anchor click behavior - event.preventDefault(); + // Make sure this.hash has a value before overriding default behavior + if (this.hash !== "") { + // Prevent default anchor click behavior + event.preventDefault(); - // Store hash - var hash = this.hash; + // Store hash + var hash = this.hash; - // Using jQuery's animate() method to add smooth page scroll - // 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(){ - - // Add hash (#) to URL when done scrolling (default click behavior) - window.location.hash = hash; - }); - } // End if + // Using jQuery's animate() method to add smooth page scroll + // 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(){ + + // Add hash (#) to URL when done scrolling (default click behavior) + window.location.hash = hash; + }); + } // End if + }); }); -}); +// }); \ No newline at end of file diff --git a/whatareyouliftingapp-V5.html b/whatareyouliftingapp-V5.html index 8013cd7..742944d 100644 --- a/whatareyouliftingapp-V5.html +++ b/whatareyouliftingapp-V5.html @@ -41,8 +41,20 @@
+
+

Offset: 0 LBS