standalone
This commit is contained in:
@@ -12,19 +12,37 @@ func HomePage(w http.ResponseWriter, r *http.Request) {
|
||||
if n.Path == "/" {
|
||||
continue
|
||||
}
|
||||
label := n.Label
|
||||
badge := ""
|
||||
if n.Beta {
|
||||
label += ` <span style="font-size:10px;opacity:0.65;text-transform:uppercase;">Beta</span>`
|
||||
badge = ` <span class="beta-pill">Beta</span>`
|
||||
}
|
||||
items.WriteString(`<li><a href="` + n.Path + `" style="color:#9cdcfe;">` + label + `</a> — ` + n.Description + `</li>`)
|
||||
items.WriteString(`<a class="home-tool" href="` + n.Path + `"><span class="home-tool-title">` + n.Label + badge + `</span><span class="home-tool-desc">` + n.Description + `</span></a>`)
|
||||
}
|
||||
|
||||
body := `
|
||||
<h2>HPL Toolbox</h2>
|
||||
<p class="hint">Standalone build. Pick a tool from the top bar.</p>
|
||||
<ul style="line-height:1.9;">
|
||||
<header class="tool-header">
|
||||
<h2 class="tool-title">HPL Toolbox</h2>
|
||||
<p class="tool-description">Standalone build. Pick a tool to open.</p>
|
||||
</header>
|
||||
<div class="home-tools">
|
||||
` + items.String() + `
|
||||
</ul>
|
||||
</div>
|
||||
<style>
|
||||
.home-tools { display:flex; flex-direction:column; gap:8px; max-width:620px; }
|
||||
.home-tool {
|
||||
display:block;
|
||||
min-height:52px;
|
||||
padding:9px 11px;
|
||||
color:#ddd;
|
||||
text-decoration:none;
|
||||
background:#2a2d2e;
|
||||
border:1px solid #333;
|
||||
border-radius:5px;
|
||||
}
|
||||
.home-tool:hover { background:#33373a; border-color:#007fd4; }
|
||||
.home-tool-title { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12px; font-weight:600; }
|
||||
.home-tool-desc { display:block; margin-top:4px; color:#a7a7a7; font-size:11px; line-height:1.35; }
|
||||
</style>
|
||||
`
|
||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
_, _ = w.Write([]byte(Page("/", "Home", body)))
|
||||
|
||||
Reference in New Issue
Block a user