This commit is contained in:
afornerot 2024-10-29 21:15:16 +01:00
parent 448d2f2b7e
commit d73127b09e
6 changed files with 180 additions and 129 deletions

View File

@ -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 { 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-2 { width: 20%; margin-bottom: 0%;float:left;}
.grid-item-size-3 { width: 30%; 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;} .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 { width: 100%; margin-bottom: 0%; font-size:20px;float:left; }
.grid-item-full h1 {margin: 0; border:none; padding: 20px 0px 0px 10px; } .grid-item-full h1 {margin: 0; border:none; padding: 20px 0px 0px 10px; }
.gutter-sizer { width: 0%;float:left; } .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;} .member img{border-radius:100%;width:60px; height: 60px;}
@media (max-width: 980px) { @media (max-width: 980px) {
.grid-sizer { width: 10%; margin-bottom: 0%;} .grid-sizer { width: 10%; margin-bottom: 0%;}

View File

@ -14,7 +14,7 @@ class HomeController extends AbstractController
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$users = $em->getRepository("App:User")->findBy([],["pseudo"=>"ASC"]); $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]); $links = $em->getRepository("App:Link")->findBy(["user"=>null]);
$webzines = $em->getRepository("App:Webzine")->findBy(["user"=>null], ['set' => 'ASC', 'order' => 'ASC']); $webzines = $em->getRepository("App:Webzine")->findBy(["user"=>null], ['set' => 'ASC', 'order' => 'ASC']);

View File

@ -73,7 +73,7 @@ class Category
/** /**
* @ORM\OneToMany(targetEntity="Illustration", mappedBy="category", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="Illustration", mappedBy="category", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"id" = "DESC"}) * @ORM\OrderBy({"submittime" = "DESC"})
*/ */
private $illustrations; private $illustrations;

View File

@ -21,5 +21,31 @@
foreach($configs as $config) { foreach($configs as $config) {
$this->session->set($config->getKeyid(), strval($config->getValue())); $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;
} }
} }

View File

