summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/base.html12
-rw-r--r--templates/chars.html20
-rw-r--r--templates/img.html13
-rw-r--r--templates/imgs_stub.html1
-rw-r--r--templates/index.html6
-rw-r--r--templates/meltees.html14
-rw-r--r--templates/sets.html20
7 files changed, 86 insertions, 0 deletions
diff --git a/templates/base.html b/templates/base.html
new file mode 100644
index 0000000..64db6b5
--- /dev/null
+++ b/templates/base.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+ <script src="/static/htmx-2.0.4.min.js"></script>
+ <link rel="stylesheet" href="/static/style.css">
+ <title>{{block "title" .}}{{end}} - grimg</title>
+ </head>
+ <body>
+ {{block "content" .}}{{end}}
+ </body>
+</html>
diff --git a/templates/chars.html b/templates/chars.html
new file mode 100644
index 0000000..bc6e233
--- /dev/null
+++ b/templates/chars.html
@@ -0,0 +1,20 @@
+{{define "title"}}Characters{{end}}
+{{define "content"}}
+<ul>
+ <li>
+ <a href="/">
+ <div>
+ ..
+ </div>
+ </a>
+ {{range .Items}}
+ <li>
+ <a href="/chars/sets?meltee={{$.Meltee}}&char={{.Name}}">
+ <div>
+ {{.Name}}
+ </div>
+ </a>
+ </li>
+ {{end}}
+</ul>
+{{end}}
diff --git a/templates/img.html b/templates/img.html
new file mode 100644
index 0000000..27bd439
--- /dev/null
+++ b/templates/img.html
@@ -0,0 +1,13 @@
+{{define "imgs"}}
+{{range $index, $value := .Imgs}}
+{{ if and (not $.IsLastPage) (isLast $index $.Imgs) }}
+<div class="img" hx-get="/imgs?page={{$.Page}}&meltee={{$.Meltee}}&char={{$.Char}}&set={{$.Set}}" hx-trigger="revealed" hx-swap="afterend" src="/{{$value.Path}}" alt="{{$value.Name}}">
+{{else}}
+<div class="img">
+{{end}}
+<a href="/{{$value.Path}}" target="_blank">
+<img src="/{{$value.Path}}" alt="{{$value.Name}}">
+</a>
+</div>
+{{end}}
+{{end}}
diff --git a/templates/imgs_stub.html b/templates/imgs_stub.html
new file mode 100644
index 0000000..a236257
--- /dev/null
+++ b/templates/imgs_stub.html
@@ -0,0 +1 @@
+{{template "imgs" .}}
diff --git a/templates/index.html b/templates/index.html
new file mode 100644
index 0000000..0028515
--- /dev/null
+++ b/templates/index.html
@@ -0,0 +1,6 @@
+{{define "title"}}Images{{end}}
+{{define "content"}}
+<div id="container">
+ {{template "imgs" .}}
+</div>
+{{end}}
diff --git a/templates/meltees.html b/templates/meltees.html
new file mode 100644
index 0000000..32a6a0e
--- /dev/null
+++ b/templates/meltees.html
@@ -0,0 +1,14 @@
+{{define "title"}}Meltees{{end}}
+{{define "content"}}
+<ul>
+ {{range .}}
+ <li>
+ <a href="/chars?meltee={{.Name}}">
+ <div>
+ {{.Name}}
+ </div>
+ </a>
+ </li>
+ {{end}}
+</ul>
+{{end}}
diff --git a/templates/sets.html b/templates/sets.html
new file mode 100644
index 0000000..70135a0
--- /dev/null
+++ b/templates/sets.html
@@ -0,0 +1,20 @@
+{{define "title"}}Sets{{end}}
+{{define "content"}}
+<ul>
+ <li>
+ <a href="/chars?meltee={{$.Meltee}}">
+ <div>
+ ..
+ </div>
+ </a>
+ {{range .Items}}
+ <li>
+ <a href="/chars/sets/imgs?meltee={{$.Meltee}}&char={{$.Char}}&set={{.Name}}">
+ <div>
+ {{.Name}}
+ </div>
+ </a>
+ </li>
+ {{end}}
+</ul>
+{{end}}