Merge pull request #853 from johnwang16/auto_dark_mode

Allow auto light/dark mode matching user OS setting by @johnwang16  🙏
This commit is contained in:
jokob-sk
2024-10-19 14:30:32 +11:00
committed by GitHub
13 changed files with 830 additions and 39 deletions

View File

@@ -73,10 +73,14 @@
<!-- Dark-Mode Patch -->
<?php
if ($ENABLED_DARKMODE === True) {
echo '<link rel="stylesheet" href="css/dark-patch.css">';
$BACKGROUND_IMAGE_PATCH='style="background-image: url(\'img/boxed-bg-dark.png\');"';
} else { $BACKGROUND_IMAGE_PATCH='style="background-image: url(\'img/background.png\');"';}
switch ($UI_THEME) {
case "Dark":
echo '<link rel="stylesheet" href="css/dark-patch.css">';
break;
case "System":
echo '<link rel="stylesheet" href="css/system-dark-patch.css">';
break;
}
?>
@@ -114,7 +118,7 @@
<!-- ----------------------------------------------------------------------- -->
<!-- Layout Boxed Yellow -->
<body class="hold-transition fixed <?php echo $pia_skin_selected;?> sidebar-mini" <?php echo $BACKGROUND_IMAGE_PATCH;?> onLoad="show_pia_servertime();" >
<body class="hold-transition fixed <?php echo $pia_skin_selected;?> sidebar-mini" onLoad="show_pia_servertime();" >
<!-- Site wrapper -->
<div class="wrapper">

View File

@@ -4,12 +4,12 @@
// ## GUI settings processing start
// ###################################
if( isset($_COOKIE['UI_dark_mode']))
if( isset($_COOKIE['UI_theme']))
{
$ENABLED_DARKMODE = $_COOKIE['UI_dark_mode'] == "True";
$UI_THEME = $_COOKIE['UI_theme'];
}else
{
$ENABLED_DARKMODE = False;
$UI_THEME = "Light";
}
$pia_skin_selected = 'skin-blue';
@@ -18,4 +18,4 @@ $pia_skin_selected = 'skin-blue';
// ## GUI settings processing end
// ###################################
?>
?>