From 16f562441d75ccab79559e10bbaaaaded2c46a5f Mon Sep 17 00:00:00 2001 From: xemeds Date: Sat, 18 Jul 2020 23:39:18 +0000 Subject: [PATCH] Added a simple home page --- tiny0/forms.py | 2 +- tiny0/static/style.css | 48 ++++++++++++++++++++++++++++++++++++- tiny0/templates/index.html | 12 ++++------ tiny0/templates/layout.html | 2 ++ 4 files changed, 55 insertions(+), 9 deletions(-) diff --git a/tiny0/forms.py b/tiny0/forms.py index 6b57ae1..66f867f 100644 --- a/tiny0/forms.py +++ b/tiny0/forms.py @@ -33,4 +33,4 @@ def validate_URL(form, field): class URLForm(FlaskForm): url = StringField(validators=[DataRequired(), Length(min=4, max=2000), validate_URL]) - submit = SubmitField("Shorten URL") + submit = SubmitField("Shorten") diff --git a/tiny0/static/style.css b/tiny0/static/style.css index 1820ddd..e5b214c 100644 --- a/tiny0/static/style.css +++ b/tiny0/static/style.css @@ -1,3 +1,49 @@ body { - background: #2c2c2c; + margin: 0; + padding: 0; + font-family: sans-serif; + background: #121212; } + +.form { + background: #2c2c2c; + border-radius: 15px; + padding: 7% 0; + position: absolute; + width: 85%; + top: 30%; + left: 50%; + transform: translate(-50%,-50%); + text-align: center; +} + +.url { + background: #121212; + border: 2px solid #bb86fc; + border-radius: 5px; + padding: 2% 2%; + width: 50%; + margin-left: 2%; + color: #ffffff; +} + +.url:focus { + border-color: #7b59a5; +} + +.submit { + background: #bb86fc; + border: 2px solid #bb86fc; + border-radius: 5px; + padding: 1% 1%; + display: inline-block; + margin: 1% 1% 0px 1%; + color: #000000; + font-weight: bold; + font-size: 120%; +} + +.submit:hover { + background: #7b59a5; + border-color: #7b59a5; +} \ No newline at end of file diff --git a/tiny0/templates/index.html b/tiny0/templates/index.html index f528d36..428c8f2 100644 --- a/tiny0/templates/index.html +++ b/tiny0/templates/index.html @@ -1,11 +1,9 @@ {% extends "layout.html" %} {% block body %} -
-
- {{ form.hidden_tag() }} - {{ form.url(placeholder="Enter the URL here") }} - {{ form.submit }} -
-
+
+ {{ form.hidden_tag() }} + {{ form.url(placeholder="Enter the URL here", class="url") }} + {{ form.submit(class="submit") }} +
{% endblock %} diff --git a/tiny0/templates/layout.html b/tiny0/templates/layout.html index 86679aa..789f356 100644 --- a/tiny0/templates/layout.html +++ b/tiny0/templates/layout.html @@ -1,6 +1,8 @@ + + tiny0 - Custom URL Shortener