initial version
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<svg width="135" height="140" viewBox="0 0 135 140" xmlns="http://www.w3.org/2000/svg" fill="#fff">
|
||||
<rect y="10" width="15" height="120" rx="6">
|
||||
<animate attributeName="height"
|
||||
begin="0.5s" dur="1s"
|
||||
values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
<animate attributeName="y"
|
||||
begin="0.5s" dur="1s"
|
||||
values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
</rect>
|
||||
<rect x="30" y="10" width="15" height="120" rx="6">
|
||||
<animate attributeName="height"
|
||||
begin="0.25s" dur="1s"
|
||||
values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
<animate attributeName="y"
|
||||
begin="0.25s" dur="1s"
|
||||
values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
</rect>
|
||||
<rect x="60" width="15" height="140" rx="6">
|
||||
<animate attributeName="height"
|
||||
begin="0s" dur="1s"
|
||||
values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
<animate attributeName="y"
|
||||
begin="0s" dur="1s"
|
||||
values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
</rect>
|
||||
<rect x="90" y="10" width="15" height="120" rx="6">
|
||||
<animate attributeName="height"
|
||||
begin="0.25s" dur="1s"
|
||||
values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
<animate attributeName="y"
|
||||
begin="0.25s" dur="1s"
|
||||
values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
</rect>
|
||||
<rect x="120" y="10" width="15" height="120" rx="6">
|
||||
<animate attributeName="height"
|
||||
begin="0.5s" dur="1s"
|
||||
values="120;110;100;90;80;70;60;50;40;140;120" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
<animate attributeName="y"
|
||||
begin="0.5s" dur="1s"
|
||||
values="10;15;20;25;30;35;40;45;50;0;10" calcMode="linear"
|
||||
repeatCount="indefinite" />
|
||||
</rect>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
@@ -0,0 +1,6 @@
|
||||
package frontend
|
||||
|
||||
import "embed"
|
||||
|
||||
//go:embed templates/*
|
||||
var Frontend embed.FS
|
||||
@@ -0,0 +1,12 @@
|
||||
.indicator {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.htmx-request .indicator {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 9999;
|
||||
display: block;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{{ define "index" }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="https://cdn.jsdelivr.net/npm/daisyui@4.6.0/dist/full.min.css" rel="stylesheet" type="text/css" />
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script src="https://unpkg.com/htmx.org@latest"></script>
|
||||
<script src="https://unpkg.com/htmx.org@latest/dist/ext/client-side-templates.js"></script>
|
||||
<script src="https://unpkg.com/mustache@latest"></script>
|
||||
<link rel="stylesheet" href="/css/custom.css">
|
||||
<title>HTMX Test</title>
|
||||
</head>
|
||||
|
||||
<body class="bg-[#a600f9] min-h-screen text-center text-white">
|
||||
<div id="app">
|
||||
<button class="btn btn-accent text-black text-2xl m-8" hx-disabled-elt="this" hx-get="/users"
|
||||
hx-swap="innerHTML transition:true" hx-indicator="#indicator" hx-target="#content">Get
|
||||
list of users</button>
|
||||
</div>
|
||||
|
||||
<div id="indicator">
|
||||
<img src="/assets/bars.svg" alt="Loading..." class="h-12 w-12 mx-auto indicator">
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,5 @@
|
||||
{{ define "init_page" }}
|
||||
<p>Init page</p>
|
||||
<button class="btn btn-accent" hx-get="/users" hx-swap="outerHTML" hx-target="#content">Get
|
||||
list of users</button>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,6 @@
|
||||
{{ define "users" }}
|
||||
<h1 class="text-3xl mb-8">Users</h1>
|
||||
<ul>
|
||||
{{ range .Users }}<li class="italic hover:font-bold">{{ .FirstName }}, {{ .Age }} years old</li>{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user