diff --git a/weather/__init__.py b/weather/__init__.py index c8bc86d..f3c5a2a 100644 --- a/weather/__init__.py +++ b/weather/__init__.py @@ -26,4 +26,8 @@ def create_app(test_config=None): from . import db db.init_app(app) + from . import weather + app.register_blueprint(weather.bp) + app.add_url_rule('/', endpoint='index') + return app diff --git a/weather/static/Abel-Regular.woff2 b/weather/static/Abel-Regular.woff2 new file mode 100644 index 0000000..40f104b Binary files /dev/null and b/weather/static/Abel-Regular.woff2 differ diff --git a/weather/static/reset.css b/weather/static/reset.css new file mode 100644 index 0000000..c4a9f5b --- /dev/null +++ b/weather/static/reset.css @@ -0,0 +1,54 @@ +/* 1. Use a more-intuitive box-sizing model */ +*, *::before, *::after { + box-sizing: border-box; +} + +/* 2. Remove default margin */ +*:not(dialog) { + margin: 0; +} + +/* 3. Enable keyword animations */ +@media (prefers-reduced-motion: no-preference) { + html { + interpolate-size: allow-keywords; + } +} + +body { + /* 4. Add accessible line-height */ + line-height: 1.5; + /* 5. Improve text rendering */ + -webkit-font-smoothing: antialiased; +} + +/* 6. Improve media defaults */ +img, picture, video, canvas, svg { + display: block; + max-width: 100%; +} + +/* 7. Inherit fonts for form controls */ +input, button, textarea, select { + font: inherit; +} + +/* 8. Avoid text overflows */ +p, h1, h2, h3, h4, h5, h6 { + overflow-wrap: break-word; +} + +/* 9. Improve line wrapping */ +p { + text-wrap: pretty; +} +h1, h2, h3, h4, h5, h6 { + text-wrap: balance; +} + +/* + 10. Create a root stacking context +*/ +#root, #__next { + isolation: isolate; +} diff --git a/weather/static/style.css b/weather/static/style.css new file mode 100644 index 0000000..8a76e20 --- /dev/null +++ b/weather/static/style.css @@ -0,0 +1,20 @@ +@font-face { + font-family: "Abel"; + src: url(Abel-Regular.woff2) format("woff2"); + font-weight: 400; + font-style: normal; + font-display: swap; +} + +.font-abel { + font-family: "Abel", sans-serif; +} + +.antialiased { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.min-h-screen { + min-height: 100vh; +} diff --git a/weather/templates/base.html b/weather/templates/base.html new file mode 100644 index 0000000..2d82113 --- /dev/null +++ b/weather/templates/base.html @@ -0,0 +1,28 @@ + + +
+ + + +{{ period['start_time'] }} - {{ period['end_time'] }} | {{ period['temperature'] }}{{ period['temperature_unit'] }}
+{% endfor %} +{% endblock %} diff --git a/weather/weather.py b/weather/weather.py new file mode 100644 index 0000000..636f4b5 --- /dev/null +++ b/weather/weather.py @@ -0,0 +1,18 @@ +from flask import ( + Blueprint, flash, g, render_template, request, url_for +) +from werkzeug.exceptions import abort + +from weather.db import get_db + +bp = Blueprint('weather', __name__) + +@bp.route('/') +def index(): + db = get_db() + periods = db.execute( + 'SELECT *' + ' FROM `periods`' + ' ORDER BY `id` DESC' + ).fetchall() + return render_template('weather/index.html', periods=periods) \ No newline at end of file