Show Greatest inclusion reasons on catalog tiles
This commit is contained in:
1 parent
f713d0c0a9
commit
bedd0bc3b3
6 files changed
+26
-11
No files matched your search
+5
-2
@@ -11,8 +11,8 @@
|
||||
.greatest-period-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
|
||||
.greatest-period-heading h2 { margin: 0; font-size: 21px; }
|
||||
.greatest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 22px 16px; }
|
||||
.greatest-tile { min-width: 0; }
|
||||
.greatest-open { position: relative; display: block; width: 100%; padding: 0; border: 0; text-align: left; color: inherit; background: none; cursor: pointer; font: inherit; }
|
||||
.greatest-tile { min-width: 0; display: flex; flex-direction: column; }
|
||||
.greatest-open { position: relative; display: block; flex: 1; width: 100%; padding: 0; border: 0; text-align: left; color: inherit; background: none; cursor: pointer; font: inherit; }
|
||||
.greatest-open:hover .greatest-cover img { transform: scale(1.035); }
|
||||
.greatest-open:focus-visible, .greatest-vote:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
|
||||
.greatest-cover { position: relative; display: block; width: 100%; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 9px; background: linear-gradient(150deg, #49343c, #282c38 60%, #18181d); box-shadow: 0 4px 17px #0007; }
|
||||
@@ -21,6 +21,8 @@
|
||||
.greatest-owned { position: absolute; top: 7px; right: 7px; padding: 2px 7px; border-radius: 9px; background: #183d34; color: #a7f0d1; font-size: 11px; font-weight: 700; box-shadow: 0 1px 8px #0008; }
|
||||
.greatest-name { display: block; margin-top: 8px; font-weight: 700; line-height: 1.25; }
|
||||
.greatest-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
|
||||
.greatest-reason-label { display: block; margin-top: 10px; color: #e9a47d; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
|
||||
.greatest-reason { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; margin-top: 3px; color: var(--fg); font-size: 12px; line-height: 1.4; }
|
||||
.greatest-votes { display: flex; gap: 8px; margin-top: 12px; }
|
||||
.greatest-votes.compact { gap: 3px; margin-top: 6px; }
|
||||
.greatest-vote { display: inline-grid; place-items: center; flex: 1; min-width: 0; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); cursor: pointer; font: inherit; }
|
||||
@@ -32,6 +34,7 @@
|
||||
.greatest-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
|
||||
.greatest-dialog-body { display: grid; grid-template-columns: minmax(130px, 230px) minmax(0, 1fr); gap: 22px; }
|
||||
.greatest-dialog-body h2 { margin: 0 0 8px; font-size: 25px; }
|
||||
.greatest-reason-heading { margin: 18px 0 3px; font-size: 15px; color: #e9a47d; }
|
||||
.greatest-dialog-body p { margin: 9px 0; }
|
||||
.greatest-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 17px 0; }
|
||||
@media (max-width: 680px) {
|
||||
|
||||
+6
-2
@@ -77,7 +77,9 @@
|
||||
item.library ? h('span', { class: 'greatest-owned', title: 'Already in your library' }, '📚 In library') : null,
|
||||
h('span', { class: 'greatest-name' }, item.title),
|
||||
h('span', { class: 'greatest-meta' }, `${item.year} · ${item.chapters == null ? 'Chapters unknown' : `${item.chapters} chapters`}`),
|
||||
h('span', { class: 'greatest-meta' }, statusLabel(item.status)));
|
||||
h('span', { class: 'greatest-meta' }, statusLabel(item.status)),
|
||||
h('span', { class: 'greatest-reason-label' }, 'Why it matters'),
|
||||
h('span', { class: 'greatest-reason' }, plainNote(item.note)));
|
||||
open.onclick = () => openDetails(item);
|
||||
return h('article', { class: 'greatest-tile' }, open, ratingButtons(item, true));
|
||||
}
|
||||
@@ -85,6 +87,7 @@
|
||||
function statusLabel(status) {
|
||||
return status === 'ongoing' ? 'Ongoing' : status === 'completed' ? 'Completed' : 'Status unknown';
|
||||
}
|
||||
function plainNote(note) { return String(note || '').replace(/\*/g, ''); }
|
||||
|
||||
function openDetails(item) {
|
||||
dialog.textContent = '';
|
||||
@@ -100,7 +103,8 @@
|
||||
h('div', { class: 'greatest-dialog-body' }, cover(item), h('div', {},
|
||||
h('h2', {}, item.title),
|
||||
h('p', { class: 'muted' }, `${item.year} · ${item.chapters == null ? 'Chapter count unknown' : `${item.chapters} chapters`} · ${statusLabel(item.status)}`),
|
||||
h('p', {}, String(item.note || '').replace(/\*/g, '')),
|
||||
h('h3', { class: 'greatest-reason-heading' }, 'Why it matters'),
|
||||
h('p', {}, plainNote(item.note)),
|
||||
h('p', { class: 'muted small' }, `Community votes: 🔥 ${votes.flame || 0} · 👍 ${votes.good || 0} · ● ${votes.neutral || 0} · 💀 ${votes.skip || 0}`),
|
||||
ratingButtons(item), links,
|
||||
h('p', { class: 'muted small' }, 'Chapter counts and status come from public catalog metadata, or from your local library when present. Availability may vary by region.'))));
|
||||
|
||||
Reference in new issue
Block a user