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 cont = shows.filter(x => histClass(x) === "watching").slice(0, 6);
|
||||||
const hold = shows.filter(x => histClass(x) === "hold").slice(0, 4);
|
const hold = shows.filter(x => histClass(x) === "hold").slice(0, 4);
|
||||||
const done = shows.filter(x => histClass(x) === "done").slice(0, 6);
|
const done = shows.filter(x => histClass(x) === "done").slice(0, 6);
|
||||||
showSec("Continue watching", cont, [link("stats \u2192", "?stats"),
|
showSec("Continue watching", cont, [link("history \u2192", "?history")]);
|
||||||
link("history \u2192", "?history")]);
|
|
||||||
showSec("On hold", hold, hold.length ? [link("history \u2192", "?history")] : []);
|
showSec("On hold", hold, hold.length ? [link("history \u2192", "?history")] : []);
|
||||||
showSec("Recently finished", done, done.length ? [link("history \u2192", "?history")] : []);
|
showSec("Recently finished", done, done.length ? [link("history \u2192", "?history")] : []);
|
||||||
// 5. stats widget (compact, drill-down to ?stats)
|
// 5. stats line (compact; full breakdown at ?stats)
|
||||||
const sw = el("div", null);
|
|
||||||
const sh = el("div", "sec-head");
|
const sh = el("div", "sec-head");
|
||||||
sh.append(el("h2", null, "Stats \u00b7 30d"), link("see all \u2192", "?stats"));
|
sh.append(el("h2", null, "Stats \u00b7 30d"), link("see all \u2192", "?stats"),
|
||||||
const load = el("p", "muted", "loading\u2026");
|
link("history \u2192", "?history"));
|
||||||
sw.append(sh, load);
|
const sl = el("div", "muted", "loading\u2026");
|
||||||
main.append(sw);
|
main.append(sh, sl);
|
||||||
api("/api/stats?days=30").then(d => {
|
api("/api/stats?days=30").then(d => {
|
||||||
load.remove();
|
sl.textContent = `${fmtMin(d.watch_minutes)} watched \u00b7 ${d.episodes.started} eps` +
|
||||||
sw.append(statsCards(d));
|
` (${d.episodes.completed} finished) \u00b7 ${d.days_active} active days \u00b7` +
|
||||||
const ta = topAnime(d, 3);
|
` best streak ${d.best_streak}d \u00b7 ${d.on_hold} on hold`;
|
||||||
if (ta) sw.append(ta);
|
}).catch(() => sl.remove());
|
||||||
}).catch(() => load.remove());
|
|
||||||
// 5b. watch-time heatmap (past year, shared with ?stats)
|
// 5b. watch-time heatmap (past year, shared with ?stats)
|
||||||
main.append(heatSection());
|
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 ----------
|
// ---------- search ----------
|
||||||
|
|||||||
+4
-1
@@ -56,7 +56,8 @@ h2 { margin: 0.4rem 0; }
|
|||||||
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
|
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
|
||||||
.card.stat { padding: .8rem; gap: .2rem; }
|
.card.stat { padding: .8rem; gap: .2rem; }
|
||||||
.stat-value { font-size: 1.3rem; font-weight: 700; }
|
.stat-value { font-size: 1.3rem; font-weight: 700; }
|
||||||
.heat-wrap { overflow-x: auto; margin: .5rem 0 .3rem; }
|
.heat-wrap { overflow-x: auto; margin: .5rem 0 .3rem; background: var(--card);
|
||||||
|
border: 1px solid var(--bd); border-radius: 10px; padding: .7rem .8rem .5rem; }
|
||||||
.heat-lbl { display: flex; gap: 3px; margin-bottom: 2px; }
|
.heat-lbl { display: flex; gap: 3px; margin-bottom: 2px; }
|
||||||
.heat-lbl .heat-lab { width: 14px; font-size: .65rem; color: var(--muted); white-space: nowrap; }
|
.heat-lbl .heat-lab { width: 14px; font-size: .65rem; color: var(--muted); white-space: nowrap; }
|
||||||
.heat { display: flex; gap: 3px; }
|
.heat { display: flex; gap: 3px; }
|
||||||
@@ -139,6 +140,8 @@ button.tiny.on { border-color: var(--acc); color: var(--acc); }
|
|||||||
.crumb { display: inline-block; font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
|
.crumb { display: inline-block; font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
|
||||||
.crumb:hover { color: var(--acc); }
|
.crumb:hover { color: var(--acc); }
|
||||||
.sec-head { display: flex; align-items: baseline; gap: .8rem; }
|
.sec-head { display: flex; align-items: baseline; gap: .8rem; }
|
||||||
|
.sec-head h2 { font-size: .95rem; font-weight: 600; text-transform: uppercase;
|
||||||
|
letter-spacing: .06em; color: var(--muted); margin: 1.2rem 0 .4rem; }
|
||||||
.card.hist { position: relative; cursor: pointer; }
|
.card.hist { position: relative; cursor: pointer; }
|
||||||
.del { position: absolute; top: .35rem; right: .35rem; width: 1.5rem; height: 1.5rem;
|
.del { position: absolute; top: .35rem; right: .35rem; width: 1.5rem; height: 1.5rem;
|
||||||
border-radius: 50%; border: 1px solid var(--bd); background: rgba(14, 15, 19, .8);
|
border-radius: 50%; border: 1px solid var(--bd); background: rgba(14, 15, 19, .8);
|
||||||
|
|||||||
Reference in new issue
Block a user