Add a card details info tile to the click-to-preview modal
Shows type line, mana value/colors, price, per-format legality pills, and ownership context (owned copies, decks it's in) when the caller has that data — LibraryCard/DeckEntry rows do, bare CardRefs don't, so the section just omits itself when absent. The info tile sits beside the card art via flex-wrap and drops to its own line on narrow viewports, rather than shrinking either face to make room. Also shrinks a double-faced Battle's rotated front face when it has a sibling back face, so it no longer renders at full single-card size next to a much smaller back face.
This commit is contained in:
108
src/styles.css
108
src/styles.css
@@ -1503,6 +1503,8 @@ tbody tr:hover {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow-y: auto;
|
||||
padding: 24px 12px;
|
||||
background: rgba(10, 10, 12, 0.72);
|
||||
backdrop-filter: blur(2px);
|
||||
cursor: zoom-out;
|
||||
@@ -1516,9 +1518,22 @@ tbody tr:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
/* The info tile (see `.preview-info`) sits beside the card art whenever
|
||||
there's room, and wraps onto its own line below when there isn't —
|
||||
plain flex-wrap rather than a hand-tuned width breakpoint, so neither the
|
||||
art nor the info tile ever has to shrink to make the other fit. Any
|
||||
remaining vertical overflow (e.g. a double-faced card's full-size faces
|
||||
plus a tall info tile on a short window) is handled by
|
||||
`.preview-modal-backdrop`'s own scrolling, not by clipping content. */
|
||||
.preview-modal {
|
||||
position: relative;
|
||||
cursor: default;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
gap: 16px;
|
||||
max-width: 96vw;
|
||||
}
|
||||
.preview-modal-faces {
|
||||
position: relative;
|
||||
@@ -1611,6 +1626,99 @@ tbody tr:hover {
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.preview-info {
|
||||
width: min(320px, 90vw);
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
background: var(--bg-panel);
|
||||
border: 1px solid var(--border-soft);
|
||||
border-radius: 18px;
|
||||
padding: 18px;
|
||||
box-shadow: var(--shadow-lg);
|
||||
color: var(--text);
|
||||
}
|
||||
.preview-info-name {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
line-height: 1.25;
|
||||
color: var(--text-strong);
|
||||
}
|
||||
.preview-info-type {
|
||||
font-size: 13px;
|
||||
color: var(--muted);
|
||||
}
|
||||
.preview-info-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
.preview-info-mv {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.preview-info-price {
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: var(--gold);
|
||||
}
|
||||
.preview-info-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid var(--border-soft);
|
||||
}
|
||||
.preview-info-label {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
color: var(--faint);
|
||||
}
|
||||
.preview-info-deck-chips {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
}
|
||||
.preview-info-legal-grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
}
|
||||
.legal-pill {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
border-radius: 999px;
|
||||
padding: 2px 8px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
border: 1px solid transparent;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.legal-pill.legal-legal {
|
||||
background: rgba(75, 176, 115, 0.16);
|
||||
border-color: rgba(75, 176, 115, 0.4);
|
||||
color: var(--success);
|
||||
}
|
||||
.legal-pill.legal-restricted {
|
||||
background: rgba(224, 163, 74, 0.16);
|
||||
border-color: rgba(224, 163, 74, 0.4);
|
||||
color: var(--warn);
|
||||
}
|
||||
.legal-pill.legal-banned {
|
||||
background: rgba(216, 80, 63, 0.16);
|
||||
border-color: rgba(216, 80, 63, 0.4);
|
||||
color: var(--danger);
|
||||
text-decoration: line-through;
|
||||
}
|
||||
.legal-pill.legal-not_legal {
|
||||
border-color: var(--border-soft);
|
||||
color: var(--faint);
|
||||
opacity: 0.55;
|
||||
}
|
||||
|
||||
.tile-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
|
||||
|
||||
Reference in New Issue
Block a user