1
0
Fork 0

Add interface to set weight values, update README

master
Paul Cockrell 2020-04-23 09:41:57 +01:00
parent 3384f493e2
commit d3c58fb323
2 changed files with 266 additions and 4 deletions

View File

@ -2,17 +2,32 @@
This gym training assistant trains you on the famous [Stronglifts 5x5 workout](https://stronglifts.com/5x5) program. This gym training assistant trains you on the famous [Stronglifts 5x5 workout](https://stronglifts.com/5x5) program.
## Configuration
### Setting your start weight values
You will want to set your own starting weight values for your 5x5 training program. To do this is easy! After installing this app, go to the BangleJS app store, connect to your watch, and navigate to the `My Apps` tab. In there you will find this app in the list, and an icon (a down arrow) to the right of the app title. Click that icon to reveal a configuration page. Enter your weights and other details, and click upload. That is it, you are now ready to train!
## Usage ## Usage
### Start screen
When you start the app it will wait on a splash screen until you are ready to start the work out. Press any of the buttons to start When you start the app it will wait on a splash screen until you are ready to start the work out. Press any of the buttons to start
![](buffgym-scrn1.png) ![](buffgym-scrn1.png)
You are then presented with the programs menu, use BTN1 to move up the list, and BTN3 to move down the list. Once you have made your selection, press BTN2 to select the program. ### Workouts menu
You are then presented with the workouts menu, use BTN1 to move up the list, and BTN3 to move down the list. Once you have made your selection, press BTN2 to select the workout.
![](buffgym-scrn2.png) ![](buffgym-scrn2.png)
You will now begin moving through the exercises in the program. You will see the exercise information on the display. ### Recording your training
You will now begin moving through the exercises in the workout. You will see the exercise information on the display.
![](buffgym-scrn3.png)
1. At the top is the exercise name, e.g 'Squats' 1. At the top is the exercise name, e.g 'Squats'
2. Next is the weight you must train 2. Next is the weight you must train
3. In the center is where you record the number of *reps* you completed (more on that shortly) 3. In the center is where you record the number of *reps* you completed (more on that shortly)
@ -20,13 +35,15 @@ You will now begin moving through the exercises in the program. You will see the
5. Below the target reps is the current set you are training, out of the total sets for the exercise. 5. Below the target reps is the current set you are training, out of the total sets for the exercise.
6. The *reps* value is used to store what you achieved for the current set, you enter this after you have trained on your current set. To alter this value, use BTN1 to increase the value (it will stop at the maximum required reps) and BTN3 to decreas the value to a minimum of 0 (this is the default value). Pressing BTN2 will confirm your reps 6. The *reps* value is used to store what you achieved for the current set, you enter this after you have trained on your current set. To alter this value, use BTN1 to increase the value (it will stop at the maximum required reps) and BTN3 to decreas the value to a minimum of 0 (this is the default value). Pressing BTN2 will confirm your reps
![](buffgym-scrn3.png) ### Rest timers
You will then be presented with a rest timer screen, it counts down and automatically moves to the next exercise when it reaches 0. You can cancel the timer early if you wish by pressing BTN2. If it is the last set of an exercise, you don't need to rest, so it lets you know you have completed all the sets in the exercise and can start the next exercise. You will then be presented with a rest timer screen, it counts down and automatically moves to the next exercise when it reaches 0. You can cancel the timer early if you wish by pressing BTN2. If it is the last set of an exercise, you don't need to rest, so it lets you know you have completed all the sets in the exercise and can start the next exercise.
![](buffgym-scrn4.png) ![](buffgym-scrn4.png)
![](buffgym-scrn5.png) ![](buffgym-scrn5.png)
### Workout completed
Once all exercises are done, you are presented with a pat-on-the-back screen to tell you how awesome you are. Once all exercises are done, you are presented with a pat-on-the-back screen to tell you how awesome you are.
![](buffgym-scrn6.png) ![](buffgym-scrn6.png)
@ -40,4 +57,4 @@ Once all exercises are done, you are presented with a pat-on-the-back screen to
## Created by ## Created by
[Paul Cockrell](https://github.com/paulcockrell) April 2020. [Paul Cockrell](https://github.com/paulcockrell) April 2020.

245
apps/buffgym/buffgym.html Normal file
View File

@ -0,0 +1,245 @@
<html>
<head>
<link rel="stylesheet" href="../../css/spectre.min.css">
</head>
<body>
<h1>BuffGym</h1>
<p>
Enter in your weights for each exercise, start light and keep consistent with your training. The weight increment field is how much the app will increase your weights for an exercise if you successfully complete all the reps and sets for an exercise. Make sure its a value that matches the weights in your gym.
</p>
<p>
For more information on how to train this program refer the <a href="https://stronglifts.com/5x5/" target="_BLANK">Stronglifts website</a>
</p>
<form id="workouts-form">
<h4>Workout A</h4>
<table class="table">
<thead>
<tr>
<th>Exercise</th>
<th>Sets / Reps</th>
<th>Weight</th>
<th>Weight increment</th>
</tr>
</thead>
<tbody id="workout-a-exercises">
<tr>
<td>
Squats
</td>
<td>
5x5
</td>
<td>
<input type="number" value="0" id="buffgym-workout-a-squats-weight" />
</td>
<td>
<input type="number" value="2.5" id="buffgym-workout-a-squats-weight-increment" />
</td>
</tr>
<tr>
<td>
Overhead press
</td>
<td>
5x5
</td>
<td>
<input type="number" value="0" id="buffgym-workout-a-overhead-press-weight" />
</td>
<td>
<input type="number" value="2.5" id="buffgym-workout-a-overhead-press-weight-increment" />
</td>
</tr>
<tr>
<td>
Deadlift
</td>
<td>
1x5
</td>
<td>
<input type="number" value="0" id="buffgym-workout-a-deadlift-weight" />
</td>
<td>
<input type="number" value="2.5" id="buffgym-workout-a-deadlift-weight-increment" />
</td>
</tr>
<tr>
<td>
Pullups
</td>
<td>
3x10
</td>
<td>
<input type="number" value="0" id="buffgym-workout-a-pullups-weight" />
</td>
<td>
<input type="number" value="2.5" id="buffgym-workout-a-pullups-weight-increment" />
</td>
</tr>
</tbody>
</table>
<h4>Workout B</h4>
<table class="table">
<thead>
<tr>
<th>Exercise</th>
<th>Sets / Reps</th>
<th>Weight</th>
<th>Weight increment</th>
</tr>
</thead>
<tbody id="workout-b-exercises">
<tr>
<td>
Squats
</td>
<td>
5x5
</td>
<td>
<input type="number" value="0" id="buffgym-workout-b-squats-weight" />
</td>
<td>
<input type="number" value="2.5" id="buffgym-workout-b-squats-weight-increment" />
</td>
</tr>
<tr>
<td>
Bench press
</td>
<td>
5x5
</td>
<td>
<input type="number" value="0" id="buffgym-workout-b-bench-press-weight" />
</td>
<td>
<input type="number" value="2.5" id="buffgym-workout-b-bench-press-weight-increment" />
</td>
</tr>
<tr>
<td>
Row
</td>
<td>
5x5
</td>
<td>
<input type="number" value="0" id="buffgym-workout-b-row-weight" />
</td>
<td>
<input type="number" value="2.5" id="buffgym-workout-b-row-weight-increment" />
</td>
</tr>
<tr>
<td>
Tricep extension
</td>
<td>
3x10
</td>
<td>
<input type="number" value="0" id="buffgym-workout-b-triceps-weight" />
</td>
<td>
<input type="number" value="2.5" id="buffgym-workout-b-triceps-weight-increment" />
</td>
</tr>
</tbody>
</table>
</form>
<br><br>
<button id="upload" class="btn btn-primary">Upload</button>
<script src="../../lib/interface.js"></script>
<script>
function workoutA() {
return {
"title": "Workout A",
"exercises": [
{
"title": "Squats",
"weight": Number(document.getElementById("buffgym-workout-a-squats-weight").value),
"weightIncrement": Number(document.getElementById("buffgym-workout-a-squats-weight-increment").value),
"unit": "Kg",
"sets": [5, 5, 5, 5, 5],
"restPeriod": 90
},
{
"title": "Overhead press",
"weight": Number(document.getElementById("buffgym-workout-a-overhead-press-weight").value),
"weightIncrement": Number(document.getElementById("buffgym-workout-a-overhead-press-weight-increment").value),
"unit": "Kg",
"sets": [5, 5, 5, 5, 5],
"restPeriod": 90
},
{
"title": "Deadlift",
"weight": Number(document.getElementById("buffgym-workout-a-deadlift-weight").value),
"weightIncrement": Number(document.getElementById("buffgym-workout-a-deadlift-weight-increment").value),
"unit": "Kg",
"sets": [5],
"restPeriod": 90
},
{
"title": "Pullups",
"weight": Number(document.getElementById("buffgym-workout-a-pullups-weight").value),
"weightIncrement": Number(document.getElementById("buffgym-workout-a-pullups-weight-increment").value),
"unit": "Kg",
"sets": [10, 10, 10],
"restPeriod": 90
}
]
};
}
function workoutB() {
return {
"title": "Workout B",
"exercises": [
{
"title": "Squats",
"weight": Number(document.getElementById("buffgym-workout-b-squats-weight").value),
"weightIncrement": Number(document.getElementById("buffgym-workout-b-squats-weight-increment").value),
"unit": "Kg",
"sets": [5, 5, 5, 5, 5],
"restPeriod": 90
},
{
"title": "Bench press",
"weight": Number(document.getElementById("buffgym-workout-b-bench-press-weight").value),
"weightIncrement": Number(document.getElementById("buffgym-workout-b-bench-press-weight-increment").value),
"unit": "Kg",
"sets": [5, 5, 5, 5, 5],
"restPeriod": 90
},
{
"title": "Row",
"weight": Number(document.getElementById("buffgym-workout-b-row-weight").value),
"weightIncrement": Number(document.getElementById("buffgym-workout-b-row-weight-increment").value),
"unit":"Kg",
"sets": [5, 5, 5, 5, 5],
"restPeriod": 90
},
{
"title": "Tricep extension",
"weight": Number(document.getElementById("buffgym-workout-b-triceps-weight").value),
"weightIncrement": Number(document.getElementById("buffgym-workout-b-triceps-weight-increment").value),
"unit": "Kg",
"sets": [10, 10, 10],
"restPeriod": 90
}
]
};
}
document.getElementById("upload").addEventListener("click", function() {
Puck.eval(`require("Storage").writeJSON("buffgym-workout-a.json",${JSON.stringify(workoutA())})`, ()=>{console.log("Done uploading workout A")});
Puck.eval(`require("Storage").writeJSON("buffgym-workout-b.json",${JSON.stringify(workoutB())})`, ()=>{console.log("Done uploading workout B")});
});
</script>
</body>
</html>