0.1.6 updates and add changelog

This commit is contained in:
2026-05-28 01:49:33 +08:00
parent 16847a78ca
commit afbf504957
14 changed files with 385 additions and 21 deletions

View File

@@ -31,9 +31,17 @@ const SharedCSS = `
padding: 8px 16px; background: #252526; border-bottom: 1px solid #333;
font-size: 13px;
}
.topbar a { color: #ddd; text-decoration: none; padding: 5px 10px; border-radius: 4px; }
.topbar a:hover { background: #2a2d2e; }
.topbar a.active { background: #094771; color: #fff; }
.topbar .nav-link {
background: transparent;
color: #ddd;
border: 0;
padding: 5px 10px;
border-radius: 4px;
cursor: pointer;
font: inherit;
}
.topbar .nav-link:hover { background: #2a2d2e; }
.topbar .nav-link.active { background: #094771; color: #fff; }
.beta-pill { margin-left: 4px; padding: 1px 4px; border: 1px solid #555; border-radius: 3px; font-size: 10px; opacity: 0.7; text-transform: uppercase; }
.topbar-spacer { margin-left: auto; }
.content { flex: 1; width: 100%; padding: 18px; max-width: 1100px; margin: 0 auto; }
@@ -42,15 +50,16 @@ const SharedCSS = `
max-width: 1100px;
margin: auto auto 0;
padding: 8px 18px 14px;
display: flex;
display: grid;
grid-template-columns: 1fr auto 1fr;
align-items: center;
justify-content: space-between;
gap: 8px;
color: #a7a7a7;
font-size: 10px;
border-top: 1px solid #333;
}
.beta-tools-toggle {
justify-self: start;
padding: 0;
background: transparent;
color: #a7a7a7;
@@ -58,9 +67,12 @@ const SharedCSS = `
cursor: pointer;
font: inherit;
opacity: 0.72;
text-align: left;
}
.beta-tools-toggle:hover { background: transparent; opacity: 1; text-decoration: underline; }
.app-footer-version { opacity: 0.75; text-align: right; }
.app-footer-version { opacity: 0.75; text-align: center; white-space: nowrap; }
.app-footer-link { justify-self: end; padding: 0; background: transparent; color: #a7a7a7; border: 0; cursor: pointer; font: inherit; opacity: 0.72; }
.app-footer-link:hover { background: transparent; opacity: 1; text-decoration: underline; }
h2 { margin: 0; font-size: 18px; line-height: 1.25; font-weight: 600; }
.tool-header { margin-bottom: var(--tool-gap-lg); }
.tool-title { margin: 0; font-size: 18px; line-height: 1.25; font-weight: 600; }
@@ -176,13 +188,13 @@ func Page(activePath, title, body string) string {
for _, n := range visibleNavItems(betaToolsEnabled) {
cls := ""
if n.Path == activePath {
cls = " class=\"active\""
cls = " active"
}
label := n.Label
if n.Beta {
label += `<span class="beta-pill">Beta</span>`
}
tabs.WriteString(`<a href="` + n.Path + `"` + cls + `>` + label + `</a>`)
tabs.WriteString(`<button type="button" class="nav-link` + cls + `" data-path="` + n.Path + `">` + label + `</button>`)
}
betaButtonLabel := "Show beta"
@@ -201,8 +213,15 @@ func Page(activePath, title, body string) string {
<div class="app-footer">
<button id="betaToolsToggle" class="beta-tools-toggle" data-enabled="` + boolAttr(betaToolsEnabled) + `">` + betaButtonLabel + `</button>
<span class="app-footer-version">` + AppVersion + ` - JJGC 00784</span>
<button type="button" class="app-footer-link" data-path="/changelog">Changelog</button>
</div>
<script>
document.querySelectorAll('[data-path]').forEach((element) => {
element.addEventListener('click', () => {
const path = element.dataset.path;
if (path) window.location.href = path;
});
});
document.getElementById('betaToolsToggle').addEventListener('click', async (event) => {
const enabled = event.currentTarget.dataset.enabled === 'true';
await fetch('/api/betaTools', {