Files
Weather-App/templates/hourly_forecast.html

68 lines
1.7 KiB
HTML

<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<title>Prognoza godzinowa - {{ city }}</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #eef2f3;
color: #333;
margin: 20px;
}
h1 {
color: #2a6ebb;
}
.error {
color: red;
font-weight: bold;
}
table {
border-collapse: collapse;
width: 80%;
margin-top: 20px;
}
th, td {
border: 1px solid #aaa;
padding: 6px 10px;
text-align: center;
}
th {
background-color: #2a6ebb;
color: #fff;
}
tr:nth-child(even) {
background-color: #d9e1ec;
}
</style>
</head>
<body>
<h1>Prognoza godzinowa dla {{ city }}</h1>
{% if error %}
<p class="error">{{ error }}</p>
{% elif hourly_forecast %}
<table>
<thead>
<tr>
<th>Godzina</th>
<th>Temp. (°C)</th>
<th>Wiatr (km/h)</th>
<th>Opady (mm)</th>
</tr>
</thead>
<tbody>
{% for i in range(hourly_forecast["time"]|length) %}
<tr>
<td>{{ hourly_forecast["time"][i] }}</td>
<td>{{ hourly_forecast["temperature_2m"][i] }}</td>
<td>{{ hourly_forecast["windspeed_10m"][i] }}</td>
<td>{{ hourly_forecast["precipitation"][i] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</body>
</html>