diff --git a/public/styles/css/style.css b/public/styles/css/style.css index 5465270..dfe3e7f 100644 --- a/public/styles/css/style.css +++ b/public/styles/css/style.css @@ -360,8 +360,10 @@ th.dt-center, td.dt-center { text-align: center; } } } -.grid-sizer { width: 10%; margin-bottom: 0%;float:left;} +.grid-sizer { width: 5%; margin-bottom: 0%;float:left;} .grid-item-size { width: 10%; margin-bottom: 0%;float:left;} +.grid-item-size-1 { width: 10%; margin-bottom: 0%;float:left;} +.grid-item-size-15 { width: 15%; margin-bottom: 0%;float:left;} .grid-item-size-2 { width: 20%; margin-bottom: 0%;float:left;} .grid-item-size-3 { width: 30%; margin-bottom: 0%;float:left;} .grid-item-size-4 { width: 40%; margin-bottom: 0%;float:left;} @@ -373,7 +375,7 @@ th.dt-center, td.dt-center { text-align: center; } .grid-item-full { width: 100%; margin-bottom: 0%; font-size:20px;float:left; } .grid-item-full h1 {margin: 0; border:none; padding: 20px 0px 0px 10px; } .gutter-sizer { width: 0%;float:left; } -.member{display:flex; flex-direction: column; align-items: center;} +.member{display:flex; flex-direction: column; align-items: center; background-color: var(--colorbgbodydarkdarker); border-radius:10px; padding:10px;} .member img{border-radius:100%;width:60px; height: 60px;} @media (max-width: 980px) { .grid-sizer { width: 10%; margin-bottom: 0%;} diff --git a/src/Controller/HomeController.php b/src/Controller/HomeController.php index 2ee9b98..9dc2a31 100755 --- a/src/Controller/HomeController.php +++ b/src/Controller/HomeController.php @@ -14,7 +14,7 @@ class HomeController extends AbstractController $em = $this->getDoctrine()->getManager(); $users = $em->getRepository("App:User")->findBy([],["pseudo"=>"ASC"]); - $illustrations = $em->getRepository("App:Illustration")->findAll(); + $illustrations = $em->getRepository("App:Illustration")->findBy([],["submittime"=>"DESC"]); $links = $em->getRepository("App:Link")->findBy(["user"=>null]); $webzines = $em->getRepository("App:Webzine")->findBy(["user"=>null], ['set' => 'ASC', 'order' => 'ASC']); diff --git a/src/Entity/Category.php b/src/Entity/Category.php index d4a9c68..f739745 100644 --- a/src/Entity/Category.php +++ b/src/Entity/Category.php @@ -73,7 +73,7 @@ class Category /** * @ORM\OneToMany(targetEntity="Illustration", mappedBy="category", cascade={"persist", "remove"}, orphanRemoval=true) - * @ORM\OrderBy({"id" = "DESC"}) + * @ORM\OrderBy({"submittime" = "DESC"}) */ private $illustrations; diff --git a/src/Service/sessionInit.php b/src/Service/sessionInit.php index feb95b5..66fa246 100644 --- a/src/Service/sessionInit.php +++ b/src/Service/sessionInit.php @@ -21,5 +21,31 @@ foreach($configs as $config) { $this->session->set($config->getKeyid(), strval($config->getValue())); } + + $this->session->set("colorbgbodydarkdarker",$this->adjustBrightness($this->session->get("colorbgbodydark"),-20)); } + + + public function adjustBrightness($hex, $steps) { + // Steps should be between -255 and 255. Negative = darker, positive = lighter + $steps = max(-255, min(255, $steps)); + + // Normalize into a six character long hex string + $hex = str_replace('#', '', $hex); + if (strlen($hex) == 3) { + $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2); + } + + // Split into three parts: R, G and B + $color_parts = str_split($hex, 2); + $return = ''; + + foreach ($color_parts as $color) { + $color = hexdec($color); // Convert to decimal + $color = max(0,min(255,$color + $steps)); // Adjust color + $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code + } + + return "#".$return; + } } diff --git a/templates/Home/home.html.twig b/templates/Home/home.html.twig index 4b7f9e6..dce4b4e 100644 --- a/templates/Home/home.html.twig +++ b/templates/Home/home.html.twig @@ -29,47 +29,55 @@ {% block body %} +
+ +