starts to look nice

This commit is contained in:
Arnold Dechamps 2024-03-20 18:06:41 +01:00
parent 333401222b
commit 5c546cc2ec
No known key found for this signature in database
GPG key ID: AE66543374E41C89
3 changed files with 34 additions and 25 deletions

2
app.py
View file

@ -44,7 +44,7 @@ def hello_world():
flight["departure_delay"] = delay.strftime(localformat) flight["departure_delay"] = delay.strftime(localformat)
if negative: if negative:
flight["departure_delay"] = ("-" + str(flight["departure_delay"])) flight["departure_delay"] = ("-" + str(flight["departure_delay"]))
return render_template('screen.html', airport=airport, data=rawdata) return render_template('screen.html', len=len(rawdata), airport=airport, flight=rawdata)
@app.route("/style.css") @app.route("/style.css")

View file

@ -600,6 +600,11 @@ video {
border-bottom-width: 1px; border-bottom-width: 1px;
} }
.bg-gray-100 {
--tw-bg-opacity: 1;
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
}
.bg-white { .bg-white {
--tw-bg-opacity: 1; --tw-bg-opacity: 1;
background-color: rgb(255 255 255 / var(--tw-bg-opacity)); background-color: rgb(255 255 255 / var(--tw-bg-opacity));

View file

@ -34,31 +34,35 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for flight in data %} {% for i in range(0,len) %}
<tr class="bg-white border-b"> {% if i%2 == 0 %}
<td class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap">{{ flight["ident"] }}</td> <tr class="bg-white border-b">
<td class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap">{{ flight["scheduled_off"] }}</td>
<td class="px-6 py-4 font-medium text-red-600 whitespace-nowrap">{% if flight["departure_delay"] %}
{{ flight["departure_delay"] }}
{% else %}
{% endif %}
</td>
<td class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap">{{ flight["operator"] }}</td>
<td class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap overflow-scroll scroll-smooth">
{% if flight["destination"]["name"] %}
{{ flight["destination"]["name"] }}
<span class="text-blue-500">{{ flight["destination"]["code_icao"] }}</span> /
<span class="text-green-600">{{ flight["destination"]["code_iata"] }}</span>
{% else %} {% else %}
{% endif %} <tr class="bg-gray-100 border-b">
</td> {% endif %}
<td class="px-6 py-4 font-medium text-amber-400 whitespace-nowrap"> <td class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap">{{ flight[i]["ident"] }}</td>
{% if flight["status"] != "Scheduled" %} <td class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap">{{ flight[i]["scheduled_off"] }}</td>
{{ flight["status"] }} <td class="px-6 py-4 font-medium text-red-600 whitespace-nowrap">{% if flight[i]["departure_delay"] %}
{% else %} {{ flight[i]["departure_delay"] }}
{% endif %} {% else %}
</td> {% endif %}
</tr> </td>
<td class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap">{{ flight[i]["operator"] }}</td>
<td class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap overflow-scroll scroll-smooth">
{% if flight[i]["destination"]["name"] %}
{{ flight[i]["destination"]["name"] }}
<span class="text-blue-500">{{ flight[i]["destination"]["code_icao"] }}</span> /
<span class="text-green-600">{{ flight[i]["destination"]["code_iata"] }}</span>
{% else %}
{% endif %}
</td>
<td class="px-6 py-4 font-medium text-amber-400 whitespace-nowrap">
{% if flight[i]["status"] != "Scheduled" %}
{{ flight[i]["status"] }}
{% else %}
{% endif %}
</td>
</tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>