From 1361e999934e9ffb28002aa14d84a1c16da79e6d Mon Sep 17 00:00:00 2001 From: Alexander Roidl Date: Tue, 22 Nov 2022 16:06:30 +0100 Subject: [PATCH] compass? --- app/static/css/style.css | 62 ++++++++++++ app/templates/home.html | 198 ++++++++++++++++++++++++++++++++++----- app/templates/list.html | 4 +- app/views.py | 11 +++ 4 files changed, 250 insertions(+), 25 deletions(-) diff --git a/app/static/css/style.css b/app/static/css/style.css index 0896e25..1d359cd 100755 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -59,11 +59,19 @@ audio{ border-bottom: 1px solid black; } +.locations_list .row img{ + max-height: 2em; +} + .locations_list .row div:first-of-type { width: 5%; } +.locations_list .row div:nth-of-type(2) { + width: 10%; +} + .locations_list .row div:last-of-type{ } @@ -254,6 +262,12 @@ margin: 4em 0; box-sizing: border-box; } +#distance_close{ + font-family: 'Courier New', Courier, monospace; + +} + + #button_group button, #button_group select{ background-color: grey; color: white; @@ -261,8 +275,56 @@ margin: 4em 0; border: 1px solid white; border-radius: 2em; padding: 0.8em; + vertical-align: middle; + margin-top: 0.5em; + cursor: pointer; +} + +#button_group select option{ + padding: 0; + margin: 0; + vertical-align: middle; } #button_group img{ width: 1em; + margin-right: 0.2em; + vertical-align: middle; +} + + + +/* COMPAS */ + +.compass { + position: relative; + width: 320px; + height: 320px; + border-radius: 50%; + /* box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); */ + margin: auto; +} + + + +.compass > .compass-circle, +.compass > .my-point { + position: absolute; + width: 90%; + height: 90%; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + transition: transform 0.1s ease-out; +} + +.compass > .compass-circle svg{ + width: 100%; + height: 100%; +} + + + +.start-btn { + margin-bottom: auto; } \ No newline at end of file diff --git a/app/templates/home.html b/app/templates/home.html index 2b31bc4..e80a739 100755 --- a/app/templates/home.html +++ b/app/templates/home.html @@ -3,10 +3,20 @@ {% block main %}

+ + +
+
+
+
+
+ +
+
(distance to mosquito)
- + @@ -14,15 +24,17 @@ +
+ + + - -
{% for location in locations %} @@ -43,12 +55,11 @@ {% block js %} diff --git a/app/templates/list.html b/app/templates/list.html index 9ee5ca3..f8e6fab 100755 --- a/app/templates/list.html +++ b/app/templates/list.html @@ -7,12 +7,12 @@
{% for location in locations %}
-
{{location.id}}
+
{{location.id}}
+
{{location.longitude}}, {{location.latitude}}
{{location.message if location.loc_type == "message"}}{{location.message if location.loc_type == "audio"}}
{% if location.loc_type == "audio" %} - {% endif %}
diff --git a/app/views.py b/app/views.py index b33ff3e..888198b 100755 --- a/app/views.py +++ b/app/views.py @@ -73,6 +73,17 @@ def hello(name): @app.route('/addlocation', methods=['POST', 'GET']) def add_location(): + if request.method == 'POST': + data = request.get_json() + print("UPDATING DATA") + print(data['longitude']) + location = Location(data['longitude'],data['latitude'], "hangout", "", "") + db.session.add(location) + db.session.commit() + return redirect(url_for('home')) + +@app.route('/addlocationmosquito', methods=['POST', 'GET']) +def add_location_mosquito(): if request.method == 'POST': data = request.get_json() print("UPDATING DATA")