Переглянути джерело

adding the html files to git

aeth 2 місяців тому
батько
коміт
d01cc7cf52

+ 0 - 1
.gitignore

@@ -7,7 +7,6 @@ build/linux/keiji/*
 build/linux/keiji-ctl/*
 
 html/assets/images/*
-html/
 
 
 sqlite.db

+ 28 - 0
pkg/webpages/html/admin.html

@@ -0,0 +1,28 @@
+{{ define "admin" }}
+<!DOCTYPE html>
+<html lang="en">
+    <div class="container-fluid row">
+        {{ range $key, $value := .Tables }}
+            <div class="col">
+                <div class="col container h-2 p-2" style="background-color: rgb(22, 22, 22); color: white; height: fit-content; font-size: larger; font-family: monospace;">{{ $key }}
+                </div>
+                    <table class="table table-dark table-hover">
+                        <thead>
+                        </thead>
+                            <tbody>
+                            {{ range $value }}
+                                <tr>
+                                    <div class="container">
+                                        <div class="row">
+                                        <button class="btn-primary" hx-get="{{ .Link }}" hx-swap="outerHTML" scope="row" style="color: white; height: fit-content; font-size: larger; font-family: monospace;">{{ .DisplayName }}</button>
+                                        </div>
+                                    </div>
+                                </tr>
+                            {{ end }}
+                            </tbody>
+                    </table>
+                </div>
+            {{ end }}
+    </div>
+</html>
+{{ end }}

+ 22 - 0
pkg/webpages/html/blogpost.html

@@ -0,0 +1,22 @@
+{{ define "blogpost" }}
+<!DOCTYPE html>
+<html lang="en">
+
+        <div class="container-fluid row">
+            <div class="col"></div>
+            <div class="col-auto p-3 m-3" style="max-width: 80vw;">
+                <div class="row" style="background-color: rgb(22, 22, 22); color: white; height: fit-content; font-family: monospace; white-space: pre-wrap;">
+                    <p class="text-center">{{ .Title }}</p>
+                </div>
+                <div class="row" style="background-color: rgb(22, 22, 22); color: white; height: fit-content; font-family: monospace; white-space: pre-wrap">
+                    <p class="text-left">{{ .Created }}</p>
+                </div>
+                <div class="row" style="background-color: rgb(22, 22, 22); color: white; height: fit-content; font-family: monospace; white-space: pre-wrap">
+                    <p class="text-left">{{ .Body }}</p>
+                </div>
+            </div>
+            <div class="col"></div>
+        </div>
+
+</html>
+{{ end }}

+ 70 - 0
pkg/webpages/html/blogpost_editor.html

@@ -0,0 +1,70 @@
+{{ define "patch_blogpost_editor" }}
+<form hx-patch="/admin/posts" hx-ext="json-enc" hx-target="#response" hx-swap="innerHTML">
+{{ end }}
+
+{{ define "post_blogpost_editor" }}
+<form hx-post="/admin/posts" hx-ext="json-enc" hx-target="#response" hx-swap="innerHTML">
+{{ end }}
+
+
+{{ define "blogpost_editor" }}
+<!DOCTYPE html>
+<html lang="en">
+    <div class="container-fluid p-2 position-relative"
+        style="width: 80vw; max-width: 80%; background-color: rgb(22, 22, 22);">
+        <div class="container">
+            <div class="row">
+                <div class="col-sm"></div>
+                <div class="container position-relative">
+                    <a style="color: white; height: fit-content; font-size: xx-large; font-weight: bold; font-family: monospace;">Making a New Post</a>
+                    <div class="col m-5">
+                        {{ if $.Post }}
+                            {{ template "post_blogpost_editor" }}
+                        {{ else }}
+                            {{ template "patch_blogpost_editor" }}
+                        {{ end }}
+                            <div class="row"
+                                style="background-color: rgb(22, 22, 22); color: white; height: fit-content; font-size: larger; font-family: monospace;">
+                                <a>Title:</a>
+                                <textarea name="title"
+                                    style="background-color: rgb(73, 73, 73); color: white;">{{ .Title }}</textarea>
+                            </div>
+                            <div class="row"
+                                style="background-color: rgb(22, 22, 22); color: white; height: fit-content; font-size: larger; font-family: monospace;">
+                                <a>Post ID:</a>
+                                <textarea name="id"
+                                    style="background-color: rgb(73, 73, 73); color: white;">{{ .Ident }}</textarea>
+                            </div>
+                            <div class="row"
+                                style="background-color: rgb(22, 22, 22); color: white; height: fit-content; font-size: larger; font-family: monospace;">
+                                <a>Category:</a>
+                                <select name="category" class="form-select"
+                                    style="background-color: rgb(73, 73, 73); color: white; height: fit-content; font-size: larger; font-family: monospace;">
+                                    <option selected>{{ .DefaultTopic }}</option>
+                                    {{ range .Topics }}
+                                    <option value="{{ . }}">{{ . }}</option>
+                                    {{ end }}
+                                </select>
+                            </div>
+                            <div class="row"
+                                style="background-color: rgb(22, 22, 22); color: white; height: fit-content; font-size: large; font-family: monospace;">
+                                <a>Time of creation:</a>
+                                <textarea name="created"
+                                    style="background-color: rgb(73, 73, 73); color: white;">{{ .Created }}</textarea>
+                            </div>
+                            <div class="row"
+                                style="background-color: rgb(22, 22, 22); color: white; height: fit-content; font-size: larger; font-family: monospace;">
+                                <a>Post Body:</a>
+                                <textarea name="body" rows="30" wrap="soft"
+                                    style="background-color: rgb(73, 73, 73); color: white;">{{ .Body }}</textarea>
+                            </div>
+                            <button type="submit">Send</button><div id="response"></div>
+                        </form>
+                    </div>
+                </div>
+                <div class="col-sm"></div>
+            </div>
+        </div>
+    </div>
+</html>
+{{ end }}

+ 62 - 0
pkg/webpages/html/digital_art.html

@@ -0,0 +1,62 @@
+
+{{ define "centered_image" }}
+<!DOCTYPE html>
+<html lang="en">
+    <div class="row container-fluid m-0 p-0">
+        <div class="col container-fluid" style="background-color: black;"></div>
+        <img src="/api/v1/images/{{ .Ident }}" loading="lazy" class="img-fluid m-0 p-0 col-auto" style="background-color: black; max-height: 70vh;">
+        <div class="col container-fluid" style="background-color: black;"></div>
+    </div>
+    <a href="#">
+        <div class="mask" style="background-color: hsla(0, 0%, 98%, 0.2)">
+            <div class="row align-items-center" style="font-family: monospace; color: white; min-height: 100%;">
+                <div class="col"></div>
+                <div class="col-auto">
+                    <div class="row col-auto p-2 m-2" style="font-size: xx-large;">
+                        '{{ .Title }}'
+                    </div>
+                    <div class="row col-auto p-2 m-2" style="font-size: x-large;">
+                        {{ .Desc }}
+                    </div>
+                </div>
+                <div class="col"></div>
+            </div>
+        </div>
+    </a>
+</html>
+{{ end }}
+
+
+
+
+
+{{ define "digital_art" }}
+<!DOCTYPE html>
+<html lang="en">
+    <html lang="en">
+    <head>
+        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1">
+        <link rel="stylesheet" href="/api/v1/style/bootstrap.min.css">
+        <link rel="stylesheet" href="/api/v1/style/mdb/mdb.min.css">
+        <link rel="stylesheet" href="/api/v1/cdn/custom.css">
+    </head>
+    <body style="background-color: rgb(56, 56, 56);">
+    <div id="main">
+
+        <div class="container-fluid row">
+            {{ range .images }}
+                <div class="col-sm hover-overlay" data-mdb-ripple-init data-mdb-ripple-color="light">
+                    <div class="col-auto">
+                        <div class="row position-relative shadow-lg p-3 m-3 rounded justify-content-center"
+                            style="width: 80vh; max-width: 95%; background-color: rgb(22, 22, 22);">
+                                {{ template "centered_image" . }}
+                        </div>
+                    </div>
+                </div>
+            {{ end }}
+            </div>
+        </div>
+    </body>
+</html>
+{{ end }}

+ 91 - 0
pkg/webpages/html/home.html

@@ -0,0 +1,91 @@
+{{ define "head" }}
+<!DOCTYPE html>
+<html lang="en">
+    <head>
+        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1">
+        <link rel="stylesheet" href="/api/v1/cdn/bootstrap.min.css">
+        <link rel="stylesheet" href="/api/v1/cdn/mdb.min.css">
+        <link rel="stylesheet" href="/api/v1/cdn/custom.css">
+    </head>
+</html>
+{{ end }}
+
+{{ define "navigation" }}
+<div class="container-fluid sticky-top pb-0">
+    <div class="row align-items-center justify-content-center h-100 shadow-lg p-0 mb-0 rounded" style="background-color: #2a2e2f;">
+        <div class="col-sm-8 p-3">
+            <div style="color: whitesmoke; font-size: xx-large; font-family: monospace;">
+                <a href="/" style="color:whitesmoke">aetherial.dev homepage</a>
+            </div>
+        </div>
+        <div class="col-sm">
+            <div class="row">
+                {{ range .headers }}
+                    <div class="col-2">
+                        <div class="bg-image hover-overlay shadow-1-strong rounded d-inline-flex p-0"
+                            data-mdb-ripple-init
+                            data-mdb-ripple-color="light">
+                            <img src="/api/v1/assets/{{ .Link}}" style="max-height: 5vh;"/>
+                            <a href="{{ .Redirect}}" target="_blank">
+                              <div class="mask" style="background-color: hsla(0, 0%, 98%, 0.2)"></div>
+                            </a>
+                        </div>
+                    </div>
+                {{ end }}
+                <div class="col-2">
+                    <div class="bg-image hover-overlay shadow-1-strong d-inline-flex p-0 row"
+                            id="dropdownMenuButton" data-bs-toggle="dropdown"
+                            data-mdb-ripple-init
+                            data-mdb-ripple-color="light">
+                            <span onclick="toggleNav()">
+                            <img src="/api/v1/assets/menu.png" style="max-height: 5vh;"/>
+                                <div class="mask" style="background-color: hsla(0, 0%, 98%, 0.2)"></div>
+                            </span>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+{{ end }}
+
+{{ define "default"}}
+
+        <div class="container-fluid row">
+            <div class="col"></div>
+            <div class="col-auto p-3 m-3" style="max-width: 80vw;">
+                <div class="row" style="background-color: rgb(22, 22, 22); color: white; height: fit-content; font-family: monospace; white-space: pre-wrap">
+                    <p class="text-left">{{ .Body }}</p>
+                </div>
+            </div>
+            <div class="col"></div>
+         </div>
+{{ end }}
+
+
+
+{{ define "home" }}
+<!DOCTYPE html>
+<html lang="en">
+    {{ template "head" }}
+    <body style="background-color: #191a1b;">
+    {{ template "navigation" .navigation }}
+    <div id="main">
+        {{ template "default" .default }}
+    </div>
+
+    <div id="mySidenav" class="sidenav row">
+        {{ range .menu}}
+            <button class="btn-primary" hx-get="{{ .MenuLink }}" style="font-family: monospace;" hx-target="#main">
+                {{ .LinkText }}
+            </button>
+        {{ end }}
+    </div>
+        <script type="text/javascript" src="/api/v1/cdn/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
+        <script src="/api/v1/cdn/slide.js"></script>
+        <script src="/api/v1/cdn/htmx.min.js"></script>
+        <script src="/api/v1/cdn/json-enc.js"></script>
+    </body>
+</html>
+{{ end }}

+ 22 - 0
pkg/webpages/html/listing.html

@@ -0,0 +1,22 @@
+{{ define "listing" }}
+<!DOCTYPE html>
+<html>
+{{ range . }}
+        <div class="row position-relative shadow-lg p-3 m-3 rounded justify-content-center"
+            style="width: 80vh; max-width: 95%; background-color: rgb(22, 22, 22);">
+            <div class="row" style="background-color: rgb(22, 22, 22); color: white; height: fit-content;font-family: monospace;">
+                <p class="text-center">{{ .Title }}</p>
+            </div>
+            <div class="row" style="background-color: rgb(22, 22, 22); color: white; height: fit-content; font-family: monospace;">
+                <p class="text-left">{{ .Created }}</p>
+            </div>
+            <div class="row" style="background-color: rgb(22, 22, 22); color: white; height: fit-content; font-family: monospace;">
+                <p class="text-left">{{ .Sample }}</p>
+            </div>
+            <button hx-get="/writing/{{ .Ident }}" hx-target="#main">
+                <div class="mask" style="background-color: hsla(0, 0%, 98%, 0.2)"></div>
+            </button>
+        </div>
+{{ end }}
+</html>
+{{ end }}

+ 26 - 0
pkg/webpages/html/login.html

@@ -0,0 +1,26 @@
+{{ define "login" }}
+<!DOCTYPE html>
+<html lang="en">
+        <div class="container-fluid p-5 position-relative">
+            <div class="container">
+                <div class="row">
+                    <div class="col-sm"></div>
+                    <div class="row position-relative shadow-lg p-3 m-3 rounded justify-content-center"
+                        style="width: 80vh; max-width: 95%; background-color: rgb(22, 22, 22);">
+                        <div class="col-sm" style="color: whitesmoke; font-size: xx-large; font-family: monospace;">
+                            <form method="post"
+                                hx-post="/login"
+                                hx-ext="json-enc"
+                                hx-target="#main">
+                                <input type="text" name="username" placeholder="do androids dream" required><br>
+                                <input type="password" name="password" placeholder="of electric sheep?" required><br>
+                                <button class="btn-primary" type="submit" hx-target="#main">Send</button>
+                            </form>
+                        </div>
+                    </div>
+                    <div class="col-sm"></div>
+                </div>
+            </div>
+        </div>
+</html>
+{{ end }}

+ 15 - 0
pkg/webpages/html/post_options.html

@@ -0,0 +1,15 @@
+{{ define "post_options" }}
+<div class="container">
+    <div class="row">
+        <div class="col">
+            <button class="btn-primary" hx-delete="{{ .Link }}" hx-swap="innerHTML" scope="row" style="color: white; height: fit-content; font-size: larger; font-family: monospace;">Delete</button>
+        </div>
+        <div class="col">
+            <button class="btn-primary" hx-get="{{ .Link }}" hx-target="#main" scope="row" style="color: white; height: fit-content; font-size: larger; font-family: monospace;">Modify</button>
+        </div>
+    </div>
+</div>
+
+
+
+{{ end }}

+ 19 - 0
pkg/webpages/html/unhandled_error.html

@@ -0,0 +1,19 @@
+{{ define "unhandled_error" }}
+<!DOCTYPE html>
+<html lang="en">
+    <head>
+        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1">
+        <link rel="stylesheet" href="/api/v1/style/bootstrap.min.css">
+        <link rel="stylesheet" href="/api/v1/style/mdb/mdb.min.css">
+    </head>
+    <body style="background-color: rgb(56, 56, 56);">
+        {{ template "navigation" .navigation }}
+        <div class="col container-fluid" style="max-width: 80vw; background-color: rgb(22, 22, 22);">
+            <a style="color: red; height: fit-content; font-size: larger; font-family: monospace;">
+                STATUS: {{ .StatusCode }}. UNHANDLED EXCEPTION RAISED: {{ .Reason }}
+            </a>
+        </div>
+    </body>
+</html>
+{{ end }}

+ 30 - 0
pkg/webpages/html/upload.html

@@ -0,0 +1,30 @@
+{{ define "upload" }}
+<!DOCTYPE html>
+<html lang="en">
+    <div class="container-fluid row">
+        <div class="col"></div>
+        <div class="col" style="min-width: 80vw; background-color: rgb(22, 22, 22); font-family: monospace;">
+            <form hx-encoding='multipart/form-data' hx-post='/admin/images/upload'
+                 _='on htmx:xhr:progress(loaded, total) set #progress.value to (loaded/total)*100'>
+                    <div class="row container p-2 m-2">
+                        <input type='file' name='file'>
+                    </div>
+                    <div class="row container p-2 m-2">
+                        <textarea name="title" wrap="soft" required="required" placeholder="Name of the piece?"></textarea>
+                    </div>
+                    <div class="row container p-2 m-2">
+                        <textarea name="description" wrap="soft" required="required" placeholder="What would you like to say about it?"></textarea>
+                    </div>
+                    <div class="row container p-2 m-2">
+                        <button>
+                           Upload
+                        </button>
+                        <progress id='progress' value='0' max='100'></progress>
+                    </div>
+            </form>
+        </div>
+        <div class="col"></div>
+    </div>
+</html>
+
+{{ end }}

+ 12 - 0
pkg/webpages/html/upload_status.html

@@ -0,0 +1,12 @@
+{{ define "upload_status" }}
+<!DOCTYPE html>
+<html lang="en">
+    <div class="container-fluid row">
+        <div class="col">
+            <div class="col container h-2 p-2" style="background-color: rgb(22, 22, 22); color: {{ .Color }}; height: fit-content; font-size: larger; font-family: monospace;">
+                {{ .UpdateMessage }}
+            </div>
+        </div>
+    </div>
+</html>
+{{ end }}

+ 22 - 0
pkg/webpages/html/writing.html

@@ -0,0 +1,22 @@
+{{ define "writing" }}
+<div class="container-fluid row">
+    {{ range . }}
+        <div class="col hover-overlay" data-mdb-ripple-init data-mdb-ripple-color="light">
+            <div class="row position-relative shadow-lg p-3 m-3 rounded justify-content-center" style="width: 80vh; max-width: 95%; background-color: rgb(22, 22, 22);">
+                <div class="row" style="background-color: rgb(22, 22, 22); color: white; height: fit-content;font-family: monospace;">
+                    <p class="text-center">{{ .Title }}</p>
+                </div>
+                <div class="row" style="background-color: rgb(22, 22, 22); color: white; height: fit-content; font-family: monospace;">
+                    <p class="text-left">{{ .Created }}</p>
+                </div>
+                <div class="row" style="background-color: rgb(22, 22, 22); color: white; height: fit-content; font-family: monospace;">
+                    <p class="text-left">{{ .Sample }}</p>
+                </div>
+                <button hx-get="/writing/{{ .Ident }}" hx-target="#main">
+                    <div class="mask" style="background-color: hsla(0, 0%, 98%, 0.2)"></div>
+                </button>
+            </div>
+        </div>
+    {{ end }}
+</div>
+{{ end }}