mirror of https://github.com/espruino/BangleApps
First commit
parent
e25d51ef9f
commit
36766e69c5
|
@ -0,0 +1 @@
|
||||||
|
0.01: New app!
|
|
@ -0,0 +1,19 @@
|
||||||
|
Do a seven minute workout - or three!
|
||||||
|
|
||||||
|
Touch the screen to start the workout and follow the instructions.
|
||||||
|
|
||||||
|
Once the workout is finished the screen can be touched to go again - but get a minute or two of rest inbetween!
|
||||||
|
|
||||||
|
Search the web if you want further instructions, videos are helpful!
|
||||||
|
|
||||||
|
TODO:
|
||||||
|
- Add visible countdowns
|
||||||
|
- Add tracking of excercises, number of repetitions done etc. (Integration with BanglExercise app?)
|
||||||
|
- Add tracking of workouts over time.
|
||||||
|
- Move the whole app into BangleExercise app?
|
||||||
|
-
|
||||||
|
|
||||||
|
Creator:
|
||||||
|
Thyttan
|
||||||
|
|
||||||
|
<a target="_blank" href="https://icons8.com/icon/19961/jump">Jump</a> icon by <a target="_blank" href="https://icons8.com">Icons8</a>
|
|
@ -0,0 +1 @@
|
||||||
|
require("heatshrink").decompress(atob("mEwwhC/AFfd7oWUhoXB6AuVGCoX/CQZwDO4wGBRJ4uESpYLCBg4KKLQw+EBBAYK6Wq1UtPaAPC7QXB1qSRLAMqC4OiLZQYIC4YWRAAIWBAALvTC/7DLCySoBAASPSCgPc5owSFwXM5gwSFwQXBGCQuC4EMGARGSAoJIRIwXAAoMMJB4uFGCIuFGCIuGGAhGM7gKHGAJIKC4IMIBRRHDAYUzAAQKGABUDCwYABmDvPC4IFDC6IAYJAhGSAAwZNCwQQEA44WJBQ4YMgYLWAH4AaA=="))
|
|
@ -0,0 +1,106 @@
|
||||||
|
/*
|
||||||
|
'Jumping jacks',
|
||||||
|
'Wall sit',
|
||||||
|
'Pushups',
|
||||||
|
'Crunches',
|
||||||
|
'Step-up onto chair, alternating legs',
|
||||||
|
'Squats',
|
||||||
|
'Triceps dips, using a chair or bench',
|
||||||
|
'Forearm plank',
|
||||||
|
'High-knees or running in place',
|
||||||
|
'Lunges, alternating legs',
|
||||||
|
'Pushups with rotation, alternating sides',
|
||||||
|
'Side plank',
|
||||||
|
|
||||||
|
Once you've completed all 12 exercises, take a break for 1–2 minutes and repeat the circuit another 2–3 times.
|
||||||
|
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
|
||||||
|
let R = Bangle.appRect;
|
||||||
|
let instructions = ['Rest\n\nNext up:\n\n',
|
||||||
|
'Tap to start!',
|
||||||
|
'Get ready!\nFirst up:\n',
|
||||||
|
'Jumping jacks',
|
||||||
|
'Wall sit',
|
||||||
|
'Pushups',
|
||||||
|
'Crunches',
|
||||||
|
'Step-up onto\nchair,\nalternating legs',
|
||||||
|
'Squats',
|
||||||
|
'Triceps dips,\n using\ a\nchair or bench',
|
||||||
|
'Forearm plank',
|
||||||
|
'High-knees or\nrunning in place',
|
||||||
|
'Lunges,\nalternating legs',
|
||||||
|
'Pushups with\nrotation,\nalternating sides',
|
||||||
|
'Side plank',
|
||||||
|
'Workout done!'
|
||||||
|
];
|
||||||
|
|
||||||
|
Bangle.setLCDTimeout(0);
|
||||||
|
Bangle.setLocked(false);
|
||||||
|
|
||||||
|
let draw = function(instruction) {
|
||||||
|
g.reset();
|
||||||
|
g.clearRect(R);
|
||||||
|
|
||||||
|
g.setFont12x20();
|
||||||
|
g.setFontAlign(0,0,0);
|
||||||
|
g.drawString(instruction, R.w/2, R.h/2);
|
||||||
|
};
|
||||||
|
|
||||||
|
let endWorkout = function(interval) {
|
||||||
|
draw(instructions[instructions.length-1]);
|
||||||
|
clearInterval(interval);
|
||||||
|
ongoing = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
let cycle = 40; // standard cycle is 40 seconds
|
||||||
|
let scaling = cycle/40; // scaling if changing cycle length
|
||||||
|
let ongoing = false;
|
||||||
|
let touchHandler = function() {
|
||||||
|
if (!ongoing) {
|
||||||
|
Bangle.buzz();
|
||||||
|
ongoing = true;
|
||||||
|
// Get ready!
|
||||||
|
draw(instructions[2]+instructions[3]);
|
||||||
|
let i = 3;
|
||||||
|
// buzzes before start
|
||||||
|
setTimeout(()=>{let j = 0; let buzzes = setInterval(()=>{Bangle.buzz(200*scaling); j++; if (j==5) clearInterval(buzzes);}, 1*1000*scaling);}, 4*1000*scaling);
|
||||||
|
// timeout till first excercise
|
||||||
|
let timeout = setTimeout(()=>{draw(instructions[i]);i++;}, 10*1000*scaling);
|
||||||
|
// buzzes before first rest
|
||||||
|
setTimeout(()=>{let j = 0; let buzzes = setInterval(()=>{Bangle.buzz(200*scaling); j++; if (j==5) clearInterval(buzzes);}, 1*1000*scaling);}, 34*1000*scaling);
|
||||||
|
// interval containing rest and excercises 10+30=40
|
||||||
|
let interval = setInterval(()=>{
|
||||||
|
if (i==instructions.length-1) {
|
||||||
|
endWorkout(interval);
|
||||||
|
} else {
|
||||||
|
// draw pause message
|
||||||
|
draw(instructions[0]+instructions[i]);
|
||||||
|
// buzzes before next excercise
|
||||||
|
setTimeout(()=>{let j = 0; let buzzes = setInterval(()=>{Bangle.buzz(200*scaling); j++; if (j==5) clearInterval(buzzes);}, 1*1000*scaling);}, 4*1000*scaling);
|
||||||
|
// timeout till next excercise
|
||||||
|
setTimeout(()=>{draw(instructions[i]);i++;}, 10*1000*scaling);
|
||||||
|
// buzzes before next rest
|
||||||
|
setTimeout(()=>{let j = 0; let buzzes = setInterval(()=>{Bangle.buzz(200*scaling); j++; if (j==5) clearInterval(buzzes);}, 1*1000*scaling);}, 34*1000*scaling);
|
||||||
|
}
|
||||||
|
}, 40*1000*scaling);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let swipeHandler = function() {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
let uiMode = {
|
||||||
|
mode : 'custom',
|
||||||
|
back : load,
|
||||||
|
touch : touchHandler,
|
||||||
|
//swipe : swipeHandler
|
||||||
|
};
|
||||||
|
Bangle.setUI(uiMode);
|
||||||
|
|
||||||
|
Bangle.loadWidgets();
|
||||||
|
// Tap to start!
|
||||||
|
draw(instructions[1]);
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
|
@ -0,0 +1,16 @@
|
||||||
|
{ "id": "sevenmin",
|
||||||
|
"name": "Seven minute workout",
|
||||||
|
"shortName": "7 min wo",
|
||||||
|
"version": "0.01",
|
||||||
|
"description": "A basic implementation of the famous consice workout",
|
||||||
|
"icon": "icon.png",
|
||||||
|
"type":"app",
|
||||||
|
"tags": "Training, Workout",
|
||||||
|
"supports": ["BANGLEJS2"],
|
||||||
|
"readme": "README.md",
|
||||||
|
"allow_emulator":true,
|
||||||
|
"storage": [
|
||||||
|
{"name":"sevenmin.app.js", "url":"app.js"},
|
||||||
|
{"name":"sevenmin.img", "url":"app-icon.js","evaluate":true}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue