ajax test

This commit is contained in:
2024-02-05 21:21:04 +01:00
parent 5584a61560
commit 2b29d0df16
8 changed files with 147 additions and 14 deletions

14
lib/dynamic_style.php Normal file
View File

@@ -0,0 +1,14 @@
<?php
function doDynamicStyling() :string
{
$dynamic_style = "";
if(isLoggedIn() && !empty($_SESSION["favorite_color"]) && is_int($_SESSION["favorite_color"]) && $_SESSION["favorite_color"] <= 4294967295){
$dynamic_style = "<style>";
$color = dechex($_SESSION["favorite_color"]);
$dynamic_style .= "--root{ --favorite-color: #$color;";
$dynamic_style .= "</style>";
}
return $dynamic_style;
}