Dark mode: Light, Dark or Auto under Settings › Theme (#80)

A device preference (localStorage sot-theme, never in the save), applied
by a small script in <head> before the first paint, so there is no flash;
Auto follows prefers-color-scheme live, and a choice reaches other tabs
and the NOC window. Panels, HUD, drawers, toasts, modals, the phone tab
bar, charts, puzzles, the architect and Pie Control take their colours
from custom properties with night values (AA text contrast); light tints
keep their old colour as the fallback, so the light look is unchanged.

Both map renderers read a light and a dark palette (96-map/15-palette.js):
sea, land, clouds, coastlines, labels and the tube outline. A theme
switch repaints the cached layers once (the WebGL land buffers are
rebuilt once); nothing changes per frame. The multiplayer leaderboard's
own row and the menu rank badge follow the theme too.
This commit is contained in:
jvanvik 2026-11-07 01:01:50 +01:00
parent 95aa9b6532
commit 2cd6b71198
49 changed files with 645 additions and 155 deletions

View file

@ -4538,12 +4538,15 @@
"settings.always_2d":"Sempre 2D",
"settings.an_early_heads_up_below_60":"Um aviso antecipado abaixo de 60% de satisfação, bem antes de ficarem furiosos.",
"settings.auto_draws_the_map_with_your":"Auto desenha o mapa com sua placa de vídeo quando o navegador permite, o que mantém redes grandes fluidas. Sempre 2D funciona em qualquer lugar, mas é mais lento em mapas grandes.",
"settings.auto_follows_your_device_s_light":"Auto segue a configuração clara ou escura do seu aparelho. O escuro descansa os olhos à noite e economiza bateria em telas OLED.",
"settings.auto_follows_your_device_s_reduce":"Auto segue a configuração de reduzir movimento do seu aparelho. Desligado congela o mapa: sem pacotes andando, pulsos ou texto flutuante.",
"settings.customers_and_alerts":"Clientes e alertas",
"settings.dark":"Escuro",
"settings.diagnostic_info":"Informações de diagnóstico",
"settings.display_and_sound":"Tela e som",
"settings.for_bug_reports_shows_your_screen":"Para reportar bugs: mostra em um canto o tamanho da sua tela, como o mapa é desenhado (placa de vídeo ou 2D, e por quê) e a que velocidade.",
"settings.let_an_ai_agent_drive_this_game":"Deixa um agente de IA jogar",
"settings.light":"Claro",
"settings.map_drawing":"Desenho do mapa",
"settings.n_min":"{n} min",
"settings.n_sec":"{n} s",
@ -4557,6 +4560,7 @@
"settings.the_agent_moves_it":"O agente move-o",
"settings.the_clock_while_an_agent_plays":"O relógio enquanto um agente joga",
"settings.the_game_stops_so_you_can":"O jogo para para você consertar o serviço antes que cancelem. Muito útil em alta velocidade.",
"settings.theme":"Tema",
"settings.this_browser_cannot_so_the_map":"Este navegador não consegue, então o mapa é desenhado em 2D.",
"settings.warn_when_a_customer_gets_unhappy":"Avisar quando um cliente ficar insatisfeito",
"settings.while_agent_mode_is_on_the":"Enquanto o modo agente estiver ligado, o relógio não é teu. Com um ritmo, corre sozinho e não pode ser parado à mão, nem por uma janela aberta (as tuas incluídas), e espera enquanto nenhum agente estiver ligado. Ou é o agente que o move, e nada acontece até ele pedir dias. A página liga-se ao relay local de agentes (npm run dev traz um), para que ferramentas como o servidor MCP joguem este jogo enquanto vês.",