Add: app.py, templates/error404.html, static/sass/error404.sass -Add Flask 404 handler and styled 404 page.tags/v1.0^2
@@ -56,5 +56,9 @@ def about(): | |||||
def developers(): | def developers(): | ||||
return render_template("developers.html") | return render_template("developers.html") | ||||
@app.errorhandler(404) | |||||
def error404(error): | |||||
return render_template("error404.html"), 404 | |||||
if __name__ == "__main__": | if __name__ == "__main__": | ||||
app.run(debug=True) | app.run(debug=True) |
@@ -0,0 +1,23 @@ | |||||
@import variables | |||||
div#message | |||||
color: $baseColor1 | |||||
font-family: monospace | |||||
font-size: 700% | |||||
font-weight: normal | |||||
margin-top: 8% | |||||
text-align: center | |||||
span | |||||
&#error-num | |||||
font-size: 170% | |||||
vertical-align: middle | |||||
&.c1 | |||||
color: $baseColor1 | |||||
&.c2 | |||||
color: $baseColor2 | |||||
&.c3 | |||||
color: $baseColor3 |
@@ -35,10 +35,12 @@ div#container | |||||
background-color: $baseColor1 | background-color: $baseColor1 | ||||
bottom: -30px | bottom: -30px | ||||
height: 60px | height: 60px | ||||
padding-bottom: 5px | |||||
padding-top: 15px | padding-top: 15px | ||||
position: fixed | position: fixed | ||||
text-align: center | text-align: center | ||||
width: 100% | width: 100% | ||||
z-index: 100 | |||||
&:hover | &:hover | ||||
@include delay(0s) | @include delay(0s) | ||||
@@ -0,0 +1,14 @@ | |||||
= extends "layout.html" | |||||
= block head | |||||
{{ assets.tag("error404.css") }} | |||||
= endblock | |||||
= block body | |||||
<div id="message"> | |||||
<span class="c1">puts</span | |||||
><span class="c3">(</span><span class=c2>"</span | |||||
><span id="error-num">404</span><span class=c2>"</span><span class=c3 | |||||
>)</span><span class="c3">;</span> | |||||
</div> | |||||
= endblock |