diff options
author | Grail Finder <wohilas@gmail.com> | 2025-03-29 11:12:53 +0300 |
---|---|---|
committer | Grail Finder <wohilas@gmail.com> | 2025-03-29 11:12:53 +0300 |
commit | 3921db6166e2da895257496bb76dd115556699d3 (patch) | |
tree | 1be4f739121761085f69cb7706c60dbbe98a93e9 /components |
init
Diffstat (limited to 'components')
-rw-r--r-- | components/auth.html | 22 | ||||
-rw-r--r-- | components/error.html | 9 | ||||
-rw-r--r-- | components/index.html | 28 |
3 files changed, 59 insertions, 0 deletions
diff --git a/components/auth.html b/components/auth.html new file mode 100644 index 0000000..5122919 --- /dev/null +++ b/components/auth.html @@ -0,0 +1,22 @@ +{{define "auth"}} +<div id="logindiv"> + <form class="space-y-6" hx-target="#ancestor" hx-swap="outerHTML"> + <div> + <label For="username" class="block text-sm font-medium leading-6 text-white-900">username</label> + <div class="mt-2"> + <input id="username" name="username" autocomplete="username" class="rounded-md text-center text-black" required /> + </div> + </div> + <div> + <label For="password" class="block text-sm font-medium leading-6 text-white-900">password</label> + <div class="mt-2"> + <input id="password" name="password" type="password" required class="rounded-md text-center text-black" /> + </div> + </div> + <div> + <button type="submit" hx-post="/login" class="justify-center rounded-md bg-indigo-600 px-3 py-1.5 text-sm font-semibold leading-6 text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">Log in</button> + <button type="submit" hx-post="/signup" class="justify-center rounded-md bg-indigo-600 px-3 py-1.5 text-sm font-semibold leading-6 text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">Sign up</button> + </div> + </form> +</div> +{{end}} diff --git a/components/error.html b/components/error.html new file mode 100644 index 0000000..2fe8b70 --- /dev/null +++ b/components/error.html @@ -0,0 +1,9 @@ +{{define "error"}} +<a href="/"> + <div id=errorbox class="bg-orange-100 border-l-4 border-orange-500 text-orange-700 p-4" role="alert"> + <p class="font-bold">An error from server</p> + <p>{{.}}</p> + <p>Click this banner to return to main page.</p> + </div> +</a> +{{end}} diff --git a/components/index.html b/components/index.html new file mode 100644 index 0000000..4562550 --- /dev/null +++ b/components/index.html @@ -0,0 +1,28 @@ +{{define "main"}} +<!DOCTYPE html> +<html> + <head> + <title>Action Points Journal</title> + <meta charset="utf-8" name="viewport" content="width=device-width,initial-scale=1"/> + <link rel="stylesheet" type="text/css" href="/assets/style.css" /> + <link rel="icon" sizes="64x64" href="/assets/favicon/wolfhead_negated.ico" /> + <script src="https://unpkg.com/htmx.org@1.9.11" integrity="sha384-0gxUXCCR8yv9FM2b+U3FDbsKthCI66oH5IA9fHppQq9DDMHuMauqq1ZHBpJxQ0J0" crossorigin="anonymous"></script> + </head> + <body> + <div id="ancestor"> + {{ if not .Username }} + <div> + {{ template "auth" }} + </div> + {{ else }} + <div> + hello user + </div> + <div> + some button + </div> + {{ end }} + </div> + </body> +</html> +{{end}} |