inspire: Disable autolock when breathing
parent
becba294dd
commit
999f4abdb8
|
|
@ -1 +1,2 @@
|
||||||
0.01: First public version
|
0.01: First public version
|
||||||
|
0.02: Disable screen lock when breathing
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
A minimalistic app that will help you practive breathing.
|
A minimalistic app that will help you practive breathing.
|
||||||
|
|
||||||
Author: Written by pancake in 2022, powered by insomnia
|
Author: Written by pancake in 2022, updated in 2023, powered by insomnia
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
|
@ -10,6 +10,7 @@ Author: Written by pancake in 2022, powered by insomnia
|
||||||
* [x] Tap to start
|
* [x] Tap to start
|
||||||
* [x] Subtle vibrations
|
* [x] Subtle vibrations
|
||||||
* [x] Drag to pause breathing
|
* [x] Drag to pause breathing
|
||||||
|
* [x] Dont lock screen while breathing
|
||||||
* [ ] Automatic buzz every hour during day
|
* [ ] Automatic buzz every hour during day
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ var mode = 0;
|
||||||
var sin = 0;
|
var sin = 0;
|
||||||
var dragged = 0;
|
var dragged = 0;
|
||||||
var lastTime = Date.now();
|
var lastTime = Date.now();
|
||||||
|
|
||||||
function breath(t) {
|
function breath(t) {
|
||||||
var r = Math.abs(Math.sin(t / 100)) * w2;
|
var r = Math.abs(Math.sin(t / 100)) * w2;
|
||||||
g.fillCircle(w/2,h/2, r);
|
g.fillCircle(w/2,h/2, r);
|
||||||
|
|
@ -68,6 +69,9 @@ function main() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
started = true;
|
started = true;
|
||||||
|
Bangle.setLCDPower(1);
|
||||||
|
Bangle.setLocked(0);
|
||||||
|
Bangle.setLCDTimeout(0);
|
||||||
animateCircle();
|
animateCircle();
|
||||||
Bangle.buzz(40);
|
Bangle.buzz(40);
|
||||||
}
|
}
|
||||||
|
|
@ -81,7 +85,7 @@ function startBreathing() {
|
||||||
var cicles = 3;
|
var cicles = 3;
|
||||||
g.setFont("Vector", fs);
|
g.setFont("Vector", fs);
|
||||||
|
|
||||||
var interval = setInterval(function() {
|
function breathTime() {
|
||||||
if (lastTime + 10 > Date.now()) {
|
if (lastTime + 10 > Date.now()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -120,6 +124,6 @@ if (lastTime + 10 > Date.now()) {
|
||||||
Bangle.showClock();
|
Bangle.showClock();
|
||||||
}
|
}
|
||||||
dragged = 0;
|
dragged = 0;
|
||||||
|
}
|
||||||
}, 4);
|
var interval = setInterval(breathTime, 4);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "inspire",
|
"id": "inspire",
|
||||||
"name": "Inspire Breathing",
|
"name": "Inspire Breathing",
|
||||||
"shortName": "Inspire",
|
"shortName": "Inspire",
|
||||||
"version": "0.01",
|
"version": "0.02",
|
||||||
"description": "exercise breathing every now and then",
|
"description": "exercise breathing every now and then",
|
||||||
"icon": "app-icon.png",
|
"icon": "app-icon.png",
|
||||||
"tags": "tools,health",
|
"tags": "tools,health",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue