Amélioration de l'affichage du mode démo.

This commit is contained in:
antux18 2024-02-25 19:37:06 +01:00
parent b5ccf85a7d
commit a6c017e6a2
4 changed files with 55 additions and 20 deletions

4
app.py
View File

@ -412,9 +412,9 @@ def free_rooms(api = False, rq = None) :
return response
else :
url_for("static", filename="style.css")
# Vérifie si le mode demo est demandé
# Vérifie si le mode demo est demandé :
demo = str(rq.args.get("demo"))
if demo in ("1", "true", "True"):
if demo in ("1", "true", "True") :
return render_template("demo.html", **context, **GLOBAL_CONTEXT)
else:
return render_template("free-rooms.html", **context, **GLOBAL_CONTEXT)

View File

@ -1,24 +1,62 @@
:root {
--bg: #ffffff;
--bg-dark: #303355;
--fg: #303355;
--special: #c09f80;
}
main {
display: grid;
grid-template-rows: 2fr 1fr 5fr 1fr;
}
body {
background: var(--bg);
color: var(--fg);
font-family: "ubuntu", sans-serif;
font-size: 200%;
margin: 0px;
}
h1, h2 {
text-align: center;
}
h2 {
font-size: 90%;
font-weight: normal;
}
.slider {
overflow: hidden;
}
.slide-track {
animation: scroll 40s linear infinite;
display: flex;
flex-wrap: wrap;
gap: 50px;
animation: scroll 40s linear infinite;
width: 750%; /* Pas bô, mais on va faire avec en attendant... */
}
.room {
text-align: center;
background: var(--bg-dark);
border-style: solid;
border-width: 1px;
border-color: var(--bg-dark);
border-radius: 10px;
padding: 10px;
color: var(--bg);
}
@keyframes scroll {
0% { transform: translateX(0); }
100% { transform: translateX(calc(-250px * 7))}
100% { transform: translateX(calc(-250px * 7)); }
}
.slider {
overflow:hidden;
footer {
margin-top: 10px;
font-size: 50%;
text-align: center;
}

View File

@ -8,23 +8,20 @@
</head>
<body>
<main>
<h1><b>{{ depts_str }}</b></h1>
<p>Salles disponibles:</p>
{% if date_str != "" : %}
<p>Le {{ date_str }}</p>
{% endif %}
<h1><b>Salles disponibles</b></h1>
<h2>{{ depts_str }}</h2>
<div class="slider">
<div class="slide-track">
{% if favs: %}
<!-- Afficher les favoris -->
<!-- Deux fois pour que l'animation loop -->
{% for i in range(2):%}
{% if favs_free_rooms|length>0: %}
<!-- Deux fois pour que l'animation boucle -->
{% for i in range(2) : %}
{% if favs_free_rooms|length > 0 : %}
{% for room in favs_free_rooms : %}
<div class="room">
{{ room.name }} {% if DEBUG :%}( {{ room.id }} ){% endif %}
<b>{{ room.name }}</b> {% if DEBUG :%}( {{ room.id }} ){% endif %}
{% if not(room.noend) : %}
<p class=details>Jusqu'à {{ frooms_disp[room.name]["end"] }} (dans {{ frooms_disp[room.name]["rtime"] }})</p>
<p class=details>Jusqu'à {{ frooms_disp[room.name]["end"] }}</p>
{% endif %}
</div>
{% endfor %}
@ -36,9 +33,9 @@
{% if free_rooms|length>0 %}
{% for room in free_rooms: %}
<div class="room">
{{ room.name }} {% if DEBUG :%}( {{ room.id }} ){% endif %}
<b>{{ room.name }}</b> {% if DEBUG : %}( {{ room.id }} ){% endif %}
{% if not room.noend : %}
<p class=details>Jusqu'à {{ frooms_disp[room.name]["end"] }} (dans {{ frooms_disp[room.name]["rtime"] }})</p>
<p class=details>Jusqu'à {{ frooms_disp[room.name]["end"] }}</p>
{% endif %}
</div>
{% endfor %}
@ -48,7 +45,7 @@
</div>
</div>
<footer>
Propulsé par UniSquat!
Propulsé par UniSquat : <a href="https://unisquat.alwaysdata.net">https://unisquat.alwaysdata.net</a>
</footer>
</main>
</body>

View File

@ -34,7 +34,7 @@
</div>
{% if favs: %}
<div class="flex-pc">
{% if favs_free_rooms|length>0: %}
{% if favs_free_rooms|length > 0 : %}
<div class="room-column">
<br>
<h1>Favoris disponibles maintenant</h1>