@ -29,17 +29,25 @@
{% block body %} {% block body %}
<!-- FOLIOMENU -----------------------------------------------------------------------------------------------------------------------------------------------!--> <!-- FOLIOMENU -----------------------------------------------------------------------------------------------------------------------------------------------!-->
<div class="foliomenu">
<div class="foliomenu"> <a href="#top"><img src="{{ asset("uploads/logo/"~app.session.get("logodark")) }}" class="logo"></a>
<a href="#top"><img src="/{{ appAlias }}/uploads/logo/{{ app.session.get("logodark") }}" class="logo"></a>
<div> <div>
{% if users is not empty %}
<i class="fa fa-circle fa-fw"></i> <a href="#membre">Membres</a>&nbsp; <i class="fa fa-circle fa-fw"></i> <a href="#membre">Membres</a>&nbsp;
{% endif %}
{% if illustrations is not empty %}
<i class="fa fa-circle fa-fw"></i> <a href="#illustration">Illustrations</a>&nbsp; <i class="fa fa-circle fa-fw"></i> <a href="#illustration">Illustrations</a>&nbsp;
{% endif %}
{% if not webzines is empty %} {% if not webzines is empty %}
<i class="fa fa-circle fa-fw"></i> <a href="#webzine">Webzines</a>&nbsp; <i class="fa fa-circle fa-fw"></i> <a href="#webzine">Webzines</a>&nbsp;
{% endif %} {% endif %}
{% if not links is empty %}
<i class="fa fa-circle fa-fw"></i> <a href="#link">Liens</a>&nbsp; <i class="fa fa-circle fa-fw"></i> <a href="#link">Liens</a>&nbsp;
{% endif %}
</div> </div>
<div class="float-right"> <div class="float-right">
@ -65,11 +73,11 @@
</a> </a>
{% endif %} {% endif %}
</div> </div>
</div> </div>
<div class="foliotop"> <div class="foliotop">
<a href="#top"><i class="fa fa-chevron-up"></i></a> <a href="#top"><i class="fa fa-chevron-up"></i></a>
</div> </div>
<!-- HEROHEADER ------------------------------------------------------------------------------------------------------------------------------------------------!--> <!-- HEROHEADER ------------------------------------------------------------------------------------------------------------------------------------------------!-->
<div id="top" class="heroheader" displaynone> <div id="top" class="heroheader" displaynone>
@ -117,9 +125,11 @@
</a> </a>
{% endif %} {% endif %}
</div> </div>
<div class="herobox"></div> <div class="herobox"></div>
<div class="herotitle"> <div class="herotitle">
<h1>{{ (app.session.get("appname")) }}</h1> <h1><a href="#site">{{ (app.session.get("appname")) }}</a></h1>
<div class="heromenu" > <div class="heromenu" >
{% if not app.session.get("appsubname") is empty %} {% if not app.session.get("appsubname") is empty %}
@ -149,8 +159,13 @@
</div> </div>
<div class="catmenu"> <div class="catmenu">
{% if not users is empty %}
<a href="#membre"><i class="fa fa-arrow-circle-right fa-fw facatmenu"></i> Membres</a><br> <a href="#membre"><i class="fa fa-arrow-circle-right fa-fw facatmenu"></i> Membres</a><br>
{% endif %}
{% if not illustrations is empty %}
<a href="#illustration"><i class="fa fa-arrow-circle-right fa-fw facatmenu"></i> Illustrations</a><br> <a href="#illustration"><i class="fa fa-arrow-circle-right fa-fw facatmenu"></i> Illustrations</a><br>
{% endif %}
{% if not webzines is empty %} {% if not webzines is empty %}
<a href="#webzine"><i class="fa fa-arrow-circle-right fa-fw facatmenu"></i> Webzines</a><br> <a href="#webzine"><i class="fa fa-arrow-circle-right fa-fw facatmenu"></i> Webzines</a><br>
@ -179,7 +194,9 @@
<!-- SITE ------------------------------------------------------------------------------------------------------------------------------------------------------!--> <!-- SITE ------------------------------------------------------------------------------------------------------------------------------------------------------!-->
<div> <div>
<div id="site" class="grid-item grid-item-size grid-item-size-3 grid-item-size-square cssfilter" style="height:200px;background-position: center; background-size: cover; background-image: url(/{{ appAlias }}/uploads/image/{{ app.session.get("imgcontact")}});"> <div id="site" class="grid-item grid-item-full"><h1 class="mt-5 mb-3"></h1></div>
<div class="grid-item grid-item-size grid-item-size-3 grid-item-size-square cssfilter" style="height:200px;background-position: center; background-size: cover; background-image: url(/{{ appAlias }}/uploads/image/{{ app.session.get("imgcontact")}});">
</div> </div>
<div class="grid-item grid-item-size grid-item-size-6 grid-item-size-noresize" style="padding:0px 15px;"> <div class="grid-item grid-item-size grid-item-size-6 grid-item-size-noresize" style="padding:0px 15px;">
@ -219,22 +236,25 @@
</div> </div>
<!-- MEMBRE ------------------------------------------------------------------------------------------------------------------------------------------------------!--> <!-- MEMBRE ------------------------------------------------------------------------------------------------------------------------------------------------------!-->
{% if not users is empty %}
<div> <div>
<div id="membre" class="grid-item grid-item-full"><h1 class="mt-5 mb-3">Membres</h1></div> <div id="membre" class="grid-item grid-item-full"><h1 class="mt-5 mb-3">Membres</h1></div>
{% for user in users %} {% for user in users %}
<div class="grid-item grid-item-size grid-item-size-2 grid-item-size-small-3 grid-item-size-noresize" style="padding:0px 15px;"> <div class="grid-item grid-item-size grid-item-size-15 grid-item-size-small-3 grid-item-size-noresize" style="padding:0px 5px;">
<a class="member" href="{{path("app_home_user",{userpseudo:user.slug})}}"> <a class="member" href="{{path("app_home_user",{userpseudo:user.slug})}}">
<img src="/{{ appAlias }}/uploads/avatar/{{ user.avatar }}"> <img src="/{{ appAlias }}/uploads/avatar/{{ user.avatar }}" class="mb-2">
{{user.pseudo}} <small>{{user.pseudo}}</small>
</a> </a>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
{% endif %}
<!-- ILLUSTRATION ------------------------------------------------------------------------------------------------------------------------------------------------------!--> <!-- ILLUSTRATION ------------------------------------------------------------------------------------------------------------------------------------------------------!-->
{% if not illustrations is empty %}
<div> <div>
<div id="illustration" class="grid-item grid-item-full"><h1 class="mt-5">Illustrations</h1></div> <div id="illustration" class="grid-item grid-item-full"><h1 class="mt-5 mb-3">Illustrations</h1></div>
{% for illustration in illustrations %} {% for illustration in illustrations %}
{% set appthumbwidth=app.session.get("appthumbwidth") %} {% set appthumbwidth=app.session.get("appthumbwidth") %}
@ -284,12 +304,12 @@
</a> </a>
{% endfor %} {% endfor %}
</div> </div>
{% endif %}
<!-- WEBZINE ------------------------------------------------------------------------------------------------------------------------------------------------------!--> <!-- WEBZINE ------------------------------------------------------------------------------------------------------------------------------------------------------!-->
<div>
{% if not webzines is empty %} {% if not webzines is empty %}
<div id="webzine" class="grid-item grid-item-full"><h1 class="mt-5">Webzines</h1></div> <div>
{% endif %} <div id="webzine" class="grid-item grid-item-full"><h1 class="mt-5 mb-3">Webzines</h1></div>
{% set setname="" %} {% set setname="" %}
{% for webzine in webzines %} {% for webzine in webzines %}
@ -311,11 +331,12 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div> </div>
{% endif %}
<!-- LINK ------------------------------------------------------------------------------------------------------------------------------------------------------!--> <!-- LINK ------------------------------------------------------------------------------------------------------------------------------------------------------!-->
{% if not links is empty %}
<div> <div>
{% if not webzines is empty %} <div id="link" class="grid-item grid-item-full"><h1 class="mt-5 mb-3">Liens</h1></div>
<div id="link" class="grid-item grid-item-full"><h1 class="mt-5">Liens</h1></div>
<div class="grid-item grid-item-size grid-item-size-3 grid-item-size-square cssfilter" style="height:200px;background-position: center; background-size: cover; background-image: url(/{{ appAlias }}/uploads/image/{{ app.session.get("imglink")}});"> <div class="grid-item grid-item-size grid-item-size-3 grid-item-size-square cssfilter" style="height:200px;background-position: center; background-size: cover; background-image: url(/{{ appAlias }}/uploads/image/{{ app.session.get("imglink")}});">
</div> </div>
@ -325,9 +346,10 @@
<a href="{{link.url}}" target="_blank">{{ link.name }}</a> <a href="{{link.url}}" target="_blank">{{ link.name }}</a>
{% endfor %} {% endfor %}
</div> </div>
{% endif %}
</div> </div>
{% endif %}
<!-- BOTTOM ------------------------------------------------------------------------------------------------------------------------------------------------------!-->
<div id="bottom" class="grid-item grid-item-full" style="height:300px"> <div id="bottom" class="grid-item grid-item-full" style="height:300px">
</div> </div>

View File

@ -1,6 +1,7 @@
:root{ :root{
--colorbgbodylight: {{ app.session.get('colorbgbodylight')|raw }}; --colorbgbodylight: {{ app.session.get('colorbgbodylight')|raw }};
--colorbgbodydark: {{ app.session.get('colorbgbodydark')|raw }}; --colorbgbodydark: {{ app.session.get('colorbgbodydark')|raw }};
--colorbgbodydarkdarker: {{ app.session.get('colorbgbodydarkdarker')|raw }};
--colorfttitlelight: {{ app.session.get('colorfttitlelight')|raw }}; --colorfttitlelight: {{ app.session.get('colorfttitlelight')|raw }};
--colorfttitledark: {{ app.session.get('colorfttitledark')|raw }}; --colorfttitledark: {{ app.session.get('colorfttitledark')|raw }};
--colorftbodylight: {{ app.session.get('colorftbodylight')|raw }}; --colorftbodylight: {{ app.session.get('colorftbodylight')|raw }};