Home: declutter (keep hero, board, heatmap)
- drop the history widget: the status board already groups the same shows by state; full list stays at ?history - 6 stat cards + top-3 -> one muted line (watch time, eps, active days, streak, on hold) with 'see all ->' to ?stats - section headers now small uppercase muted labels so the hero is the only loud element (page h2s unaffected) - heatmap sits in a rounded card panel
This commit is contained in:
1 parent
59df3c37c8
commit
2f68218a8f
2 files changed
+14
-18
No files matched your search
+10
-17
@@ -168,29 +168,22 @@ function showHome() {
|
||||
const cont = shows.filter(x => histClass(x) === "watching").slice(0, 6);
|
||||
const hold = shows.filter(x => histClass(x) === "hold").slice(0, 4);
|
||||
const done = shows.filter(x => histClass(x) === "done").slice(0, 6);
|
||||
showSec("Continue watching", cont, [link("stats \u2192", "?stats"),
|
||||
link("history \u2192", "?history")]);
|
||||
showSec("Continue watching", cont, [link("history \u2192", "?history")]);
|
||||
showSec("On hold", hold, hold.length ? [link("history \u2192", "?history")] : []);
|
||||
showSec("Recently finished", done, done.length ? [link("history \u2192", "?history")] : []);
|
||||
// 5. stats widget (compact, drill-down to ?stats)
|
||||
const sw = el("div", null);
|
||||
// 5. stats line (compact; full breakdown at ?stats)
|
||||
const sh = el("div", "sec-head");
|
||||
sh.append(el("h2", null, "Stats \u00b7 30d"), link("see all \u2192", "?stats"));
|
||||
const load = el("p", "muted", "loading\u2026");
|
||||
sw.append(sh, load);
|
||||
main.append(sw);
|
||||
sh.append(el("h2", null, "Stats \u00b7 30d"), link("see all \u2192", "?stats"),
|
||||
link("history \u2192", "?history"));
|
||||
const sl = el("div", "muted", "loading\u2026");
|
||||
main.append(sh, sl);
|
||||
api("/api/stats?days=30").then(d => {
|
||||
load.remove();
|
||||
sw.append(statsCards(d));
|
||||
const ta = topAnime(d, 3);
|
||||
if (ta) sw.append(ta);
|
||||
}).catch(() => load.remove());
|
||||
sl.textContent = `${fmtMin(d.watch_minutes)} watched \u00b7 ${d.episodes.started} eps` +
|
||||
` (${d.episodes.completed} finished) \u00b7 ${d.days_active} active days \u00b7` +
|
||||
` best streak ${d.best_streak}d \u00b7 ${d.on_hold} on hold`;
|
||||
}).catch(() => sl.remove());
|
||||
// 5b. watch-time heatmap (past year, shared with ?stats)
|
||||
main.append(heatSection());
|
||||
// 6. history widget (data already loaded, capped at 6)
|
||||
const hh = el("div", "sec-head");
|
||||
hh.append(el("h2", null, "History"), link(`all ${history.length} \u2192`, "?history"));
|
||||
main.append(hh, ...histBoard(history, 6));
|
||||
}
|
||||
|
||||
// ---------- search ----------
|
||||
|
||||
Reference in new issue
Block a user