mavweb: ui design system refresh — shared nav, cards, component classes
- Rewrote ui.css with design tokens, card/btn/badge/dot components - All pages wrapped in <main class=page> with max-width container - Replaced inline <style> blocks with ui.css classes - passkey page now uses shared nav.site template - PWA voice page unified under shared nav.site (no more separate tab nav) - Inline lang toggle moved from nav to voice page body
This commit is contained in:
+9
-13
@@ -61,27 +61,23 @@ func newPasskeyHandle(cfg webauthn.Config, core ipc.CoreAPI, storePath string, s
|
||||
// enable a tool on /tools within that window.
|
||||
func (h *PasskeyHandle) Page(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
w.Write([]byte(passkeyPageHTML))
|
||||
passkeyTmpl.Execute(w, nil)
|
||||
}
|
||||
|
||||
// passkeyPageHTML — rendered via passkeyTmpl (main.go) which prepends navHTML.
|
||||
const passkeyPageHTML = `<!doctype html><meta charset=utf-8>
|
||||
<meta name=viewport content="width=device-width,initial-scale=1">
|
||||
<title>maven · passkey</title>
|
||||
<link rel=stylesheet href=/ui.css>
|
||||
<style>button{padding:.5rem 1rem;margin:.3rem .3rem 0 0}
|
||||
#msg{white-space:pre-wrap}</style>
|
||||
<nav class=site>
|
||||
<a href=/>voice</a> <a href=/dash>dash</a> <a href=/history>history</a>
|
||||
<a href=/trace>trace</a> <a href=/notifications>notifications</a>
|
||||
<a href=/tools>tools</a> <a href=/auth/passkey class=active>passkey</a>
|
||||
</nav>
|
||||
{{template "nav" "passkey"}}
|
||||
<main class=page>
|
||||
<h1>passkey</h1>
|
||||
<p>Enroll a passkey once, then assert it to unlock destructive actions
|
||||
(tool enable) for a few minutes.</p>
|
||||
<button onclick=enroll()>enroll passkey</button>
|
||||
<button onclick=assert()>assert (step-up)</button>
|
||||
<a href=/tools><button>→ tools</button></a>
|
||||
<p class=muted>Enroll a passkey once, then assert it to unlock destructive actions (tool enable) for a few minutes.</p>
|
||||
<button class=btn onclick=enroll()>enroll passkey</button>
|
||||
<button class=btn onclick=assert()>assert (step-up)</button>
|
||||
<a href=/tools><button class=btn-primary>→ tools</button></a>
|
||||
<div id=msg></div>
|
||||
</main>
|
||||
<script>
|
||||
const b64u=b=>btoa(String.fromCharCode(...new Uint8Array(b))).replace(/\+/g,'-').replace(/\//g,'_').replace(/=+$/,'');
|
||||
const ub64=s=>{s=s.replace(/-/g,'+').replace(/_/g,'/');const b=atob(s),a=new Uint8Array(b.length);for(let i=0;i<b.length;i++)a[i]=b.charCodeAt(i);return a;};
|
||||
|
||||
Reference in New Issue
Block a user