In night mode, further left swipes reduce the screen brightness (3 levels) until returning to day-mode

pull/278/head
Paul Cockrell 2020-04-11 01:52:27 +01:00
parent b7d94f3244
commit 20ad2efbd4
4 changed files with 18 additions and 5 deletions

View File

@ -914,7 +914,7 @@
{ "id": "marioclock",
"name": "Mario Clock",
"icon": "marioclock.png",
"version":"0.09",
"version":"0.10",
"description": "Animated retro Mario clock, with Gameboy style 8-bit grey-scale graphics.",
"tags": "clock,mario,retro",
"type": "clock",

View File

@ -7,3 +7,4 @@
0.07: Swipe right to change between Mario and Toad characters, swipe left to toggle night mode
0.08: Update date panel to be info panel toggling between Date, Battery and Temperature. Add Princes Daisy
0.09: Add GadgetBridge functionality. Mario shows message type in speach bubble, while message scrolls in info panel
0.10: Swiping left to enable night-mode now also reduces LCD brightness through 3 levels before returning to day-mode.

View File

@ -8,7 +8,7 @@ Enjoy watching Mario, or one of the other game characters run through a level wh
## Features
* Multiple characters - swipe the screen right to change the character between `Mario`, `Toad`, and `Daisy`
* Night and Day modes - swipe left to toggle mode
* Night and Day modes - swipe left to enter night mode, with 3 levels of darkness before returning to day mode.
* Smooth animation
* Awesome 8-bit style grey-scale graphics
* Mario jumps to change the time, every minute

View File

@ -16,6 +16,8 @@ const is12Hour = settings["12hour"] || false;
// Screen dimensions
let W, H;
// Screen brightness
let brightness = 1;
let intervalRef, displayTimeoutRef = null;
@ -164,7 +166,17 @@ function switchCharacter() {
}
function toggleNightMode() {
nightMode = !nightMode;
if (!nightMode) {
nightMode = true;
return;
}
brightness -= 0.30;
if (brightness <= 0) {
brightness = 1;
nightMode = false;
}
Bangle.setLCDBrightness(brightness);
}
function incrementTimer() {
@ -625,4 +637,4 @@ function init() {
}
// Initialise!
init()
init();