diff --git a/app/forms.py b/app/forms.py index 7170ad2..e48afc6 100755 --- a/app/forms.py +++ b/app/forms.py @@ -1,6 +1,6 @@ from flask_wtf import FlaskForm from wtforms import StringField, FileField, validators -from wtforms.validators import InputRequired, DataRequired +from wtforms.validators import InputRequired, DataRequired, NumberRange from wtforms import FieldList from wtforms import Form as NoCsrfForm from wtforms.fields import StringField, FormField, SubmitField, SelectField, RadioField @@ -14,17 +14,23 @@ from wtforms.widgets import TextArea # # this forms is never exposed so we can use the non CSRF version # author_name = StringField('Author Name', validators=[DataRequired()]) +class UploadLocation(FlaskForm): + longitude = DecimalRangeField( 'longitude', [InputRequired(),NumberRange(min=1, message="Not valid coordinates")]) + latitude = DecimalRangeField('latitude',[InputRequired(),NumberRange(min=1, message="Not valid coordinates")]) + + + class UploadText(FlaskForm): - message = StringField('message', widget=TextArea(), default=None) - longitude = DecimalRangeField('longitude', default=0) - latitude = DecimalRangeField('latitude', default=0) + message = StringField('message', [InputRequired()], widget=TextArea(), default=None) + longitude = DecimalRangeField( 'longitude', [InputRequired(),NumberRange(min=1, message="Not valid coordinates")]) + latitude = DecimalRangeField('latitude',[InputRequired(),NumberRange(min=1, message="Not valid coordinates")]) class UploadAudio(FlaskForm): message = StringField('message', widget=TextArea(), default=None) audio = FileField() - longitude = DecimalRangeField('longitude', default=0) - latitude = DecimalRangeField('latitude', default=0) + longitude = DecimalRangeField( 'longitude', [InputRequired(),NumberRange(min=1, message="Not valid coordinates")]) + latitude = DecimalRangeField('latitude',[InputRequired(),NumberRange(min=1, message="Not valid coordinates")]) diff --git a/app/static/css/style.css b/app/static/css/style.css index f89bab0..bf3e93e 100755 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -1,5 +1,14 @@ +@font-face { + font-family: 'metaaccanthisalternaalternate'; + src: url('../fonts/metaaccanthisalternate-webfont.woff2') format('woff2'), + url('../fonts/metaaccanthisalternate-webfont.woff') format('woff'); + font-weight: normal; + font-style: normal; + +} + *{ -font-family: "Helvetica"; +font-family: "metaaccanthisalternaalternate"; box-sizing: border-box; } @@ -12,7 +21,7 @@ body{ } p{ - font-size: 20px; + font-size: 1.5em; } a{ @@ -97,7 +106,9 @@ audio{ } - +.content_container{ + padding: 1em; +} /* FROM */ @@ -250,7 +261,7 @@ margin: 4em 0; display: inline-block; top: 0; font-size: 1em; - font-family: 'Courier New', Courier, monospace; + font-family: "metaaccanthisalternaalternate"; margin: 1em; } @@ -263,7 +274,7 @@ margin: 4em 0; } #distance_close{ - font-family: 'Courier New', Courier, monospace; + font-family: "metaaccanthisalternaalternate"; } @@ -271,19 +282,28 @@ margin: 4em 0; #button_group button, #button_group select{ background-color: grey; color: white; - font-size: 1em; + font-size: 0.9em; border: 1px solid white; border-radius: 2em; - padding: 0.8em; + padding: 0.6em; vertical-align: middle; margin-top: 0.5em; cursor: pointer; } -#button_group select option{ - padding: 0; +#button_group select{ + height:2.8em; margin: 0; + padding-top: 0; + padding-bottom: 0; +} + + +#button_group select option{ vertical-align: middle; + margin: 0; + padding-top: 0; + padding-bottom: 0; } #button_group img{ @@ -292,24 +312,37 @@ margin: 4em 0; vertical-align: middle; } +button[type="submit"]{ + background-color: grey; + color: white; + font-size: 1em; + border: 1px solid white; + border-radius: 2em; + padding: 0.8em; + vertical-align: middle; + margin-top: 0.5em; + cursor: pointer; +} /* COMPAS */ .compass { position: relative; - width: 320px; - height: 320px; + width: 40vw; + height: 40vw; border-radius: 50%; /* box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); */ margin: auto; pointer-events: none; + /* display: none; */ } .compass > .compass-circle, -.compass > .my-point { +.compass > .arrow, +.compass > .compass-goal { position: absolute; width: 90%; height: 90%; @@ -317,11 +350,14 @@ margin: 4em 0; left: 50%; transform: translate(-50%, -50%); transition: transform 0.1s ease-out; + display: none; + pointer-events: none; } .compass > .compass-circle svg{ width: 100%; height: 100%; + pointer-events: none; } diff --git a/app/static/fonts/metaaccanthisalternate-webfont.woff b/app/static/fonts/metaaccanthisalternate-webfont.woff new file mode 100644 index 0000000..1ce1bdf Binary files /dev/null and b/app/static/fonts/metaaccanthisalternate-webfont.woff differ diff --git a/app/static/fonts/metaaccanthisalternate-webfont.woff2 b/app/static/fonts/metaaccanthisalternate-webfont.woff2 new file mode 100644 index 0000000..13c7609 Binary files /dev/null and b/app/static/fonts/metaaccanthisalternate-webfont.woff2 differ diff --git a/app/templates/about.html b/app/templates/about.html index f45f967..c592616 100755 --- a/app/templates/about.html +++ b/app/templates/about.html @@ -1,9 +1,14 @@ {% extends "base.html" %} {% block main %} -

