From 09f881adba684aa9d4dfb9b27567542f6babf7c2 Mon Sep 17 00:00:00 2001 From: adplantade Date: Fri, 31 Jul 2020 16:36:58 +0200 Subject: [PATCH] ajout mode nuit/jour sur l'accueil --- code/index.css | 22 ++++++++++++++++++++++ code/index.php | 11 ++++++++++- code/ress/dark.PNG | Bin 0 -> 66256 bytes code/ress/light.png | Bin 0 -> 66741 bytes code/ress/logo_clair.png | Bin 11272 -> 34138 bytes code/ress/logo_dark.png | Bin 0 -> 33525 bytes code/score.php | 4 ++-- code/themeSwitcher.js | 21 +++++++++++++++++++++ 8 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 code/ress/dark.PNG create mode 100644 code/ress/light.png create mode 100644 code/ress/logo_dark.png create mode 100644 code/themeSwitcher.js diff --git a/code/index.css b/code/index.css index 4772854..1d7e1f0 100644 --- a/code/index.css +++ b/code/index.css @@ -9,6 +9,19 @@ } +.day { background: #eee; color: black; } +.night { background: #333; color: white; } + +@media (prefers-color-scheme: dark) { + .day.dark-scheme { background: #333; color: white; } + .night.dark-scheme { background: black; color: #ddd; } +} + +@media (prefers-color-scheme: light) { + .day.light-scheme { background: white; color: #555; } + .night.light-scheme { background: #eee; color: black; } +} + .button { padding: 2px; } @@ -104,4 +117,13 @@ .pickr { width: 30px; height: 30px; + } + + .logo { + text-align: center; + } + + .lightButton { + position: absolute; + right: 0px; } \ No newline at end of file diff --git a/code/index.php b/code/index.php index 971842f..23aad8d 100644 --- a/code/index.php +++ b/code/index.php @@ -5,7 +5,15 @@ - + +
+ + +
+