Files
ani-web/static/style.css
T
jozamudi 1be3f4f307 Stats UI: per-anime progress rows, status chips, on-hold, streak, detail line
- server: /api/stats top_anime rows enriched — poster, total eps, cur_ep,
  last_seen, status (finished/ongoing/hold heuristic), pace (ep/day),
  sub/dub watch-time split, rewatches (backward jump >60s); new on_hold
  + best_streak top-level keys; optional ?slug= filter (json_extract)
- frontend: 'Most watched' rows = poster + meta + status chip + completion
  bar (ongoing -> hold -> finished order); stat cards swap in on-hold and
  best streak, errors demoted to a one-liner; anime detail page gets a
  progress line (E12/24 · 4h 30m · 2.1 ep/day · status); history cards
  dim + label 'on hold' after 7 days; savePos now includes total eps
- css: .chip, .stat-anime rows, .card.hold, .detail-prog; drop dead .stat-row
- test: test_stats asserts the new fields + slug filter
2026-08-24 17:30:01 +00:00

144 lines
8.7 KiB
CSS

:root { --bg: #0e0f13; --card: #171821; --bd: #262833; --fg: #e8e9f0; --muted: #8a8d9c; --acc: #f97316; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
header { display: flex; gap: 1rem; align-items: center; padding: 0.8rem 1.2rem;
border-bottom: 1px solid var(--bd); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.logo { font-weight: 700; font-size: 1.2rem; color: var(--acc); }
header form { flex: 1; max-width: 420px; }
button.tiny { padding: .2rem .55rem; font-size: .8rem; border-radius: 6px;
border: 1px solid var(--bd); background: var(--card); color: var(--fg); cursor: pointer; }
button.tiny.danger { border-color: #7f1d1d; color: #f87171; }
#menubox { position: relative; }
#menu-items { display: none; position: absolute; right: 0; top: calc(100% + 4px);
background: var(--card); border: 1px solid var(--bd); border-radius: 8px;
padding: .35rem; min-width: 160px; z-index: 2; }
#menubox.open #menu-items { display: block; }
#menu-items button { display: block; width: 100%; text-align: left; margin-top: .15rem; }
header #me { margin-left: auto; }
#q { width: 100%; padding: 0.5rem 0.8rem; border-radius: 8px; border: 1px solid var(--bd);
background: var(--card); color: var(--fg); }
main { padding: 1.2rem; max-width: 1100px; margin: 0 auto; }
.muted { color: var(--muted); }
.error { color: #f87171; }
h2 { margin: 0.4rem 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--bd); border-radius: 10px; overflow: hidden;
display: flex; flex-direction: column; }
.card:hover { border-color: var(--acc); }
.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 { padding: .45rem 1.1rem; border-radius: 8px;
border: 1px solid var(--acc); background: var(--acc); color: #140b02; font-weight: 600; cursor: pointer; }
.hero-body .btn { align-self: start; } /* resume button: left edge of hero col, not the player overlay's */
.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; }
/* stats page (?stats) */
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.card.stat { padding: .8rem; gap: .2rem; }
.stat-value { font-size: 1.3rem; font-weight: 700; }
.wk { display: flex; gap: .5rem; align-items: flex-end; margin: .4rem 0 .8rem; }
.wk-col { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.wk-bar { width: 26px; background: var(--acc); border-radius: 4px; }
.wk-day { font-size: .7rem; color: var(--muted); }
.chip { font-size: .7rem; padding: .1rem .5rem; border-radius: 99px; border: 1px solid var(--bd);
color: var(--muted); white-space: nowrap; }
.chip.on { color: var(--acc); border-color: var(--acc); }
.chip.fin { background: var(--acc); border-color: var(--acc); color: #140b02; font-weight: 600; }
.stat-anime { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: .3rem .8rem;
align-items: center; padding: .55rem; background: var(--card); border: 1px solid var(--bd);
border-radius: 10px; margin: .55rem 0; }
.stat-anime img, .sa-ph { grid-row: span 2; width: 44px; aspect-ratio: 2/3; object-fit: cover;
border-radius: 6px; background: var(--bd); }
.sa-top { display: flex; gap: .8rem; align-items: baseline; min-width: 0; }
.sa-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-anime .bar { grid-column: 2 / 4; margin-top: 0; }
.card.hold { opacity: .55; }
.detail-prog { margin-top: .1rem; font-size: .85rem; }
.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: 100px 1fr; grid-template-areas: "img right"; gap: .8rem; padding: .8rem; }
.hero img { width: 100px; }
.hero-body h2 { white-space: normal; font-size: 1.05rem; }
.card.hist img { max-height: 150px; }
header #me { display: none; }
}
.detail-head { margin-bottom: 1rem; }
.synopsis { color: var(--muted); max-width: 70ch; margin: 0.3rem 0; }
.player { position: relative; }
.player video { width: 100%; max-height: 70vh; background: #000; border-radius: 10px; aspect-ratio: 16/9; }
.controls { display: flex; align-items: center; gap: 0.4rem; margin: 0.6rem 0; flex-wrap: wrap; }
button { background: var(--card); color: var(--fg); border: 1px solid var(--bd);
border-radius: 8px; padding: 0.4rem 0.7rem; cursor: pointer; }
button:hover { border-color: var(--acc); }
.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.6rem 0; }
.tab { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* recent searches dropdown + player extras */
header form { position: relative; }
.recent { position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
background: var(--card); border: 1px solid var(--bd); border-radius: 8px;
margin-top: .3rem; display: none; max-height: 240px; overflow: auto; }
.recent.open { display: block; }
.recent button { display: block; width: 100%; text-align: left; padding: .5rem .8rem;
background: none; border: 0; color: var(--fg); cursor: pointer; font-size: .9rem; }
.recent button:hover { background: rgba(255, 255, 255, 0.06); }
.spd { padding: .2rem .3rem; background: var(--card); color: var(--fg);
border: 1px solid var(--bd); border-radius: 6px; font-size: .8rem; }
.cnt-x { background: none; border: 0; color: var(--muted); font-size: 1.1rem;
cursor: pointer; padding: .2rem .5rem; }
button.tiny.on { border-color: var(--acc); color: var(--acc); }
.tab.active { border-color: var(--acc); color: var(--acc); }
/* loading + feedback */
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skel { aspect-ratio: 2/3; border: 1px solid var(--bd); border-radius: 10px;
background: linear-gradient(90deg, var(--card) 25%, #1f2030 37%, var(--card) 63%);
background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.pl-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; gap: .6rem;
align-items: center; justify-content: center; background: rgba(0, 0, 0, .72);
border-radius: 10px; color: var(--fg); font-size: .95rem; z-index: 1; }
#toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
display: flex; flex-direction: column; gap: .4rem; z-index: 9; }
@keyframes toast-in { from { opacity: 0; transform: translateY(.4rem); } }
.toast { background: var(--card); border: 1px solid var(--acc); color: var(--fg);
padding: .45rem .9rem; border-radius: 8px; font-size: .85rem; animation: toast-in .2s ease; }
.crumb { display: inline-block; font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
.crumb:hover { color: var(--acc); }
.sec-head { display: flex; align-items: baseline; gap: .8rem; }
.card.hist { position: relative; cursor: pointer; }
.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);
color: var(--muted); font-size: .9rem; line-height: 1; padding: 0; cursor: pointer; }
.del:hover { border-color: #f87171; color: #f87171; }
.eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 0.4rem; }
.ep { position: relative; font-size: 0.9rem; }
.ep.filler { opacity: 0.55; }
.ep.done { opacity: 0.5; }
.ep.nextup { border-color: #4b5568; background: #1f2130; }
.ep.active { border-color: var(--acc); color: var(--acc); } /* declared last: wins over nextup */
.badge { font-size: 0.6rem; color: var(--muted); }