aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorhovertank3d <[email protected]>2025-01-18 23:27:52 +0100
committerhovertank3d <[email protected]>2025-01-18 23:28:53 +0100
commit1a5a86a5d4557200db20e20206bcdd7b9b2a7e55 (patch)
tree03aae452a7dc2d9f71cf7a83adbfd8e112ad562e /templates
parent2aa29060c81fb52884b290603f1cf930259443b9 (diff)
downloadlzcnt.space-1a5a86a5d4557200db20e20206bcdd7b9b2a7e55.tar.xz
lzcnt.space-1a5a86a5d4557200db20e20206bcdd7b9b2a7e55.zip
refactor and add /about
Diffstat (limited to 'templates')
-rw-r--r--templates/gen.go1
-rw-r--r--templates/index.html18
-rw-r--r--templates/link.html1
-rw-r--r--templates/log2.s.html11
-rw-r--r--templates/reset.html2
-rw-r--r--templates/source_code.html1
6 files changed, 17 insertions, 17 deletions
diff --git a/templates/gen.go b/templates/gen.go
index dbbaf24..0b5f5ab 100644
--- a/templates/gen.go
+++ b/templates/gen.go
@@ -1,3 +1,4 @@
package templates
//go:generate bash -c "cat ../log2.s | ../deps/genhl/genhl asmatt > log2.s.html"
+//go:generate bash -c "cat ../about.go | ../deps/genhl/genhl > about.go.html"
diff --git a/templates/index.html b/templates/index.html
index 85eccab..3ae5cf4 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -19,16 +19,26 @@
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<title>LZCNT</title>
-
- <form id="reset" action="/reset" method="get"></form>
</head>
+<style>
+ body {
+ background-color: rgb(22,22,22);
+ color: white;
+ }
+</style>
+
<body>
<div style="display: flex; justify-content: center;">
- <h2 style="text-align: center;"><code>LZCNT - Count the Number of Leading Zero Bits</code></h2>
+ <h2 style="text-align: center;"><code><a href="/">LZCNT</a> - {{.Title}}</code></h2>
</div>
<div style="width: fit-content; margin-left: auto; margin-right: auto;">
- {{template "log2.s.html" .}}
+ {{ if eq .Page "log2.s.html" }}
+ {{template "log2.s.html" .}}
+ {{ end }}
+ {{ if eq .Page "about.go.html"}}
+ {{template "about.go.html" .}}
+ {{ end }}
</div>
</body>
diff --git a/templates/link.html b/templates/link.html
new file mode 100644
index 0000000..9a43d43
--- /dev/null
+++ b/templates/link.html
@@ -0,0 +1 @@
+<a href="{{index . 1}}">[{{index . 0}}]</a> \ No newline at end of file
diff --git a/templates/log2.s.html b/templates/log2.s.html
deleted file mode 100644
index f2fb03b..0000000
--- a/templates/log2.s.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<style>.stx_root{color: rgb(255,255,255);background-color: rgb(33,33,33);}.stx2{color: rgb(220,150,28);font-weight: bold;}.stx3{color: rgb(181,120,206);}.stx4{color: rgb(70,70,240);}.stx5{color: rgb(254,254,91);font-weight: bold;}.stx6{color: rgb(115,158,213);font-weight: bold;}.stx7{color: rgb(24,212,236);}.stx8{color: rgb(139,15,127);font-weight: bold;}.stx9{color: rgb(11,84,118);}.stxa{color: rgb(31,145,31);font-weight: bold;}.stxb{color: rgb(0,0,0);}</style><div class="stx_root"><pre><code> <span class="stx8">.section</span> <span class="stx3">.text</span>
- <span class="stx8">.global</span> <span class="stx3">log2lzcnt</span>
- <span class="stx8">.type</span> <span class="stx3">log2lzcnt</span>, <span class="stx3">@function</span>
-<span class="stxa"># {{template "source_code.html" .}}
-</span><span class="stxa"># {{template "reset.html" .}}
-</span><span class="stx9">log2lzcnt:</span> <span class="stxa"># log2lzcnt({{.Requests}});
-</span> <span class="stx5">lzcnt</span> <span class="stx6">%rdi</span>, <span class="stx6">%rdi</span>
- <span class="stx5">movq</span> <span class="stx3">$63</span>, <span class="stx6">%rax</span>
- <span class="stx5">sub</span> <span class="stx6">%rdi</span>, <span class="stx6">%rax</span>
- <span class="stx5">ret</span> <span class="stxa"># 2^{{.Log2lzcnt}} requests handled
-</span></code></pre></div> \ No newline at end of file
diff --git a/templates/reset.html b/templates/reset.html
index 090b273..d6bfa7e 100644
--- a/templates/reset.html
+++ b/templates/reset.html
@@ -1 +1 @@
-<a href="javascript:{}" onclick="document.getElementById('reset').submit(); return false;">[reset counter]</a> \ No newline at end of file
+<a href="javascript:{}" onclick="document.getElementById('reset').submit(); return false;">[reset counter]</a><form id="reset" action="/reset" method="get"></form> \ No newline at end of file
diff --git a/templates/source_code.html b/templates/source_code.html
deleted file mode 100644
index 631c649..0000000
--- a/templates/source_code.html
+++ /dev/null
@@ -1 +0,0 @@
-<a href="https://github.com/hovertank3d/lzcnt.space">[source code]</a> \ No newline at end of file