inspire: Disable autolock when breathing

pull/2551/head
pancake 2023-02-01 15:38:46 +01:00
parent becba294dd
commit 999f4abdb8
4 changed files with 50 additions and 44 deletions

View File

@ -1 +1,2 @@
0.01: First public version
0.02: Disable screen lock when breathing

View File

@ -2,7 +2,7 @@
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
@ -10,6 +10,7 @@ Author: Written by pancake in 2022, powered by insomnia
* [x] Tap to start
* [x] Subtle vibrations
* [x] Drag to pause breathing
* [x] Dont lock screen while breathing
* [ ] Automatic buzz every hour during day
## Screenshots

View File

@ -14,6 +14,7 @@ var mode = 0;
var sin = 0;
var dragged = 0;
var lastTime = Date.now();
function breath(t) {
var r = Math.abs(Math.sin(t / 100)) * w2;
g.fillCircle(w/2,h/2, r);
@ -68,6 +69,9 @@ function main() {
return;
}
started = true;
Bangle.setLCDPower(1);
Bangle.setLocked(0);
Bangle.setLCDTimeout(0);
animateCircle();
Bangle.buzz(40);
}
@ -81,7 +85,7 @@ function startBreathing() {
var cicles = 3;
g.setFont("Vector", fs);
var interval = setInterval(function() {
function breathTime() {
if (lastTime + 10 > Date.now()) {
return;
}
@ -120,6 +124,6 @@ if (lastTime + 10 > Date.now()) {
Bangle.showClock();
}
dragged = 0;
}, 4);
}
var interval = setInterval(breathTime, 4);
}

View File

@ -2,7 +2,7 @@
"id": "inspire",
"name": "Inspire Breathing",
"shortName": "Inspire",
"version": "0.01",
"version": "0.02",
"description": "exercise breathing every now and then",
"icon": "app-icon.png",
"tags": "tools,health",