Add figlet component

This commit is contained in:
ekzyis 2024-07-10 09:25:46 +02:00
parent 3a9d3ac9aa
commit a87ce02819
4 changed files with 18 additions and 31 deletions

View File

@ -1,9 +1,6 @@
package pages
import (
"git.ekzyis.com/ekzyis/delphi.market/lib"
"git.ekzyis.com/ekzyis/delphi.market/server/router/pages/components"
)
import "git.ekzyis.com/ekzyis/delphi.market/server/router/pages/components"
templ About() {
<html>
@ -11,13 +8,7 @@ templ About() {
<body class="container">
@components.Header()
<div class="flex flex-col text-center">
<code class="figlet">
<strong>
<pre>
{ lib.Figlet("random", "about") }
</pre>
</strong>
</code>
@components.Figlet("random", "about")
</div>
<div class="flex flex-col mb-3">
<h1>📈 Prediction market?</h1>

View File

@ -0,0 +1,13 @@
package components
import "git.ekzyis.com/ekzyis/delphi.market/lib"
templ Figlet(font string, text string) {
<code class="figlet">
<strong>
<pre>
{ lib.Figlet(font, text) }
</pre>
</strong>
</code>
}

View File

@ -1,7 +1,6 @@
package pages
import (
"git.ekzyis.com/ekzyis/delphi.market/lib"
"git.ekzyis.com/ekzyis/delphi.market/server/router/pages/components"
"net/http"
"strconv"
@ -13,13 +12,7 @@ templ Error(code int) {
<body class="container">
@components.Header()
<div class="flex flex-col text-center">
<code class="figlet">
<strong>
<pre>
{ lib.Figlet("random", strconv.Itoa(code)) }
</pre>
</strong>
</code>
@components.Figlet("random", strconv.Itoa(code))
<div class="font-mono mb-3">{ http.StatusText(code) }</div>
</div>
@components.Footer()

View File

@ -1,9 +1,6 @@
package pages
import (
"git.ekzyis.com/ekzyis/delphi.market/lib"
"git.ekzyis.com/ekzyis/delphi.market/server/router/pages/components"
)
import "git.ekzyis.com/ekzyis/delphi.market/server/router/pages/components"
templ Index() {
<html>
@ -11,14 +8,7 @@ templ Index() {
<body class="container">
@components.Header()
<div class="flex flex-col text-center">
<code class="figlet">
<strong>
<!-- need to escape backslashes or backtick here ... -->
<pre>
{ lib.Figlet("random", "delphi") }
</pre>
</strong>
</code>
@components.Figlet("random", "delphi")
<div class="font-mono my-3">A prediction market using the lightning network</div>
</div>
@components.Footer()