Compare commits

...

3 Commits

Author SHA1 Message Date
DrMaxNix 28d3f51317 🔀 merge pull request 'v1.1.11' (#76) from dev into main
Reviewed-on: #76
2024-03-26 19:14:54 +01:00
DrMaxNix 74ecbd13c4 🔖 bump version to v1.1.11 2024-03-26 19:14:18 +01:00
DrMaxNix 6af7bfd4c7 🥚 allow customizing theme color via cookie 2024-03-26 19:14:03 +01:00
11 changed files with 47 additions and 7 deletions

View File

@ -3,6 +3,17 @@ Everything about the German Self-Determination Law in one place
## Easter Egg: Custom Theme Color
Have you ever wondered how SBGG.jetzt would look like in another color?
Now I have a cool thing for you to try when getting bored of the default theme color!
If you manage to set a cookie called `theme` in you browser, with a value of `red`, `orange`, `yellow`, `green`, `cyan`, `blue`, `purple` or `random`, you can change the SBGG.jetzt theme color. Here's an example:
```
NAME VALUE DOMAIN PATH MAX-AGE
theme orange sbgg.jetzt / Fri, 17 Feb 2034 20:49:38 GMT
```
## Attribution / Credits
- Tabler Icons (MIT): https://github.com/tabler/tabler-icons
- Ubuntu font (Ubuntu font licence 1.0): https://design.ubuntu.com/font

View File

@ -1,6 +1,6 @@
<?php
// VERSION //
static::$version = "1.1.10";
static::$version = "1.1.11";
// DEPENDENCIES //

View File

@ -48,6 +48,7 @@
Page::$head["analytics"] = '<script defer data-domain="sbgg.jetzt" src="https://analytics.tjdev.de/js/script.js"></script>';
Page::css("./page/start/style.css");
Page::css("./page/start/style.css.php", eval: true);
Page::css(__DIR__ . "/style.css");
Page::font("ubuntu");

View File

@ -70,6 +70,7 @@
Page::$head["analytics"] = '<script defer data-domain="sbgg.jetzt" src="https://analytics.tjdev.de/js/script.js"></script>';
Page::css("./page/start/style.css");
Page::css("./page/start/style.css.php", eval: true);
Page::js(__DIR__ . "/iframe_magic.js");
Page::js(__DIR__ . "/send_one.js");
Page::js(__DIR__ . "/send_all.js");

View File

@ -36,6 +36,7 @@
Page::$head["analytics"] = '<script defer data-domain="sbgg.jetzt" src="https://analytics.tjdev.de/js/script.js"></script>';
Page::css("./page/start/style.css");
Page::css("./page/start/style.css.php", eval: true);
Page::font("ubuntu");
Page::font("tabler");

View File

@ -35,6 +35,7 @@
Page::$head["analytics"] = '<script defer data-domain="sbgg.jetzt" src="https://analytics.tjdev.de/js/script.js"></script>';
Page::css("./page/start/style.css");
Page::css("./page/start/style.css.php", eval: true);
Page::font("ubuntu");
Page::font("tabler");

View File

@ -46,6 +46,7 @@
Page::$head["analytics"] = '<script defer data-domain="sbgg.jetzt" src="https://analytics.tjdev.de/js/script.js"></script>';
Page::css("./page/start/style.css");
Page::css("./page/start/style.css.php", eval: true);
Page::js(__DIR__ . "/main.js");
Page::font("ubuntu");

View File

@ -46,6 +46,7 @@
Page::$head["analytics"] = '<script defer data-domain="sbgg.jetzt" src="https://analytics.tjdev.de/js/script.js"></script>';
Page::css("./page/start/style.css");
Page::css("./page/start/style.css.php", eval: true);
Page::js(__DIR__ . "/main.js");
Page::font("ubuntu");

View File

@ -61,6 +61,7 @@
Page::$head["mastodon_verify"] = '<link rel="me" href="https://lsbt.me/@sbggjetzt" />';
Page::css(__DIR__ . "/style.css");
Page::css(__DIR__ . "/style.css.php", eval: true);
Page::js(__DIR__ . "/copylink_dict.js.php", eval: true);
Page::js(__DIR__ . "/copylink.js");
Page::js(__DIR__ . "/newsletter.js");

View File

@ -36,12 +36,6 @@
--color-purple: #c678dd;
--color-purple-light: #d7a1e8;
--color-purple-dark: #af5bc8;
--theme: var(--color-green);
--theme-light: var(--color-green-light);
--theme-dark: var(--color-green-dark);
}
* {
box-sizing: border-box;

28
page/start/style.css.php Normal file
View File

@ -0,0 +1,28 @@
<?php
declare(strict_types = 1);
namespace Kimendisch\Sbgg_Jetzt;
// GET THEME COLOR TO USE //
$color_list_lookup = ["red", "orange", "yellow", "green", "cyan", "blue", "purple"];
// check cookie
$theme = $_COOKIE["theme"] ?? "";
// validate
if(!in_array($theme, $color_list_lookup, strict: true) and $theme !== "random"){
$theme = "green";
}
// random color
if($theme === "random") $theme = array_rand(array_flip($color_list_lookup));
?>
:root {
--theme: var(--color-<?= $theme ?>);
--theme-light: var(--color-<?= $theme ?>-light);
--theme-dark: var(--color-<?= $theme ?>-dark);
}