Skip to content
Permalink
Browse files

remove e1RM percentages

  • Loading branch information
zack committed May 1, 2019
1 parent 86b6387 commit 7bbaa4064b327431ce317727ba09c6090fb376d3
Showing with 6 additions and 24 deletions.
  1. +1 −6 src/index.html
  2. +5 −18 src/js/script.js
@@ -64,12 +64,7 @@ <h3> Target Numbers </h3>

<div class="results">
<h3> Target weight: <span id="solved-weight"> ... </span> </h3>
<h3> 100% of e1RM: <span id="e1RM"> ... </span> </h3>
<h3> 95% of e1RM: <span id="ninetyFiveP"> ... </span> </h3>
<h3> 85% of e1RM: <span id="eightyFiveP"> ... </span> </h3>
<h3> 80% of e1RM: <span id="eightyP"> ... </span> </h3>
<h3> 75% of e1RM: <span id="seventyFiveP"> ... </span> </h3>
<h3> 65% of e1RM: <span id="sixtyFiveP"> ... </span> </h3>
<h3> Estimated 1RM: <span id="e1RM"> ... </span> </h3>
</div>

<div class="options">
@@ -181,39 +181,26 @@
document.querySelector("input#desired-rpe").disabled = !haveAllGivens;
var desiredWeightEl = document.querySelector("#solved-weight");
var e1RMEl = document.querySelector("#e1RM");
var ninetyFivePEl = document.querySelector("#ninetyFiveP");
var eightyFivePEl = document.querySelector("#eightyFiveP");
var eightyPEl = document.querySelector("#eightyP");
var seventyFivePEl = document.querySelector("#seventyFiveP");
var sixtyFivePEl = document.querySelector("#sixtyFiveP");

if (haveAllGivens) {
var givenRPEDecimal = RPEs["RPE"][givenRPE]["REPS"][givenReps];
var estimated1RM = givenWeight / givenRPEDecimal;

var roundingValue = Number.parseFloat(document.querySelector("select#rounding").value);
var roundingValue = Number.parseFloat(
document.querySelector("select#rounding").value
);

e1RMEl.innerHTML = roundToFloat(estimated1RM, roundingValue);
ninetyFivePEl.innerHTML = roundToFloat(estimated1RM * 0.95, roundingValue);
eightyFivePEl.innerHTML = roundToFloat(estimated1RM * 0.85, roundingValue);
eightyPEl.innerHTML = roundToFloat(estimated1RM * 0.8, roundingValue);
seventyFivePEl.innerHTML = roundToFloat(estimated1RM * 0.75, roundingValue);
sixtyFivePEl.innerHTML = roundToFloat(estimated1RM * 0.65, roundingValue);

if (desiredRPE && desiredReps) {
var desiredRPEDecimal = RPEs["RPE"][desiredRPE]["REPS"][desiredReps];
desiredWeightEl.innerHTML = roundToFloat(
parseInt(estimated1RM * desiredRPEDecimal), roundingValue
parseInt(estimated1RM * desiredRPEDecimal),
roundingValue
);
} else {
desiredWeightEl.innerHTML = "...";
}
} else {
ninetyFivePEl.innerHTML = "...";
eightyFivePEl.innerHTML = "..."
eightyPEl.innerHTML = "..."
seventyFivePEl.innerHTML = "...";
sixtyFivePEl.innerHTML = "...";
}
}

0 comments on commit 7bbaa40

Please sign in to comment.
You can’t perform that action at this time.