From 30e7b2cf48146d9e96ddef27a9bc8efdaf71f3b0 Mon Sep 17 00:00:00 2001 From: Jan BELLON Date: Fri, 8 Mar 2024 20:18:50 +0000 Subject: [PATCH] Update 13 files - /html/src/css/style.css - /html/admin.php - /html/compte.php - /html/editpage.php - /html/index.php - /html/login.php - /html/news.php - /html/register.php - /html/upload.php - /html/users.php - /html/about.php - /include/functions.php - /config/global.ini --- config/global.ini | 4 ++-- html/about.php | 3 ++- html/admin.php | 2 +- html/compte.php | 2 +- html/editpage.php | 2 +- html/index.php | 2 +- html/login.php | 2 +- html/news.php | 2 +- html/register.php | 2 +- html/src/css/style.css | 40 ++++++++++++++++++++-------------------- html/upload.php | 2 +- html/users.php | 2 +- include/functions.php | 7 +------ 13 files changed, 34 insertions(+), 38 deletions(-) diff --git a/config/global.ini b/config/global.ini index 021ebc48..689920b0 100644 --- a/config/global.ini +++ b/config/global.ini @@ -27,5 +27,5 @@ A propos = "about.php" 3 = "Directeur" [themes] -0 = 'dark' -1 = 'light' \ No newline at end of file +0 = '--hue: 0; --saturation: 0%' +1 = '--hue: 60; --saturation: 80%' \ No newline at end of file diff --git a/html/about.php b/html/about.php index 88d18e67..090c0369 100644 --- a/html/about.php +++ b/html/about.php @@ -9,10 +9,11 @@ require "../include/functions.php"; + <?=$title?> -'> +
diff --git a/html/admin.php b/html/admin.php index a132803d..26ac07bc 100644 --- a/html/admin.php +++ b/html/admin.php @@ -18,7 +18,7 @@ if($_SESSION['role'] < 3) { <?=$title?> -'> +
diff --git a/html/compte.php b/html/compte.php index aa3e6d12..f4642b79 100644 --- a/html/compte.php +++ b/html/compte.php @@ -31,7 +31,7 @@ if(isset($_POST['delete_account'])) { <?=$title?> -'> +
diff --git a/html/editpage.php b/html/editpage.php index b5e9cdd9..457216d8 100644 --- a/html/editpage.php +++ b/html/editpage.php @@ -70,7 +70,7 @@ if(isset($fichier)) { } -'> +
diff --git a/html/index.php b/html/index.php index dee06b9c..1e2ba409 100644 --- a/html/index.php +++ b/html/index.php @@ -12,7 +12,7 @@ require "../include/functions.php"; <?=$title?> -'> +
diff --git a/html/login.php b/html/login.php index fb885f5f..658b2aa4 100644 --- a/html/login.php +++ b/html/login.php @@ -43,7 +43,7 @@ if(isset($_POST['username']) && isset($_POST['password'])) { <?=$title?> -'> +
diff --git a/html/news.php b/html/news.php index 06647006..9430f291 100644 --- a/html/news.php +++ b/html/news.php @@ -17,7 +17,7 @@ if (filter_var($_GET['article'], FILTER_VALIDATE_INT)) { <?=$title?> -'> +
diff --git a/html/register.php b/html/register.php index 46ea3596..f96a348b 100644 --- a/html/register.php +++ b/html/register.php @@ -43,7 +43,7 @@ if(isset($_POST['username']) && isset($_POST['password']) && isset($_POST['passw <?=$title?> -'> +
diff --git a/html/src/css/style.css b/html/src/css/style.css index e57e0616..52b9fed1 100644 --- a/html/src/css/style.css +++ b/html/src/css/style.css @@ -1,28 +1,28 @@ :root { - --text: #000000; - --background: hsl(0, 0%, 100%); - --dark-background: hsl(0, 0%, 100%); - --darker-background: hsl(0, 0%, 100%); - --article-background: hsl(0, 0%, 100%); - --article-text: hsl(0, 0%, 0%); + --saturation: 0%; + --hue: 0; } -.light { - --text: #373737; - --background: hsl(0, 0%, 100%); - --dark-background: hsl(0, 0%, 100%); - --darker-background: hsl(0, 0%, 100%); - --article-background: hsl(0, 0%, 100%); - --article-text: hsl(0, 0%, 0%); +@media (prefers-color-scheme: dark) { + .body { + --text: hsl(var(--hue), var(--saturation), 80%); + --background: hsl(var(--hue), var(--saturation), 15%); + --dark-background: hsl(var(--hue), var(--saturation), 10%); + --darker-background: hsl(var(--hue), var(--saturation), 5%); + --article-background: hsl(var(--hue), var(--saturation), 15%); + --article-text: hsl(var(--hue), var(--saturation), 100%); + } } -.dark { - --text: #b3b3b3; - --background: hsl(0, 0%, 15%); - --dark-background: hsl(0, 0%, 10%); - --darker-background: hsl(0, 0%, 5%); - --article-background: hsl(0, 0%, 15%); - --article-text: hsl(0, 0%, 100%); +@media (prefers-color-scheme: light) { + .body { + --text: hsl(var(--hue), var(--saturation), 20%); + --background: hsl(var(--hue), var(--saturation), 100%); + --dark-background: hsl(var(--hue), var(--saturation), 100%); + --darker-background: hsl(var(--hue), var(--saturation), 100%); + --article-background: hsl(var(--hue), var(--saturation), 100%); + --article-text: hsl(var(--hue), var(--saturation), 0%); + } } @font-face { diff --git a/html/upload.php b/html/upload.php index 3b72ac78..a281793a 100644 --- a/html/upload.php +++ b/html/upload.php @@ -47,7 +47,7 @@ if(isset($_POST['page-content'])) { } -'> +
diff --git a/html/users.php b/html/users.php index 92f0f7fe..420c92ac 100644 --- a/html/users.php +++ b/html/users.php @@ -32,7 +32,7 @@ if(isset($_POST['userid']) && isset($_POST['role']) && isset($_POST['accreditati <?=$title?> -'> +
diff --git a/include/functions.php b/include/functions.php index be38f839..e7b8ba96 100644 --- a/include/functions.php +++ b/include/functions.php @@ -9,13 +9,8 @@ if(!isset($_SESSION['role'])) { $_SESSION['role'] = 0; } -if(!isset($_SESSION['theme'])) { - $_SESSION['theme'] = $themes[0]; -} +$theme = isset($_GET['theme']) ? $themes[$_GET['theme']] : $themes[0]; -if(isset($_GET['theme'])) { - $_SESSION['theme'] = $themes[(int)$_GET['theme'] % 2]; -} function nav($nav) { foreach($nav as $name => $url) {