aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/base.html31
-rw-r--r--templates/daily.html13
-rw-r--r--templates/hourly.html18
-rw-r--r--templates/index.html20
-rw-r--r--templates/weather.html77
5 files changed, 94 insertions, 65 deletions
diff --git a/templates/base.html b/templates/base.html
index d464a5a..6fe776a 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -1,21 +1,20 @@
1<!DOCTYPE html> 1<!DOCTYPE html>
2<html> 2<html>
3<head> 3 <head>
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <title>{% block title %} {% endblock %}</title> 5 <title>{% block title %} {% endblock %}</title>
6 <link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}"> 6 <link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}">
7 <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css' ) }}"> 7 <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css' ) }}">
8</head> 8 </head>
9<body> 9 <body>
10 10
11 <div class="container"> 11 <div class="container">
12 {% block content %} {% endblock %} 12 {% block content %} {% endblock %}
13 </div> 13 </div>
14 14
15<footer> 15 <footer>
16 {% block footer %} 16 {% block footer %}
17 {% endblock %} 17 {% endblock %}
18</footer> 18 </footer>
19{% block scripts %}{% endblock %} 19 </body>
20</body>
21</html> 20</html>
diff --git a/templates/daily.html b/templates/daily.html
deleted file mode 100644
index 5eb765e..0000000
--- a/templates/daily.html
+++ /dev/null
@@ -1,13 +0,0 @@
1{% extends 'base.html' %}
2{% block content %}
3<div class=weather-box>
4{% for item in data %}
5 <div class=daily-box>
6 {{ item.time.strftime("%a %x") }} <br>
7 {{ item.high }}°F / {{ item.low }}°F <br>
8 {{ item.short_forecast_am }} <br><br>
9 </div>
10{% endfor %}
11</div>
12{% endblock %}
13
diff --git a/templates/hourly.html b/templates/hourly.html
deleted file mode 100644
index 56f9d9b..0000000
--- a/templates/hourly.html
+++ /dev/null
@@ -1,18 +0,0 @@
1{% extends 'base.html' %}
2
3{% block content %}
4<div class=weather-box>
5{% for item in data %}
6 <div class=daily-box>
7 {{ item.time.strftime("%a %x %I:%M %p") }} <br>
8 {{ item.temp }}°F <br>
9 {{ item.humidity }}%<br>
10 {{ item.precip_chance }}%<br>
11 {{ item.precip_amount }}in<br>
12 {{ item.wind_speed }}MPH<br>
13 {{ item.wind_direction }}<br><br>
14 </div>
15{% endfor %}
16</div>
17{% endblock %}
18
diff --git a/templates/index.html b/templates/index.html
index 2d97379..a877fef 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -4,23 +4,7 @@
4<h1>{% block title %} Enter a Location {% endblock %}</h1> 4<h1>{% block title %} Enter a Location {% endblock %}</h1>
5<form method="post"> 5<form method="post">
6 {{ form.csrf_token }} 6 {{ form.csrf_token }}
7 <p> 7 {{ form.location }}
8 {{ form.location.label }} <br> 8 {{ form.submit() }}
9 {{ form.location }}
10 </p>
11 <p>
12 {{ form.days.label }} <br>
13 {{ form.days }}
14 </p>
15 <p>
16 {{ form.forecast_type.label }} <br>
17 {{ form.forecast_type }}
18 </p>
19 <p>{{ form.submit() }}</p>
20</form> 9</form>
21{% endblock %} 10{% endblock %}
22
23<form method="POST" action="/">
24 {{ form.name.label }} {{ form.name(size=20) }}
25 <input type="submit" value="Go">
26</form>
diff --git a/templates/weather.html b/templates/weather.html
new file mode 100644
index 0000000..24819dc
--- /dev/null
+++ b/templates/weather.html
@@ -0,0 +1,77 @@
1{% extends 'base.html' %}
2{% block content %}
3{% set is_day = data["current_weather"]["is_day"] %}
4<div class=content>
5 <div class=searchbar>
6 <form method="post">
7 {{ form.csrf_token }}
8 {{ form.location }}
9 {{ form.submit() }}
10 </form>
11 </div>
12 <div class=current>
13 {% set weather_code = data["current_weather"]["weathercode"] %}
14 <div class=current-info>
15 <div class=current-weather>{{ weather_codes[weather_code] }}</div>
16 <div class=current-temp> {{ data["current_weather"]["temperature"]}}°F </div>
17 <div class=current-wind>Wind: {{ data["current_weather"]["windspeed"] }} MPH {{ data["current_weather"]["winddirection"] }}</div>
18 <div class=current-sunrise>Sunrise: {{ data["daily"]["sunrise"][0] }} </div>
19 <div class=current-sunset>Sunset: {{ data["daily"]["sunset"][0] }} </div>
20 </div>
21 <div class=current-icon>
22 <img class=weather-icon src="/static/icons/svg/{{ weather_icons[weather_code][is_day]}}.svg" width=100px height=100px>
23 </div>
24 </div>
25 <div class=forecast-header> <h2 class=forecast-header>Hourly Forecast</h2> </div>
26 <div class=hourly>
27 {% for i in range(hour, hour + 24) %}
28 <div class=hourly-box>
29 <div class=hourly-info>
30 <div class=hourly-time><strong>{{ data["hourly"]["time"][i] }}</strong></div>
31 <div class=hourly-weather>
32 {{ weather_codes[data["hourly"]["weathercode"][i]] }}
33 {% if data["hourly"]["weathercode"][i] > 50 %}
34 ({{ data["hourly"]["precipitation"][i] }}in, {{ data["hourly"]["precipitation_probability"][i] }}%)
35 {% endif %}
36 </div>
37 <div class=hourly-temp>{{ data["hourly"]["temperature_2m"][i]}}°F</div>
38 <div class=hourly-humidity>Humidity: {{ data["hourly"]["relativehumidity_2m"][i] }}%</div>
39 <div class=hourly-wind>Wind: {{ data["hourly"]["windspeed_10m"][i] }}MPH {{ data["hourly"]["winddirection_10m"][i] }}</div>
40 </div>
41 <div class=hourly-icon>
42 {% set weather_code = data["hourly"]["weathercode"][i] %}
43 <img class=weather-icon src="/static/icons/svg/{{ weather_icons[weather_code][is_day]}}.svg" width=100px height=100px>
44 </div>
45 </div>
46 {% endfor %}
47 </div>
48 <div class=forecast-header>
49 <h2 class=forecast-header>Daily Forecast</h2>
50 </div>
51 <div class=daily>
52 {% for i in range(7) %}
53 <div class=daily-box>
54 <div class=daily-info>
55 <div class=daily-time><strong>{{ data["daily"]["time"][i] }}</strong></div>
56 <div class=daily-weather>
57 {{ weather_codes[data["daily"]["weathercode"][i]] }}
58 {% if data["daily"]["weathercode"][i] > 50 %}
59 ({{ data["daily"]["precipitation_sum"][i] }}in, {{ data["daily"]["precipitation_probability_max"][i] }}%)
60 {% endif %}
61 </div>
62 <div class=daily-high>High: {{ data["daily"]["temperature_2m_max"][i] }}°F</div>
63 <div class=daily-low>Low: {{ data["daily"]["temperature_2m_min"][i] }}°F</div>
64 <div class=daily-sunrise>Sunrise: {{ data["daily"]["sunrise"][i] }}</div>
65 <div class=daily-sunset>Sunset: {{ data["daily"]["sunset"][i] }}</div>
66 </div>
67 <div class=daily-icon>
68 {% set weather_code = data["daily"]["weathercode"][i] %}
69 <img class=weather-icon src="/static/icons/svg/{{ weather_icons[weather_code][is_day]}}.svg" width=100px height=100px>
70 </div>
71 </div>
72 {% endfor %}
73 </div>
74
75</div>
76{% endblock %}
77