feat(ui): brand mark logo in the web UI, panel, and favicon

The mark is the same drawing in three places with three different
colour sources: /static/logo.svg carries a fixed palette because a
favicon has no page to inherit from, the {{define "mark"}} block takes
--ink/--ember so it flips with the theme, and the userscript copy lives
inside the shadow root next to the tokens it uses.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-31 17:12:53 +07:00
parent 42b93dc155
commit 51839762e7
7 changed files with 94 additions and 6 deletions
+23
View File
@@ -0,0 +1,23 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 172" role="img" aria-label="mangaBookmark">
<title>mangaBookmark</title>
<g fill="#100f0e" stroke="#f2ece5" stroke-width="5" stroke-linejoin="round" stroke-linecap="round">
<path fill="none" d="M28 36H4v114h192V36h-24"></path>
<path fill="none" d="M28 23H17v127h166V23h-11"></path>
<g id="mb-half">
<path d="M28 7 88 55v97L28 138z"></path>
<g fill="#f2ece5" stroke="none">
<path d="M37 25 55 39v41L37 66z"></path>
<path d="M60 42 79 57v42L60 84z"></path>
<path d="M37 75 79 108v13L37 88z"></path>
<path d="M37 98 79 129v11L37 131z"></path>
</g>
</g>
<use href="#mb-half" transform="matrix(-1 0 0 1 200 0)"></use>
<g stroke="#e0452c">
<path d="M100 4l9 5v11l-9 5-9-5V9z"></path>
<path d="M94 24h12v24H94z"></path>
<path d="M70 47h60v14H70z"></path>
<path d="M91 61h18v87l-9 20-9-20z"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 973 B

