summaryrefslogtreecommitdiff
path: root/jobs/hövd.ing
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2023-12-11 00:39:19 +0100
committerMathias Magnusson <mathias@magnusson.space>2023-12-11 00:39:19 +0100
commitfdaf85a43f6f2ad98c5004bfeeddfd1a92097fb3 (patch)
tree5baccd921cbf3e2ac32684e50b886ba1e92e6372 /jobs/hövd.ing
parentfc50463cbf9d561a5c482df2e5807121494ca88c (diff)
downloadgarm-fdaf85a43f6f2ad98c5004bfeeddfd1a92097fb3.tar.gz
Add hövd.ing site
Diffstat (limited to 'jobs/hövd.ing')
-rw-r--r--jobs/hövd.ing/hövd.ing.nomad.hcl62
-rw-r--r--jobs/hövd.ing/index.html64
2 files changed, 126 insertions, 0 deletions
diff --git a/jobs/hövd.ing/hövd.ing.nomad.hcl b/jobs/hövd.ing/hövd.ing.nomad.hcl
new file mode 100644
index 0000000..dd06924
--- /dev/null
+++ b/jobs/hövd.ing/hövd.ing.nomad.hcl
@@ -0,0 +1,62 @@
+job "hövd.ing" {
+ group "web" {
+ count = 1
+
+ network {
+ port "http" {
+ to = 80
+ }
+ }
+
+ service {
+ name = "hovding"
+ port = "http"
+ provider = "nomad"
+
+ tags = [
+ "nginx.hostname=.xn--hvd-sna.ing",
+ "nginx.certname=xn--hvd-sna.ing",
+ ]
+ }
+
+ task "web" {
+ driver = "docker"
+
+ resources {
+ cpu = 50
+ memory = 20
+ }
+
+ config {
+ image = "nginx:1.25-alpine"
+ ports = ["http"]
+
+ volumes = [
+ "local/config:/etc/nginx/conf.d",
+ "local/html:/var/www/html",
+ ]
+ }
+
+ template {
+ data = <<EOF
+server {
+ listen 80 default_server;
+ listen [::]:80 default_server;
+ http2 on;
+
+ root /var/www/html;
+ location / {
+ index index.html;
+ }
+}
+EOF
+ destination = "local/config/website.conf"
+ }
+
+ template {
+ data = file("jobs/hövd.ing/index.html")
+ destination = "local/html/index.html"
+ }
+ }
+ }
+}
diff --git a/jobs/hövd.ing/index.html b/jobs/hövd.ing/index.html
new file mode 100644
index 0000000..1e26535
--- /dev/null
+++ b/jobs/hövd.ing/index.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html lang="sv">
+<head>
+ <meta charset="utf-8" />
+ <title>Hövding</title>
+ <style>
+ * {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+ }
+ body {
+ display: grid;
+ place-items: center;
+ min-height: 100vh;
+ font-family: monospace;
+ }
+ span {
+ position: relative;
+ }
+ .invisible {
+ display: none;
+ }
+ </style>
+</head>
+<body>
+ <h1>Hövding (det är jag alltså)</h1>
+
+ <script>
+ const el = document.querySelector("h1");
+ const text = el.textContent;
+ el.innerHTML = "";
+ const spans = new Array(text.length).fill().map((_, i) => {
+ const span = document.createElement("span");
+ span.innerText = text[i];
+ span.classList.add("invisible");
+ el.appendChild(span);
+ return span;
+ });
+ const underscore = document.createElement("span");
+ const underscoreInner = document.createElement("span");
+ underscoreInner.innerText = "_";
+ underscore.appendChild(underscoreInner);
+ underscore.style.position = "relative";
+ underscoreInner.style.position = "absolute";
+ el.appendChild(underscore);
+ let i = 0;
+ function next() {
+ spans[i].classList.remove("invisible");
+
+ i++;
+ if (i >= spans.length) {
+ setTimeout(removeCursor, 200);
+ } else {
+ setTimeout(next, Math.ceil(Math.random() * 200));
+ }
+ }
+ next();
+ function removeCursor() {
+ underscore.classList.add("invisible");
+ }
+ </script>
+</body>
+</html>