Skip to content

Commit a498060

Browse files
committed
feat: add settings page for night mode, timezone and language
- New /config page (gear icon on the dashboard) with a set-config API that stores preferences in cookies: night mode by fixed hours or by sunrise and sunset, custom night start/end, high contrast, timezone, and language. - Night mode scheduling now uses the configured timezone instead of the device clock, and sun mode follows sunrise/sunset at the configured location; the dashboard caches the sun times so the setup and config pages can resolve sun mode too. Closes #79. - Pages pre-render the resolved theme server-side, removing the dark flash on every reload. - Location and settings cookies persist for a year, so a browser restart on the kiosk no longer loses the setup.
1 parent 47a80be commit a498060

16 files changed

Lines changed: 9642 additions & 13683 deletions

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,20 @@ npm install
6161
npm run dev
6262
```
6363

64+
## Settings
65+
66+
Open `/config` (or tap the small gear icon in the bottom-right corner of the dashboard) to adjust the dashboard:
67+
68+
- **Night mode** - switch between day and night theme on a fixed hour schedule (default: night from 22:00 to 06:00) or automatically at sunrise/sunset for your location.
69+
- **Timezone** - used for all displayed dates and times and for the night mode schedule (default: Europe/Berlin). If night mode seems to switch at the wrong time, check this first - it also fixes devices whose system clock runs on UTC.
70+
- **Language** - German or English.
71+
- **High contrast** - a stronger variant of the day theme for small or low-quality screens (see below).
72+
73+
Settings are stored as cookies in the browser that displays the dashboard, so they survive reboots of a kiosk setup.
74+
6475
## High-contrast mode
6576

66-
For small or low-quality screens (like the Raspberry Pi 5" touchscreen), a high-contrast variant of the day theme is available. Append `?hc` to the URL to activate it:
77+
For small or low-quality screens (like the Raspberry Pi 5" touchscreen), a high-contrast variant of the day theme is available. Enable it on the `/config` page, or append `?hc` to the URL to force it for a single session:
6778

6879
```
6980
http://localhost:4321/?hc

mise.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[tools]
2+
pnpm = "latest"

notes.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)