From eb6c2659c877b927d5461d9de309dd16e8ae8155 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Mon, 5 Jul 2021 21:42:20 +0200 Subject: Add dark color mode for admin theme This commit adds a dark color mode for the admin theme. The dark color mode can be enabled/disabled by clicking the hyperlink in the footer. It is not perfect yet (it uses cookies and needs a full page reload), but it works just fine for the moment. Hope your eyes can enjoy it! --- theme/admin/html/main.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'theme/admin/html/main.php') diff --git a/theme/admin/html/main.php b/theme/admin/html/main.php index 45cdc41..a0a1412 100644 --- a/theme/admin/html/main.php +++ b/theme/admin/html/main.php @@ -1,10 +1,25 @@ + '/', 'samesite' => 'Lax']; + + if($toogle === 'dark') { + $_COOKIE['dark_mode'] = TRUE; + setcookie('dark_mode', TRUE, $options); + } else { + unset($_COOKIE['dark_mode']); + setcookie('dark_mode', NULL, array_merge($options, ['expires' => -1])); + } +} + +$theme = isset($_COOKIE['dark_mode']) ? 'dark' : 'main'; +?> - + " /> <?=escapeHTML($NAME)?> | Administration @@ -47,6 +62,14 @@
  • Releases
  • Documentation
  • Bugreport
  • +
  • + + text('dark_colors')?> + + + text('bright_colors')?> + +
  • -- cgit v1.2.3