home polish: continue-watching hero, progress bars, posters, time-ago

- showHome(): most recent entry renders as a hero card (poster,
  episode/lang/position, progress bar, Resume); the rest become
  mini poster cards with progress + relative timestamp
- history entries now persist dur (video.duration) and poster;
  /api/anime returns poster (parsed from the details page)
- old entries without dur render without a bar (backward compatible)
- browser test asserts the seeded entry, not a section header that
  only existed via a cross-test side effect
This commit is contained in:
jozamudi committed 2026-08-19 17:01:04 +00:00
1 parent e0f5427002
commit 2efb537edc
4 files changed
+89 -12

No files matched your search

+24 -1
View File
@@ -30,6 +30,30 @@ h2 { margin: 0.4rem 0; }
.card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: #000; display: block; }
.card-name { padding: 0.5rem; font-size: 0.85rem; color: var(--muted); }
/* home: continue-watching hero + mini history cards */
.hero-sec { display: grid; grid-template-columns: 170px 1fr;
grid-template-areas: "img right"; gap: 1rem; margin-bottom: 1.4rem;
background: var(--card); border: 1px solid var(--bd); border-radius: 12px; padding: 1rem; }
.hero { display: contents; }
.hero img { grid-area: img; width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px; background: #000; }
.right { grid-area: right; display: flex; flex-direction: column; justify-content: space-between;
gap: .45rem; min-width: 0; }
.hero-body { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.hero-kicker { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--acc); }
.hero-body h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn { align-self: start; padding: .45rem 1.1rem; border-radius: 8px;
border: 1px solid var(--acc); background: var(--acc); color: #140b02; font-weight: 600; cursor: pointer; }
.bar { height: 5px; border-radius: 3px; background: var(--bd); overflow: hidden; }
.bar-fill { height: 100%; background: var(--acc); }
.bar.small { height: 4px; margin-top: .4rem; }
.grid.mini { grid-template-columns: repeat(auto-fill, minmax(140px, 170px)); }
.grid.mini .card { cursor: pointer; }
.mini-info { display: flex; flex-direction: column; padding: .5rem; }
.mini-meta { font-size: .75rem; color: var(--muted); margin-top: .1rem; }
@media (max-width: 640px) {
.hero-sec { grid-template-columns: 1fr; grid-template-areas: "img" "right"; }
}
.detail-head { margin-bottom: 1rem; }
.synopsis { color: var(--muted); max-width: 70ch; margin: 0.3rem 0; }
@@ -51,4 +75,3 @@ button:hover { border-color: var(--acc); }
.ep.filler { opacity: 0.55; }
.badge { font-size: 0.6rem; color: var(--muted); }
.hist-item { display: block; width: 100%; text-align: left; margin: 0.3rem 0; padding: 0.6rem 0.8rem; }