Skip to content

Commit

Permalink
remove e1RM percentages
Browse files Browse the repository at this point in the history
  • Loading branch information
zack committed May 1, 2019
1 parent 86b6387 commit 7bbaa40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 24 deletions.
7 changes: 1 addition & 6 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
23 changes: 5 additions & 18 deletions src/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "...";
}
}

Expand Down

0 comments on commit 7bbaa40

Please sign in to comment.