Cleaned up the templates
This commit is contained in:
+1
-1
@@ -32,7 +32,7 @@ def validate_URL(form, field):
|
|||||||
# If the url contains the websites domain
|
# If the url contains the websites domain
|
||||||
if WEBSITE_DOMAIN in field.data.lower():
|
if WEBSITE_DOMAIN in field.data.lower():
|
||||||
# Raise a ValidationError
|
# Raise a ValidationError
|
||||||
raise ValidationError("Yeah, that's definitely a valid URL")
|
raise ValidationError("Invalid URL")
|
||||||
|
|
||||||
# If the URL does not start with http:// and https://
|
# If the URL does not start with http:// and https://
|
||||||
if not(field.data.lower().startswith("http://")) and not(field.data.lower().startswith("https://")):
|
if not(field.data.lower().startswith("http://")) and not(field.data.lower().startswith("https://")):
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ body {
|
|||||||
margin-bottom: 2vh;
|
margin-bottom: 2vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.donation h3 {
|
.donation h4 {
|
||||||
margin-bottom: 4vh;
|
margin-bottom: 4vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,10 @@
|
|||||||
{% extends "layout.html" %}
|
{% extends "layout.html" %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<body>
|
<ul class="donation">
|
||||||
<div class="headers">
|
<li><h1>Bitcoin Address</h1></li>
|
||||||
<a class="title" href="{{ url_for('index') }}">tiny0</a>
|
<li><h4>1Mg55rPVuQ2P8zKsCcLdsmgqH24uLXfLbR</h4></li>
|
||||||
<h1 class="desc">Custom URL Shortener</h1>
|
<li><h1>Patreon</h1></li>
|
||||||
</div>
|
<li><a href="https://www.patreon.com/xemeds" target="_blank"><h3>patreon.com/xemeds</h3></a></li>
|
||||||
|
</ul>
|
||||||
<ul class="donation">
|
|
||||||
<li><h1>Bitcoin Address</h1></li>
|
|
||||||
<li><h3>1Mg55rPVuQ2P8zKsCcLdsmgqH24uLXfLbR</h3></li>
|
|
||||||
<li><h1>Patreon</h1></li>
|
|
||||||
<li><a href="https://www.patreon.com/xemeds" target="_blank"><h3>patreon.com/xemeds</h3></a></li>
|
|
||||||
</ul>
|
|
||||||
</body>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -1,15 +1,8 @@
|
|||||||
{% extends "layout.html" %}
|
{% extends "layout.html" %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<body>
|
<ul class="error-message">
|
||||||
<div class="headers">
|
<li><h1>{{ error_code }}</h1></li>
|
||||||
<a class="title" href="{{ url_for('index') }}">tiny0</a>
|
<li><h1>{{ error_message }}</h1></li>
|
||||||
<h1 class="desc">Custom URL Shortener</h1>
|
</ul>
|
||||||
</div>
|
|
||||||
|
|
||||||
<ul class="error-message">
|
|
||||||
<li><h1>{{ error_code }}</h1></li>
|
|
||||||
<li><h1>{{ error_message }}</h1></li>
|
|
||||||
</ul>
|
|
||||||
</body>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
+13
-57
@@ -1,62 +1,18 @@
|
|||||||
{% extends "layout.html" %}
|
{% extends "layout.html" %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
{% if form.url.errors %}
|
<div class="container">
|
||||||
<body>
|
<form method="POST" action="">
|
||||||
<div class="headers">
|
{{ form.hidden_tag() }}
|
||||||
<a class="title" href="{{ url_for('index') }}">tiny0</a>
|
<div class="inputs">
|
||||||
<h1 class="desc">Custom URL Shortener</h1>
|
{{ form.url(placeholder="Enter the URL here", autofocus=true, class="url") }}
|
||||||
|
{{ form.submit(class="button") }}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% if form.url.errors %}
|
||||||
<body onload="typeTitle()">
|
{% for error in form.url.errors %}
|
||||||
<div class="headers">
|
<p class="url-error-message">{{ error }}</p>
|
||||||
<a class="title" id="title" href="{{ url_for('index') }}"></a>
|
{% endfor %}
|
||||||
<h1 id="desc" class="desc"></h1>
|
{% endif %}
|
||||||
</div>
|
</form>
|
||||||
{% endif %}
|
</div>
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<form method="POST" action="">
|
|
||||||
{{ form.hidden_tag() }}
|
|
||||||
<div class="inputs">
|
|
||||||
{{ form.url(placeholder="Enter the URL here", autofocus=true, class="url") }}
|
|
||||||
{{ form.submit(class="button") }}
|
|
||||||
</div>
|
|
||||||
{% if form.url.errors %}
|
|
||||||
{% for error in form.url.errors %}
|
|
||||||
<p class="url-error-message">{{ error }}</p>
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% if not form.url.errors %}
|
|
||||||
<script>
|
|
||||||
var i = 0;
|
|
||||||
var title_text = "tiny0";
|
|
||||||
var desc_text = "Custom URL Shortener";
|
|
||||||
var speed = 120;
|
|
||||||
|
|
||||||
function typeTitle() {
|
|
||||||
if (i < title_text.length) {
|
|
||||||
document.getElementById("title").innerHTML += title_text.charAt(i);
|
|
||||||
i++;
|
|
||||||
setTimeout(typeTitle, speed);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
i = 0;
|
|
||||||
setTimeout(typeDesc, 200)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function typeDesc() {
|
|
||||||
if (i < desc_text.length) {
|
|
||||||
document.getElementById("desc").innerHTML += desc_text.charAt(i);
|
|
||||||
i++;
|
|
||||||
setTimeout(typeDesc, speed);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
{% endif %}
|
|
||||||
</body>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -13,7 +13,70 @@
|
|||||||
|
|
||||||
<div id="page-container">
|
<div id="page-container">
|
||||||
<div id="content-wrap">
|
<div id="content-wrap">
|
||||||
|
{% if form %}
|
||||||
|
{% if not form.url.errors %}
|
||||||
|
<body onload="typeTitle()">
|
||||||
|
<div class="headers">
|
||||||
|
<a class="title" id="title" href="{{ url_for('index') }}"></a>
|
||||||
|
<h1 id="desc" class="desc"></h1>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<body>
|
||||||
|
<div class="headers">
|
||||||
|
<a class="title" href="{{ url_for('index') }}">tiny0</a>
|
||||||
|
<h1 class="desc">Custom URL Shortener</h1>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
<body>
|
||||||
|
<div class="headers">
|
||||||
|
<a class="title" href="{{ url_for('index') }}">tiny0</a>
|
||||||
|
<h1 class="desc">Custom URL Shortener</h1>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% block body %}{% endblock %}
|
{% block body %}{% endblock %}
|
||||||
|
|
||||||
|
{% if form %}
|
||||||
|
{% if not form.url.errors %}
|
||||||
|
<script>
|
||||||
|
var i = 0;
|
||||||
|
var title_text = "tiny0";
|
||||||
|
var desc_text = "Custom URL Shortener";
|
||||||
|
var speed = 120;
|
||||||
|
|
||||||
|
function typeTitle() {
|
||||||
|
if (i < title_text.length) {
|
||||||
|
document.getElementById("title").innerHTML += title_text.charAt(i);
|
||||||
|
i++;
|
||||||
|
setTimeout(typeTitle, speed);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
i = 0;
|
||||||
|
setTimeout(typeDesc, 200)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function typeDesc() {
|
||||||
|
if (i < desc_text.length) {
|
||||||
|
document.getElementById("desc").innerHTML += desc_text.charAt(i);
|
||||||
|
i++;
|
||||||
|
setTimeout(typeDesc, speed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{% endif %}
|
||||||
|
{% elif url %}
|
||||||
|
<script>
|
||||||
|
function copyURL() {
|
||||||
|
var url = document.getElementById("url");
|
||||||
|
url.select();
|
||||||
|
url.setSelectionRange(0, 99999)
|
||||||
|
document.execCommand("copy");
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{% endif %}
|
||||||
|
</body>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,26 +1,10 @@
|
|||||||
{% extends "layout.html" %}
|
{% extends "layout.html" %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<body>
|
<div class="container">
|
||||||
<div class="headers">
|
<div class="inputs">
|
||||||
<a class="title" href="{{ url_for('index') }}">tiny0</a>
|
<input type="text" value="{{ url }}" id="url" class="url" readonly>
|
||||||
<h1 class="desc">Custom URL Shortener</h1>
|
<button onclick="copyURL()" class="button">Copy</button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="container">
|
|
||||||
<div class="inputs">
|
|
||||||
<input type="text" value="{{ url }}" id="url" class="url" readonly>
|
|
||||||
<button onclick="copyURL()" class="button">Copy</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function copyURL() {
|
|
||||||
var url = document.getElementById("url");
|
|
||||||
url.select();
|
|
||||||
url.setSelectionRange(0, 99999)
|
|
||||||
document.execCommand("copy");
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user