fix(templates): Add basic template

This commit is contained in:
Myzel394 2024-11-20 16:53:29 +01:00
parent 2a55890764
commit ea18750b24
No known key found for this signature in database
GPG Key ID: ED20A1D1D423AF3F
2 changed files with 127 additions and 109 deletions

49
templates/base.html.njk Normal file
View File

@ -0,0 +1,49 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="darkreader-lock">
<title>amiopen.now</title>
<style type="text/css">
* {
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
background-color: #161318;
color: #eee;
margin: 0;
padding: 0;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
}
main {
background-color: #212126;
width: 100%;
max-width: 40em;
margin: 0 auto;
border-radius: 1em;
padding: 3em;
}
</style>
{% block header %}{% endblock %}
</head>
<body>
<main>
{% block main %}
<h2>Am I Open</h2>
{% endblock %}
</main>
{% block scripts %}
{% endblock %}
</body>
</html>

View File

@ -1,39 +1,7 @@
<!doctype html> {% extends "base.html.njk" %}
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="darkreader-lock">
<title>amiopen.now</title>
{% block header %}
<style type="text/css"> <style type="text/css">
* {
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
background-color: #161318;
color: #eee;
margin: 0;
padding: 0;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
}
main {
background-color: #212126;
width: 100%;
max-width: 40em;
margin: 0 auto;
border-radius: 1em;
padding: 3em;
}
h2 { h2 {
margin-top: 0; margin-top: 0;
text-align: left; text-align: left;
@ -93,9 +61,9 @@
filter: invert(1); filter: invert(1);
} }
</style> </style>
</head> {% endblock %}
<body>
<main> {% block main %}
<h2>Am I Open</h2> <h2>Am I Open</h2>
<p> <p>
Your IP address: <strong>{{ip}}</strong> Your IP address: <strong>{{ip}}</strong>
@ -128,7 +96,9 @@
Hint: You can also check if you can access SSH by using: Hint: You can also check if you can access SSH by using:
<pre><code><span class="command">ssh</span> <span class="secondary">hello</span>@amiopen.now</code></pre> <pre><code><span class="command">ssh</span> <span class="secondary">hello</span>@amiopen.now</code></pre>
</i> </i>
</main> {% endblock %}
{% block scripts %}
<script defer> <script defer>
const $copyButton = document.getElementById("copy-ip"); const $copyButton = document.getElementById("copy-ip");
const ip = "{{ip}}"; const ip = "{{ip}}";
@ -137,5 +107,4 @@
navigator.clipboard.writeText(ip); navigator.clipboard.writeText(ip);
}); });
</script> </script>
</body> {% endblock %}
</html>