Use hx-* attributes
This commit is contained in:
parent
ee3e5e82e4
commit
8aa72dbfa0
@ -29,17 +29,23 @@
|
||||
@apply pb-1;
|
||||
}
|
||||
|
||||
a {
|
||||
a,
|
||||
button[hx-get],
|
||||
button[hx-post] {
|
||||
text-decoration: underline;
|
||||
transition: background-color 150ms ease-in, color 150ms ease-in;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
a:hover,
|
||||
button[hx-get]:hover,
|
||||
button[hx-post]:hover {
|
||||
background-color: var(--color);
|
||||
color: var(--background-color);
|
||||
}
|
||||
|
||||
nav a {
|
||||
nav a,
|
||||
button[hx-get],
|
||||
button[hx-post] {
|
||||
padding: 0 0.25em;
|
||||
}
|
||||
|
||||
|
@ -7,9 +7,8 @@ templ About() {
|
||||
@components.Head()
|
||||
<body class="container">
|
||||
@components.Header()
|
||||
<div class="flex flex-col text-center">
|
||||
<div id="content" class="flex flex-col text-center">
|
||||
@components.Figlet("random", "about")
|
||||
</div>
|
||||
<div class="flex flex-col mb-3">
|
||||
<h1>📈 Prediction market?</h1>
|
||||
<p>Here is an animated corgi that explains everything you need to know about prediction markets in 7 minutes:</p>
|
||||
@ -69,6 +68,7 @@ templ About() {
|
||||
>nostr</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@components.Footer()
|
||||
</body>
|
||||
</html>
|
||||
|
@ -4,16 +4,16 @@ import c "git.ekzyis.com/ekzyis/delphi.market/server/router/context"
|
||||
|
||||
templ Header() {
|
||||
<header class="mt-3">
|
||||
<nav class="flex flex-row">
|
||||
<nav class="flex flex-row" hx-target="#content" hx-swap="outerHTML" hx-select="#content" hx-push-url="true">
|
||||
<div>
|
||||
<a href="/">home</a>
|
||||
<button hx-get="/">home</button>
|
||||
</div>
|
||||
<div class="ms-auto">
|
||||
<a href="/about">about</a>
|
||||
<button hx-get="/about">about</button>
|
||||
if ctx.Value(c.SessionContextKey) != nil {
|
||||
<a href="/user">user</a>
|
||||
<button hx-get="/user">user</button>
|
||||
} else {
|
||||
<a href="/login">login</a>
|
||||
<button hx-get="/login">login</button>
|
||||
}
|
||||
</div>
|
||||
</nav>
|
||||
|
@ -11,7 +11,7 @@ templ Error(code int) {
|
||||
@components.Head()
|
||||
<body class="container">
|
||||
@components.Header()
|
||||
<div class="flex flex-col text-center">
|
||||
<div id="content" class="flex flex-col text-center">
|
||||
@components.Figlet("random", strconv.Itoa(code))
|
||||
<div class="font-mono mb-3">{ http.StatusText(code) }</div>
|
||||
</div>
|
||||
|
@ -7,7 +7,7 @@ templ Index() {
|
||||
@components.Head()
|
||||
<body class="container">
|
||||
@components.Header()
|
||||
<div class="flex flex-col text-center">
|
||||
<div id="content" class="flex flex-col text-center">
|
||||
@components.Figlet("random", "delphi")
|
||||
<div class="font-mono my-3">A prediction market using the lightning network</div>
|
||||
</div>
|
||||
|
@ -7,9 +7,8 @@ templ Login() {
|
||||
@components.Head()
|
||||
<body class="container">
|
||||
@components.Header()
|
||||
<div class="flex flex-col text-center">
|
||||
<div id="content" class="flex flex-col text-center">
|
||||
@components.Figlet("random", "login")
|
||||
</div>
|
||||
<div class="flex flex-col mb-3 text-center">
|
||||
<button class="login lightning my-3">login with lightning</button>
|
||||
<button class="login nostr my-3">login with nostr</button>
|
||||
@ -17,6 +16,7 @@ templ Login() {
|
||||
<div class="flex flex-col mb-3 text-center">
|
||||
<small><a class="text-muted" href="/signup">new here?</a></small>
|
||||
</div>
|
||||
</div>
|
||||
@components.Footer()
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user