mirror of https://github.com/espruino/BangleApps
More fixes
parent
900805e71b
commit
707f4a1ccd
|
@ -2,10 +2,8 @@ const STARTED = 1;
|
||||||
const RESTING = 2;
|
const RESTING = 2;
|
||||||
const COMPLETED = 3;
|
const COMPLETED = 3;
|
||||||
const ONE_SECOND = 1000;
|
const ONE_SECOND = 1000;
|
||||||
const INCREMENT = "increment";
|
|
||||||
const DECREMENT = "decrement";
|
|
||||||
|
|
||||||
class Exercise {
|
exports = class Exercise {
|
||||||
constructor(params /*{title, weight, unit, restPeriod}*/) {
|
constructor(params /*{title, weight, unit, restPeriod}*/) {
|
||||||
const DEFAULTS = {
|
const DEFAULTS = {
|
||||||
title: "Unknown",
|
title: "Unknown",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Program {
|
exports = class Program {
|
||||||
constructor(params) {
|
constructor(params) {
|
||||||
const DEFAULTS = {
|
const DEFAULTS = {
|
||||||
title: "Unknown",
|
title: "Unknown",
|
||||||
|
|
|
@ -1,101 +1 @@
|
||||||
[
|
[{"title":"Program A","exercises":[{"title":"Squats","weight":40,"unit":"Kg","sets":[5,5,5,5,5]},{"title":"Overhead press","weight":20,"unit":"Kg","sets":[5,5,5,5,5]},{"title":"Deadlift","weight":20,"unit":"Kg","sets":[5]},{"title":"Pullups","weight":0,"unit":"Kg","sets":[10,10,10]}]},{"title":"Program B","exercises":[{"title":"Squats","weight":40,"unit":"Kg","sets":[5,5,5,5,5]},{"title":"Bench press","weight":20,"unit":"Kg","sets":[5,5,5,5,5]},{"title":"Row","weight":20,"unit":"Kg","sets":[5,5,5,5,5]},{"title":"Tricep extension","weight":20,"unit":"Kg","sets":[10,10,10]}]}]
|
||||||
{
|
|
||||||
title: "Program A",
|
|
||||||
exercises: [
|
|
||||||
{
|
|
||||||
title: "Squats",
|
|
||||||
weight: 40,
|
|
||||||
unit: "Kg",
|
|
||||||
sets: [
|
|
||||||
5,
|
|
||||||
5,
|
|
||||||
5,
|
|
||||||
5,
|
|
||||||
5
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Overhead press",
|
|
||||||
weight: 20,
|
|
||||||
unit: "Kg",
|
|
||||||
sets: [
|
|
||||||
5,
|
|
||||||
5,
|
|
||||||
5,
|
|
||||||
5,
|
|
||||||
5
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Deadlift",
|
|
||||||
weight: 20,
|
|
||||||
unit: "Kg",
|
|
||||||
sets: [
|
|
||||||
5
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Pullups",
|
|
||||||
weight: 0,
|
|
||||||
unit: "Kg",
|
|
||||||
sets: [
|
|
||||||
10,
|
|
||||||
10,
|
|
||||||
10
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Program B",
|
|
||||||
exercises: [
|
|
||||||
{
|
|
||||||
title: "Squats",
|
|
||||||
weight: 40,
|
|
||||||
unit: "Kg",
|
|
||||||
sets: [
|
|
||||||
5,
|
|
||||||
5,
|
|
||||||
5,
|
|
||||||
5,
|
|
||||||
5
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Bench press",
|
|
||||||
weight: 20,
|
|
||||||
unit: "Kg",
|
|
||||||
sets: [
|
|
||||||
5,
|
|
||||||
5,
|
|
||||||
5,
|
|
||||||
5,
|
|
||||||
5
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Row",
|
|
||||||
weight: 20,
|
|
||||||
unit:"Kg",
|
|
||||||
sets: [
|
|
||||||
5,
|
|
||||||
5,
|
|
||||||
5,
|
|
||||||
5,
|
|
||||||
5
|
|
||||||
]
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Tricep extension",
|
|
||||||
weight: 20,
|
|
||||||
unit: "Kg",
|
|
||||||
sets: [
|
|
||||||
10,
|
|
||||||
10,
|
|
||||||
10
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
|
@ -0,0 +1,101 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"title": "Program A",
|
||||||
|
"exercises": [
|
||||||
|
{
|
||||||
|
"title": "Squats",
|
||||||
|
"weight": 40,
|
||||||
|
"unit": "Kg",
|
||||||
|
"sets": [
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Overhead press",
|
||||||
|
"weight": 20,
|
||||||
|
"unit": "Kg",
|
||||||
|
"sets": [
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Deadlift",
|
||||||
|
"weight": 20,
|
||||||
|
"unit": "Kg",
|
||||||
|
"sets": [
|
||||||
|
5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Pullups",
|
||||||
|
"weight": 0,
|
||||||
|
"unit": "Kg",
|
||||||
|
"sets": [
|
||||||
|
10,
|
||||||
|
10,
|
||||||
|
10
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Program B",
|
||||||
|
"exercises": [
|
||||||
|
{
|
||||||
|
"title": "Squats",
|
||||||
|
"weight": 40,
|
||||||
|
"unit": "Kg",
|
||||||
|
"sets": [
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Bench press",
|
||||||
|
"weight": 20,
|
||||||
|
"unit": "Kg",
|
||||||
|
"sets": [
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Row",
|
||||||
|
"weight": 20,
|
||||||
|
"unit":"Kg",
|
||||||
|
"sets": [
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
5,
|
||||||
|
5
|
||||||
|
]
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Tricep extension",
|
||||||
|
"weight": 20,
|
||||||
|
"unit": "Kg",
|
||||||
|
"sets": [
|
||||||
|
10,
|
||||||
|
10,
|
||||||
|
10
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
|
@ -1,4 +1,4 @@
|
||||||
class Set {
|
exports = class Set {
|
||||||
constructor(maxReps) {
|
constructor(maxReps) {
|
||||||
this._minReps = 0;
|
this._minReps = 0;
|
||||||
this._maxReps = maxReps;
|
this._maxReps = maxReps;
|
||||||
|
|
|
@ -1,15 +1,12 @@
|
||||||
/* global g, setWatch, clearWatch, reset, BTN1, BTN2, BTN3 */
|
|
||||||
|
|
||||||
(() => {
|
|
||||||
const W = g.getWidth();
|
const W = g.getWidth();
|
||||||
const H = g.getHeight();
|
const H = g.getHeight();
|
||||||
const RED = "#d32e29";
|
const RED = "#d32e29";
|
||||||
const PINK = "#f05a56";
|
const PINK = "#f05a56";
|
||||||
const WHITE = "#ffffff";
|
const WHITE = "#ffffff";
|
||||||
|
|
||||||
const Set = require("set.js");
|
const Set = require("buffgym-set.js");
|
||||||
const Exercise = require("exercise.js");
|
const Exercise = require("buffgym-exercise.js");
|
||||||
const Program = require("program.js");
|
const Program = require("buffgym-program.js");
|
||||||
|
|
||||||
function centerStringX(str) {
|
function centerStringX(str) {
|
||||||
return (W - g.stringWidth(str)) / 2;
|
return (W - g.stringWidth(str)) / 2;
|
||||||
|
@ -227,4 +224,3 @@
|
||||||
// really happen is the user picks a program to do from
|
// really happen is the user picks a program to do from
|
||||||
// some menu on a start page.
|
// some menu on a start page.
|
||||||
init(buildPrograms()[0]);
|
init(buildPrograms()[0]);
|
||||||
})();
|
|
Loading…
Reference in New Issue