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 ++++++++++++++++++++++++- theme/admin/html/migration.php | 3 ++- 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'theme/admin/html') 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')?> + +
  • diff --git a/theme/admin/html/migration.php b/theme/admin/html/migration.php index 14405c4..1b5be2c 100644 --- a/theme/admin/html/migration.php +++ b/theme/admin/html/migration.php @@ -1,10 +1,11 @@ + - + " /> <?=$Language->text('maintenance_mode')?> -- cgit v1.2.3