master
Tom Wallroth 2024-04-10 22:00:41 +02:00
parent 6398d6b6d2
commit e2c7116fad
15 changed files with 63 additions and 38 deletions

View File

@ -1 +0,0 @@
require("heatshrink").decompress(atob("mEwgf/ABH7tu27YCCCBP+BwYCCv4RI+wRGt4RQtoLCgEPCIYLCLIUWCOO0gEtI5wR/COoABj6hOAAMDCL4AFCIQCFCJH2CLFvCJH+CKH/CI1/CJI/OBAX0yVJkgCBl///pgF24IBBwQCD3/tQ43/9IRGy4RH74RISwwRBBwgCDBwTOChoRDyAICgIRQhIRXmxHGpEAiRHGCKI1GCNxZjCP4RGAQgRDAQoRI9IRH9oRPy/9CI3//oRG3//CIoHB//0CIkl/4="))

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -1,15 +0,0 @@
{ "id": "lift",
"name": "Lift - Workout Timer App",
"shortName":"Lift",
"version": "0.01",
"description": "Rest and Set counter for workout, fitness and lifting things.",
"icon": "app.png",
"screenshots": [{"url": "screenshot.png"}, {"url": "screenshot2.png"}, {"url": "screenshot3.png"}, {"url": "screenshot4.png"}],
"tags": "workout,weight lifting,rest,fitness,timer",
"supports" : ["BANGLEJS2"],
"readme": "README.md",
"storage": [
{"name":"lift.app.js","url":"lift.app.js"},
{"name":"lift.img","url":"app-icon.js","evaluate":true}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -1,8 +1,8 @@
# Lift # Rest - Workout Timer
An app to keep track of your sets when lifting things and to keep track of your rest when not lifting things. An app to keep track of time when not lifting things and keep track of your sets when lifting things.
![screenshot](screenshot.png) ![screenshot](screenshot1.png)
## Usage ## Usage

1
apps/rest/app-icon.js Normal file
View File

@ -0,0 +1 @@
require("heatshrink").decompress(atob("mEwwkA///+czAAk/BIILM+eIAAwMCme7AAwLCCw4ABEQIWHAAIuJGAX7C5M//AXJx87C5O/nAXJwYXK2YXax6UGC4e/UIYXJ/42DC6B7BwYwDC4iTGI44vJYgpHSC5JEBI5LzGL7gXjU64XKAA4XDAA4XYIYIAIx4XKV4IXJn6LGAAc//4XJOAgAGPoQuIBYMzFxIYCmYAEBQYLMABQWGDAgLLm93AA1zKYQAIEQIWHAAM/FxAwCFxAABl4XWuYXzUIQXHRAX/+QXGYoYXIEgMzmQXHco5HEn8nI6YXMJAQXUJQwXPCgQXsO8szd5IAGC4oAFC/4AHl5xEAAv/+YXJRQIwISoUyCw8jXQQALHRH/"))

BIN
apps/rest/app.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

15
apps/rest/metadata.json Normal file
View File

@ -0,0 +1,15 @@
{ "id": "rest",
"name": "Rest - Workout Timer App",
"shortName":"Rest",
"version": "0.01",
"description": "Rest timer and Set counter for workout, fitness and lifting things.",
"icon": "app.png",
"screenshots": [{"url": "screenshot1.png"}, {"url": "screenshot2.png"}, {"url": "screenshot3.png"}],
"tags": "workout,weight lifting,rest,fitness,timer",
"supports" : ["BANGLEJS2"],
"readme": "README.md",
"storage": [
{"name":"rest.app.js","url":"rest.app.js"},
{"name":"rest.img","url":"app-icon.js","evaluate":true}
]
}

View File

@ -50,14 +50,17 @@ const c4 = center(q4)
const GREY_COLOR = '#CCCCCC'; const GREY_COLOR = '#CCCCCC';
const SET_COLOR = '#FF00FF'; const SET_COLOR = '#FF00FF';
const SET_COLOR_MUTED = '#FF88FF';
const REST_COLOR = '#00FFFF'; const REST_COLOR = '#00FFFF';
const REST_COLOR_MUTED = '#008888'; const REST_COLOR_MUTED = '#88FFFF';
const RED_COLOR = '#FF0000'; const RED_COLOR = '#FF0000';
const GREEN_COLOR = '#00FF00'; const GREEN_COLOR = '#00FF00';
const GREEN_COLOR_MUTED = '#008800'; const GREEN_COLOR_MUTED = '#88FF88';
const BIG_FONT = "6x8:2x2"; const BIG_FONT = "6x8:2x2";
const HUGE_FONT = "6x8:3x3";
const BIGHUGE_FONT = "6x8:6x6";
function drawMainMenu() { function drawMainMenu(splash) {
g.setColor(REST_COLOR); g.setColor(REST_COLOR);
roundRect(q1.x, q1.y, q1.x2, q1.y2, 20); roundRect(q1.x, q1.y, q1.x2, q1.y2, 20);
g.setColor(SET_COLOR); g.setColor(SET_COLOR);
@ -67,12 +70,24 @@ function drawMainMenu() {
g.setColor(GREEN_COLOR); g.setColor(GREEN_COLOR);
roundRect(q4.x, q4.y, q4.x2, q4.y2, 20); roundRect(q4.x, q4.y, q4.x2, q4.y2, 20);
g.setColor(-1) g.setColor(-1)
g.setFont("6x8").setFontAlign(0,0).drawString("Tap to\nConfigure", c1.x, c1.y-25)
g.setFont(BIG_FONT).setFontAlign(0,0).drawString("REST\n" +restSeconds+ "s", c1.x, c1.y + 10) if (splash) {
g.setFont("6x8").setFontAlign(0,0).drawString("Tap to\nConfigure", c2.x, c2.y-25) g.setFont(BIGHUGE_FONT).setFontAlign(0,0).drawString("R", c1.x, c1.y)
g.setFont(BIG_FONT).setFontAlign(0,0).drawString("SETS\n" + setsCount, c2.x, c2.y + 10) g.setFont(BIGHUGE_FONT).setFontAlign(0,0).drawString("E", c2.x, c2.y)
g.setFont(BIG_FONT).setFontAlign(0,0).drawString("Lift", c3.x, c3.y) g.setFont(BIGHUGE_FONT).setFontAlign(0,0).drawString("S", c3.x, c3.y)
g.setFont(BIG_FONT).setFontAlign(0,0).drawString("GO", c4.x, c4.y) g.setFont(BIGHUGE_FONT).setFontAlign(0,0).drawString("T", c4.x, c4.y)
} else {
g.setFont("6x8").setFontAlign(0,0).drawString("Tap to\nConfigure", c1.x, c1.y-25)
g.setFont(HUGE_FONT).setFontAlign(0,0).drawString(restSeconds+ "s", c1.x, c1.y)
g.setFont(BIG_FONT).setFontAlign(0,0).drawString("REST", c1.x, c1.y + 25)
g.setFont("6x8").setFontAlign(0,0).drawString("Tap to\nConfigure", c2.x, c2.y-25)
g.setFont(HUGE_FONT).setFontAlign(0,0).drawString(setsCount, c2.x, c2.y)
g.setFont(BIG_FONT).setFontAlign(0,0).drawString("SETS", c2.x, c2.y + 25)
g.setFont(BIG_FONT).setFontAlign(0,0).drawString("JUST\nDO\nIT", c3.x, c3.y)
g.setFont(HUGE_FONT).setFontAlign(0,0).drawString("GO", c4.x, c4.y)
}
} }
function drawSetRest() { function drawSetRest() {
@ -83,7 +98,9 @@ function drawSetRest() {
g.setColor(GREEN_COLOR); g.setColor(GREEN_COLOR);
roundRect(q4.x, q4.y, q4.x2, q4.y2, 20); roundRect(q4.x, q4.y, q4.x2, q4.y2, 20);
g.setColor(-1) g.setColor(-1)
g.setFont(BIG_FONT).setFontAlign(0,0).drawString("REST\n" +restSeconds+ "s", c1.x, c1.y) g.setFont("6x8").setFontAlign(0,0).drawString("Tap to\nConfirm", c1.x, c1.y-25)
g.setFont(HUGE_FONT).setFontAlign(0,0).drawString(restSeconds+ "s", c1.x, c1.y)
g.setFont(BIG_FONT).setFontAlign(0,0).drawString("REST", c1.x, c1.y + 25)
// g.setFont(BIG_FONT).setFontAlign(0,0).drawString("OK", c2.x, c2.y) // g.setFont(BIG_FONT).setFontAlign(0,0).drawString("OK", c2.x, c2.y)
g.setFont(BIG_FONT).setFontAlign(0,0).drawString("-", c3.x, c3.y) g.setFont(BIG_FONT).setFontAlign(0,0).drawString("-", c3.x, c3.y)
g.setFont(BIG_FONT).setFontAlign(0,0).drawString("+", c4.x, c4.y) g.setFont(BIG_FONT).setFontAlign(0,0).drawString("+", c4.x, c4.y)
@ -97,7 +114,9 @@ function drawSetSets() {
g.setColor(GREEN_COLOR); g.setColor(GREEN_COLOR);
roundRect(q4.x, q4.y, q4.x2, q4.y2, 20); roundRect(q4.x, q4.y, q4.x2, q4.y2, 20);
g.setColor(-1) g.setColor(-1)
g.setFont(BIG_FONT).setFontAlign(0,0).drawString("SETS\n" +setsCount, c2.x, c2.y) g.setFont("6x8").setFontAlign(0,0).drawString("Tap to\nConfirm", c2.x, c2.y-25)
g.setFont(HUGE_FONT).setFontAlign(0,0).drawString(setsCount, c2.x, c2.y)
g.setFont(BIG_FONT).setFontAlign(0,0).drawString("SETS", c2.x, c2.y + 25)
g.setFont(BIG_FONT).setFontAlign(0,0).drawString("-", c3.x, c3.y) g.setFont(BIG_FONT).setFontAlign(0,0).drawString("-", c3.x, c3.y)
g.setFont(BIG_FONT).setFontAlign(0,0).drawString("+", c4.x, c4.y) g.setFont(BIG_FONT).setFontAlign(0,0).drawString("+", c4.x, c4.y)
} }
@ -110,7 +129,8 @@ function drawExercise() {
g.setColor(GREEN_COLOR_MUTED); g.setColor(GREEN_COLOR_MUTED);
roundRect(q4.x, q4.y, q4.x2, q4.y2, 20); roundRect(q4.x, q4.y, q4.x2, q4.y2, 20);
g.setColor(-1); g.setColor(-1);
g.setFont(BIG_FONT).setFontAlign(0,0).drawString("SET\n#"+currentSet, c2.x, c2.y) g.setFont(BIG_FONT).setFontAlign(0,0).drawString("SET", c2.x, c2.y-25)
g.setFont(HUGE_FONT).setFontAlign(0,0).drawString("#"+currentSet, c2.x, c2.y)
g.setFont(BIG_FONT).setFontAlign(0,0).drawString("PUSH >\nBUTTON\nWHEN\nDONE", c4.x, c4.y) g.setFont(BIG_FONT).setFontAlign(0,0).drawString("PUSH >\nBUTTON\nWHEN\nDONE", c4.x, c4.y)
} }
@ -123,7 +143,7 @@ function circlePoints (cx, cy, r, points) {
return circlePoints; return circlePoints;
} }
const smallQ3Circle = [c2.x, c2.y].concat(circlePoints(c2.x, c2.y, (q2.y - q2.y2)/2, 60)); const smallQ3Circle = [c2.x, c2.y].concat(circlePoints(c2.x, c2.y, ((q2.y - q2.y2)/2) + 10, 60));
function drawRest() { function drawRest() {
@ -132,8 +152,10 @@ function drawRest() {
g.setColor(REST_COLOR); g.setColor(REST_COLOR);
roundRect(q1.x, q1.y, q1.x2, q1.y2, 20); roundRect(q1.x, q1.y, q1.x2, q1.y2, 20);
g.setColor(-1).setFont(BIG_FONT).setFontAlign(0,0).drawString(secondsRemaining, c1.x, c1.y) g.setColor(-1).setFont(HUGE_FONT).setFontAlign(0,0).drawString(secondsRemaining, c1.x, c1.y)
g.setColor(SET_COLOR_MUTED);
roundRect(q2.x, q2.y, q2.x2, q2.y2, 20);
const factor = 1 - secondsRemaining / restSeconds; const factor = 1 - secondsRemaining / restSeconds;
const circleParts = (((factor * smallQ3Circle.length) | 0) >> 1) << 1 const circleParts = (((factor * smallQ3Circle.length) | 0) >> 1) << 1
const poly = smallQ3Circle.slice(0, circleParts + 2) const poly = smallQ3Circle.slice(0, circleParts + 2)
@ -175,18 +197,19 @@ function drawDoIt() {
g.setFont(BIG_FONT) g.setFont(BIG_FONT)
g.setColor(0); g.setColor(0);
setTimeout(() => { setTimeout(() => {
g.drawString('just', 40, 20); g.setFontAlign(0, 0)
g.drawString('just ', R.x2/2, 20);
Bangle.buzz(150, 0.5); Bangle.buzz(150, 0.5);
}, 200); }, 200);
setTimeout(() => { setTimeout(() => {
g.drawImage(getImg(), 22, 44, {scale: 1.5}); g.drawImage(getImg(), 22, 44, {scale: 1.5});
g.drawString('DO', 100, 20); g.drawString(' DO ', R.x2/2, 20);
Bangle.buzz(200); Bangle.buzz(200);
}, 1000); }, 1000);
setTimeout(() => { setTimeout(() => {
g.drawString('IT', 150, 20); g.drawString(' IT', R.x2/2, 20);
Bangle.buzz(200); Bangle.buzz(200);
}, 1300); }, 1400);
setTimeout(() => { setTimeout(() => {
setMode(MAIN_MENU); setMode(MAIN_MENU);
redrawApp(); redrawApp();
@ -293,5 +316,7 @@ Bangle.on('touch', (button, xy) => {
} }
}); });
redrawApp(); g.clear();
drawMainMenu(true);
setTimeout(redrawApp, 1000);

BIN
apps/rest/screenshot2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
apps/rest/screenshot3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB