ac3ee9b298
Implements the **Cinder** design (Claude Design doc `cfa39183`) across both UI surfaces, self-hosts the fonts it depends on, and writes down the two documents that keep the result maintainable. ## What changed **Web UI** — rebuilt on the design's visual language: editorial serif, containerless sheets divided by ash hairlines, one 760px measure, no radii and no shadows. The organising rule is that *heat is typographic*: only a series with an unread chapter is crimson (title on an ember underline, cover foot rule, `Ch N out`, play icon), and favourites get brass rather than borrowing the accent. Both states hang off two classes on the `<article>` (`is-new`, `is-dim`), so sub-elements inherit the state instead of re-deriving it. The six-cell action strip is `flex-basis: 100%` inside the row, which is what lets one piece of markup be a full-width strip with 46px thumb targets on a phone and a group of 40px squares beside the row on a desktop — no duplicate template branches. Icons moved to a sprite (`templates/icons.html`); htmx-swapped cards reference the page's symbols, so a row no longer carries a screenful of inline SVG. **Userscript panel** — repainted in the same tokens. The panel and the web UI are the same product on the same phone, and the old purple-on-charcoal panel read as a different application once the web UI moved. Structure, ids and classes are untouched, and the edge tab keeps its geometry, `touch-action` and `#hit` sizing. **Fonts are self-hosted** — five latin-subset woff2 files (~120 KB) embedded via the existing `//go:embed static`. Loading them from Google would lose the design's character exactly where it is used most: Bromite users routinely block Google's font domains, and the backend is reachable over a LAN with no internet route. `staticHandler` registers the `.woff2` MIME type, which Go's table lacks and the scratch image has no `/etc/mime.types` for. **Docs** — `docs/design-system.md` records the rules a stylesheet cannot state (what the ember is reserved for, why light mode is a re-tuning rather than an inversion, which details are load-bearing) so a future agent does not re-derive them from the CSS. `REDEPLOY.md` covers the operation actually performed every time, which `DEPLOY.md` reduced to two lines. ## Commits Each is one logical change and builds on its own: | | | |---|---| | `4d69e54` | `listView.NewCount` — data for the Updated badge, no markup | | `e940b96` | Web UI rebuilt on Cinder (CSS, templates, sprite, `filter.js`) | | `686fcc1` | Userscript panel repainted in the same tokens | | `ce7e93d` | Self-hosted webfonts + `.woff2` MIME registration | | `a547cc9` | `docs/design-system.md` | | `b20ecf1` | `REDEPLOY.md` | ## Verification - `go test ./...` — 187 pass. Userscript logic tests — 14 pass. - Screenshotted at 390px and 1180px, in dark and light, across All / Archived / Finished / empty / chapter-form / confirm-row. - Fonts: a run with `fonts.googleapis.com` and `fonts.gstatic.com` blocked still reports all five faces `loaded`; served as `200 font/woff2`. - The three `REDEPLOY.md` backup/restore commands were run, not assumed. `:ro` on the source volume fails (`unable to open database file` — WAL needs to create `-shm`), and a restored file lands root-owned while the container runs as uid 65532, so reads succeed and writes fail. Both are documented with the reason. ## Note for the reviewer The panel restyle is token-level only: the design doc covers the web UI, so the panel's *structure* has no reference to follow and was deliberately left alone. Deploying this needs a rebuild — templates, CSS and fonts are `//go:embed`ed, so pulling alone changes nothing. Reviewed-on: #10 Co-authored-by: Sulthan Zaki <sultankiki05@gmail.com> Co-committed-by: Sulthan Zaki <sultankiki05@gmail.com>
115 lines
5.6 KiB
HTML
115 lines
5.6 KiB
HTML
{{define "card"}}
|
|
{{/* One sheet per series. is-new turns the title crimson over an ember rule;
|
|
is-dim sinks archived and finished rows into italic grey. */}}
|
|
<article class="card{{if eq .Status "reading"}}{{if .HasNewChapter}} is-new{{end}}{{else}} is-dim{{end}}"
|
|
id="card-{{.Key}}" data-title="{{.Title}}">
|
|
<div class="row">
|
|
<a class="cover" href="{{.ContinueURL}}" target="_blank" rel="noopener noreferrer"
|
|
tabindex="-1" aria-hidden="true">
|
|
{{if .Cover}}<img src="{{.Cover}}" alt="" loading="lazy">
|
|
{{else}}<span class="monogram">{{.Initial}}</span>{{end}}
|
|
{{if and (eq .Status "reading") .HasNewChapter}}<span class="foot-rule"></span>
|
|
{{else if .Favorite}}<span class="foot-rule brass"></span>{{end}}
|
|
</a>
|
|
<div class="body">
|
|
<div class="title-line">
|
|
<h3 class="title">{{.Title}}</h3>
|
|
{{if .Favorite}}
|
|
<svg class="fav-mark" viewBox="0 0 24 24" aria-label="Favourite" role="img"><use href="#i-star-on"/></svg>
|
|
{{end}}
|
|
</div>
|
|
<p class="meta">
|
|
<span class="site-{{.Site}}">{{.Site}}</span>
|
|
<span class="sep">/</span>
|
|
<span class="chapter">Ch {{.LastChapter}}</span>
|
|
{{if and (eq .Status "reading") .HasNewChapter}}
|
|
<span class="sep">/</span>
|
|
<span class="new-chapter">Ch {{.LatestChapter}} out</span>
|
|
{{end}}
|
|
{{if eq .Status "archived"}}
|
|
<span class="sep">/</span>
|
|
<span class="state">archived</span>
|
|
{{else if eq .Status "finished"}}
|
|
<span class="sep">/</span>
|
|
<span class="state"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-check"/></svg>finished</span>
|
|
{{end}}
|
|
</p>
|
|
</div>
|
|
<div class="actions">
|
|
<a class="play" href="{{.ContinueURL}}" target="_blank" rel="noopener noreferrer"
|
|
title="Continue reading" aria-label="Continue reading">
|
|
<svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-play"/></svg>
|
|
</a>
|
|
<button class="{{if .Favorite}}on{{end}}"
|
|
title="{{if .Favorite}}Remove from favourites{{else}}Add to favourites{{end}}"
|
|
aria-label="Toggle favourite"
|
|
hx-post="/ui/bookmarks/{{.Key}}/favorite"
|
|
hx-target="[id='card-{{.Key}}']" hx-swap="outerHTML"
|
|
hx-indicator="[id='card-{{.Key}}']" hx-disabled-elt="this">
|
|
<svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-star{{if .Favorite}}-on{{end}}"/></svg>
|
|
</button>
|
|
<button class="pencil" title="Set chapter" aria-label="Set chapter"
|
|
onclick="toggleChapterForm('{{.Key}}')">
|
|
<svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-pencil"/></svg>
|
|
</button>
|
|
{{if eq .Status "finished"}}
|
|
<button class="restore" title="Restore to reading" aria-label="Restore to reading"
|
|
hx-post="/ui/bookmarks/{{.Key}}/status" hx-vals='{"status":"reading"}'
|
|
hx-target="[id='card-{{.Key}}']" hx-swap="outerHTML"
|
|
hx-indicator="[id='card-{{.Key}}']" hx-disabled-elt="this">
|
|
<svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-undo"/></svg>
|
|
</button>
|
|
{{else}}
|
|
{{if eq .Status "archived"}}
|
|
<button class="restore" title="Restore to reading" aria-label="Restore to reading"
|
|
hx-post="/ui/bookmarks/{{.Key}}/status" hx-vals='{"status":"reading"}'
|
|
hx-target="[id='card-{{.Key}}']" hx-swap="outerHTML"
|
|
hx-indicator="[id='card-{{.Key}}']" hx-disabled-elt="this">
|
|
<svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-undo"/></svg>
|
|
</button>
|
|
{{else}}
|
|
<button title="Archive" aria-label="Archive"
|
|
hx-post="/ui/bookmarks/{{.Key}}/status" hx-vals='{"status":"archived"}'
|
|
hx-target="[id='card-{{.Key}}']" hx-swap="outerHTML"
|
|
hx-indicator="[id='card-{{.Key}}']" hx-disabled-elt="this">
|
|
<svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-box"/></svg>
|
|
</button>
|
|
{{end}}
|
|
<button title="Mark finished" aria-label="Mark finished"
|
|
hx-post="/ui/bookmarks/{{.Key}}/status" hx-vals='{"status":"finished"}'
|
|
hx-target="[id='card-{{.Key}}']" hx-swap="outerHTML"
|
|
hx-indicator="[id='card-{{.Key}}']" hx-disabled-elt="this">
|
|
<svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-check"/></svg>
|
|
</button>
|
|
{{end}}
|
|
<button class="remove" title="Remove" aria-label="Remove"
|
|
onclick="toggleConfirmRow('{{.Key}}')">
|
|
<svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-trash"/></svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<form class="chapter-form" id="chapter-form-{{.Key}}" hidden
|
|
hx-post="/ui/bookmarks/{{.Key}}/chapter"
|
|
hx-target="[id='card-{{.Key}}']" hx-swap="outerHTML"
|
|
hx-indicator="[id='card-{{.Key}}']" hx-disabled-elt="input, button">
|
|
{{if .LatestChapter}}<p class="hint">Latest known: Ch {{.LatestChapter}}</p>{{end}}
|
|
<div class="field">
|
|
<input name="chapter" type="number" step="0.1" min="0"
|
|
value="{{.LastChapterNum}}" aria-label="Chapter number" required>
|
|
<button type="submit">Save</button>
|
|
</div>
|
|
</form>
|
|
<div class="confirm-row" id="confirm-row-{{.Key}}" hidden>
|
|
<span>Remove this?</span>
|
|
<div>
|
|
<button class="danger-solid"
|
|
hx-delete="/ui/bookmarks/{{.Key}}"
|
|
hx-target="[id='card-{{.Key}}']" hx-swap="outerHTML"
|
|
hx-indicator="[id='card-{{.Key}}']" hx-disabled-elt="this">Remove</button>
|
|
<button type="button" onclick="toggleConfirmRow('{{.Key}}')">Cancel</button>
|
|
</div>
|
|
</div>
|
|
<p class="error-inline" hidden></p>
|
|
</article>
|
|
{{end}}
|