About

-
-

About

+
+

About

+
+

This webpage is part of the projekt Hunting Mosquitos by Angeliki Diakrousi

+

+ The site is running on a flask instance, storing data in a SQLite database. The location is tracked using the geolocation API. Audio is recorded through the WebAudio API. +

+
{% endblock %} diff --git a/app/templates/addaudio.html b/app/templates/addaudio.html index 28ecb02..f288afc 100755 --- a/app/templates/addaudio.html +++ b/app/templates/addaudio.html @@ -2,7 +2,7 @@ {% block main %} {% from "_formhelpers.html" import render_field %} - +

Add Audio

{% with messages = get_flashed_messages() %} {% if messages %} @@ -16,7 +16,7 @@ {% endif %} {% endwith %} -
+ {{ form.csrf_token }} @@ -32,12 +32,17 @@
-
- message:
{{ form.message(class="form-control") }} -
+ + + {% block privacy_note_submit %} + {% include "privacy_note_submit.html" %} + {% endblock %}
+
{% endblock main %} diff --git a/app/templates/addhangout.html b/app/templates/addhangout.html new file mode 100755 index 0000000..6a3e27f --- /dev/null +++ b/app/templates/addhangout.html @@ -0,0 +1,31 @@ +{% extends 'base.html' %} + +{% block main %} +{% from "_formhelpers.html" import render_field %} +
+

Add Hangout

+ {% with messages = get_flashed_messages() %} + {% if messages %} +
+
    + {% for message in messages %} +
  • {{ message }}
  • + {% endfor %} +
+
+ {% endif %} + {% endwith %} + {% block privacy_note_submit %} + {% include "privacy_note_submit.html" %} + {% endblock %} + +
+ {{ form.csrf_token }} + + + +
+
+ +{% endblock main %} + diff --git a/app/templates/addmosquito.html b/app/templates/addmosquito.html new file mode 100755 index 0000000..d7fe8d5 --- /dev/null +++ b/app/templates/addmosquito.html @@ -0,0 +1,30 @@ +{% extends 'base.html' %} + +{% block main %} +{% from "_formhelpers.html" import render_field %} +
+

Add Mosquito

+ {% with messages = get_flashed_messages() %} + {% if messages %} +
+
    + {% for message in messages %} +
  • {{ message }}
  • + {% endfor %} +
+
+ {% endif %} + {% endwith %} + {% block privacy_note_submit %} + {% include "privacy_note_submit.html" %} + {% endblock %} +
+ {{ form.csrf_token }} + + + +
+
+ +{% endblock main %} + diff --git a/app/templates/addtext.html b/app/templates/addtext.html index 6f3d508..be44341 100755 --- a/app/templates/addtext.html +++ b/app/templates/addtext.html @@ -2,7 +2,7 @@ {% block main %} {% from "_formhelpers.html" import render_field %} - +

Add Message

{% with messages = get_flashed_messages() %} {% if messages %} @@ -15,19 +15,19 @@
{% endif %} {% endwith %} -
+ {{ form.csrf_token }}
- message: {{ form.message(class="form-control") }} + {{ form.message(class="form-control") }}
- + {% block privacy_note_submit %} + {% include "privacy_note_submit.html" %} + {% endblock %} - - -
- + +
{% endblock main %} diff --git a/app/templates/header.html b/app/templates/header.html index c48ac39..b8f4cee 100755 --- a/app/templates/header.html +++ b/app/templates/header.html @@ -1,7 +1,7 @@