+9 -1
View File
@@ -197,14 +197,21 @@ button { cursor: pointer; }
/* ---- brand + chrome ---- */
.brand {
margin: 0;
display: flex;
align-items: center;
gap: 10px;
font: 400 26px/1 var(--font-display);
color: var(--paper);
}
.brand em { color: var(--ember); font-style: italic; }
.brand .mark { width: 30px; height: 26px; flex: none; overflow: visible; }
/* The line art is drawn at a 5px stroke on a 200-unit grid; at brand size that
thins out, so it is nudged up rather than scaled down blindly. */
.brand .mark g { stroke-width: 6.5; }
.topbar {
display: flex;
align-items: baseline;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 22px 20px 14px;
@@ -745,6 +752,7 @@ button { cursor: pointer; }
:root { --cover-w: 80px; --row-gap: 20px; }
.topbar { padding: 26px 32px 18px; }
.brand { font-size: 30px; }
.brand .mark { width: 35px; height: 30px; }
.chrome {
flex-direction: row;
+2 -1
View File
@@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="color-scheme" content="dark light">
<title>mangaBookmark</title>
<link rel="icon" href="/static/logo.svg" type="image/svg+xml">
<link rel="stylesheet" href="/static/style.css">
<link rel="preload" href="/static/fonts/instrument-serif-400-latin.woff2" as="font" type="font/woff2" crossorigin>
{{/* Body text before meta lines: DM Sans is the biggest face and the one
@@ -18,7 +19,7 @@
{{template "icons" .}}
<div class="sheet">
<header class="topbar">
<h1 class="brand">manga<em>Bookmark</em></h1>
<h1 class="brand">{{template "mark" .}}<span>manga<em>Bookmark</em></span></h1>
<form method="post" action="/logout">
<button type="submit" class="ghost">Log out</button>
</form>
+27
View File
@@ -48,4 +48,31 @@
</div>
{{end}}
{{/* The brand mark, inline so it takes the page's ink and ember rather than the
fixed palette of /static/logo.svg (which the favicon needs). */}}
{{define "mark"}}
<svg class="mark" viewBox="0 0 200 172" aria-hidden="true">
<g fill="var(--ink)" stroke="currentColor" stroke-width="5" stroke-linejoin="round" stroke-linecap="round">
<path fill="none" d="M28 36H4v114h192V36h-24"></path>
<path fill="none" d="M28 23H17v127h166V23h-11"></path>
<g id="mb-half">
<path d="M28 7 88 55v97L28 138z"></path>
<g fill="currentColor" stroke="none">
<path d="M37 25 55 39v41L37 66z"></path>
<path d="M60 42 79 57v42L60 84z"></path>
<path d="M37 75 79 108v13L37 88z"></path>
<path d="M37 98 79 129v11L37 131z"></path>
</g>
</g>
<use href="#mb-half" transform="matrix(-1 0 0 1 200 0)"></use>
<g stroke="var(--ember)">
<path d="M100 4l9 5v11l-9 5-9-5V9z"></path>
<path d="M94 24h12v24H94z"></path>
<path d="M70 47h60v14H70z"></path>
<path d="M91 61h18v87l-9 20-9-20z"></path>
</g>
</g>
</svg>
{{end}}
{{define "newcount"}}<span class="count" id="new-count"{{if .OOB}} hx-swap-oob="true"{{end}}{{if not .NewCount}} hidden{{end}}>{{.NewCount}}</span>{{end}}
+2 -1
View File
@@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="color-scheme" content="dark light">
<title>mangaBookmark</title>
<link rel="icon" href="/static/logo.svg" type="image/svg+xml">
<link rel="stylesheet" href="/static/style.css">
<link rel="preload" href="/static/fonts/instrument-serif-400-latin.woff2" as="font" type="font/woff2" crossorigin>
</head>
@@ -13,7 +14,7 @@
<main class="login-card">
<div>
<span class="eyebrow">Private library</span>
<h1>manga<em>Bookmark</em></h1>
<h1 class="brand">{{template "mark" .}}<span>manga<em>Bookmark</em></span></h1>
</div>
<form method="post" action="/login">
<div>
+1 -1
View File
@@ -189,7 +189,7 @@ func TestBookmarksAPIStillBearerOnly(t *testing.T) {
func TestStaticAssetsServed(t *testing.T) {
srv, _ := newWebTestServer(t, webConfig())
for _, path := range []string{"/static/style.css", "/static/htmx.min.js", "/static/filter.js"} {
for _, path := range []string{"/static/style.css", "/static/htmx.min.js", "/static/filter.js", "/static/logo.svg"} {
rr := httptest.NewRecorder()
srv.ServeHTTP(rr, httptest.NewRequest(http.MethodGet, path, nil))
if rr.Code != http.StatusOK {
+30 -2
View File
@@ -1383,7 +1383,31 @@
<div id="backdrop"></div>
<aside id="panel" role="dialog" aria-label="Manga bookmarks">
<header>
<span>manga<em>Bookmark</em></span>
<span class="brand">
<svg class="mark" viewBox="0 0 200 172" aria-hidden="true">
<g fill="var(--ink)" stroke="currentColor" stroke-width="6.5" stroke-linejoin="round" stroke-linecap="round">
<path fill="none" d="M28 36H4v114h192V36h-24"></path>
<path fill="none" d="M28 23H17v127h166V23h-11"></path>
<g id="mb-half">
<path d="M28 7 88 55v97L28 138z"></path>
<g fill="currentColor" stroke="none">
<path d="M37 25 55 39v41L37 66z"></path>
<path d="M60 42 79 57v42L60 84z"></path>
<path d="M37 75 79 108v13L37 88z"></path>
<path d="M37 98 79 129v11L37 131z"></path>
</g>
</g>
<use href="#mb-half" transform="matrix(-1 0 0 1 200 0)"></use>
<g stroke="var(--ember)">
<path d="M100 4l9 5v11l-9 5-9-5V9z"></path>
<path d="M94 24h12v24H94z"></path>
<path d="M70 47h60v14H70z"></path>
<path d="M91 61h18v87l-9 20-9-20z"></path>
</g>
</g>
</svg>
<span>manga<em>Bookmark</em></span>
</span>
<button id="closeBtn" aria-label="Close">close</button>
</header>
<div id="nav">
@@ -1458,11 +1482,15 @@
}
#panel.open { transform: translateX(0); }
header {
display: flex; align-items: baseline; justify-content: space-between;
display: flex; align-items: center; justify-content: space-between;
padding: 16px; border-bottom: 1px solid var(--rule);
font: 400 22px/1 var(--font-display); color: var(--paper);
}
header em { color: var(--ember); font-style: italic; }
.brand { display: flex; align-items: center; gap: 9px; }
/* 5px stroke on a 200-unit grid thins out at this size: the markup carries
6.5 instead. overflow visible keeps the topmost blade pip from clipping. */
.mark { width: 26px; height: 22px; flex: none; overflow: visible; }
#closeBtn {
background: none; border: none; color: var(--mute); cursor: pointer;
font: 500 10px var(--font-mono); letter-spacing: .12em; text-transform: uppercase;