Put trading and giving up front and suggest the players who need each card
The Échanges et dons page now opens on two illustrated tiles, centred and 360 px wide at most: trade (L'Échange Écarlate) and give (the Dawn card, renamed Le Don de l'Aube with a gift story). Each counts the cards missing on either side and previews a few. In the composer, the most useful players come first in the list and as suggested chips, and missing duplicates lead with a badge; nothing is filtered, so owned duplicates stay tradeable for Awakenings. GET /api/cards/traders adds `wants`: which of the viewer's own duplicates each player lacks, and nothing else of their collection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2f3c371d7b
commit
17e5cd5e63
12 changed files with 302 additions and 46 deletions
|
|
@ -1,14 +1,19 @@
|
|||
/**
|
||||
* @file Crée un don immédiat ou une proposition d'échange en choisissant un joueur et les cartes affichées.
|
||||
* @file Crée un don immédiat ou une proposition d'échange en choisissant un joueur et les cartes affichées. Les
|
||||
* joueurs et les doublons qui manquent passent d'abord, sans qu'aucun doublon ne soit masqué.
|
||||
*/
|
||||
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { useMemo, useState } from "react";
|
||||
import { Modal } from "../../components/Modal.jsx";
|
||||
import { SelectDropdown } from "../../components/SelectDropdown.jsx";
|
||||
import { createTransfer, loadTraders } from "./cardsApi.js";
|
||||
import { createTransfer } from "./cardsApi.js";
|
||||
import { NebulaCard, RarityGlyph } from "./rendering/NebulaCard.jsx";
|
||||
import { fillTemplate } from "./textFormat.js";
|
||||
import { matchTraders, rankMatches } from "./transferSuggestions.js";
|
||||
|
||||
function DuplicatePicker({ catalog, label, entries, selectedId, onSelect, empty, newLabel }) {
|
||||
const SUGGESTED_PLAYERS = 4;
|
||||
|
||||
function DuplicatePicker({ catalog, label, entries, selectedId, onSelect, empty }) {
|
||||
const [search, setSearch] = useState("");
|
||||
const query = search.trim().toLocaleLowerCase("fr");
|
||||
const visible = entries.filter((entry) => !query || entry.card.name.toLocaleLowerCase("fr").includes(query));
|
||||
|
|
@ -25,40 +30,45 @@ function DuplicatePicker({ catalog, label, entries, selectedId, onSelect, empty,
|
|||
<NebulaCard catalog={catalog} entry={entry} size="sm" selected={selected} selectLabel={`${label} : ${entry.card.name}`} onSelect={() => onSelect(entry.editionId)} />
|
||||
<strong>{entry.card.name}</strong>
|
||||
<small><i className="nebula-history-rarity" aria-hidden="true"><RarityGlyph rarity={entry.edition.rarity} /></i>{rarity} · ×{entry.spare}</small>
|
||||
{entry.missing && <span className="nds-badge" data-variant="gold">{newLabel}</span>}
|
||||
{entry.badge && <span className="nds-badge" data-variant="gold">{entry.badge}</span>}
|
||||
</div>;
|
||||
})}</div>
|
||||
: <div className="nds-empty-state"><p>{empty}</p></div>}
|
||||
</section>;
|
||||
}
|
||||
|
||||
export function TransferComposer({ catalog, state, initial, content, runMutation, busy, onClose, onSent }) {
|
||||
/** `traders` : joueurs chargés par TransfersPanel (null pendant le chargement). */
|
||||
export function TransferComposer({ catalog, state, traders, loadError, initial, content, runMutation, busy, onClose, onSent }) {
|
||||
const [type, setType] = useState(initial.type);
|
||||
const [traders, setTraders] = useState(null);
|
||||
const [loadError, setLoadError] = useState("");
|
||||
const [recipientId, setRecipientId] = useState("");
|
||||
const [editionId, setEditionId] = useState(initial.editionId || "");
|
||||
const [requestedId, setRequestedId] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
let active = true;
|
||||
loadTraders().then((result) => { if (active) setTraders(result.traders); }).catch((error) => { if (active) setLoadError(error.message); });
|
||||
return () => { active = false; };
|
||||
}, []);
|
||||
|
||||
const editions = useMemo(() => new Map(catalog.editions.map((edition) => [edition.id, edition])), [catalog.editions]);
|
||||
const cards = useMemo(() => new Map(catalog.cards.map((card) => [card.id, card])), [catalog.cards]);
|
||||
const ownedIds = new Set(state.collection.map((entry) => entry.editionId));
|
||||
const rarityRank = new Map(catalog.rarities.map((rarity, index) => [rarity.id, index]));
|
||||
const byRarity = (a, b) => (rarityRank.get(b.edition.rarity) ?? 0) - (rarityRank.get(a.edition.rarity) ?? 0) || a.card.name.localeCompare(b.card.name, "fr");
|
||||
const mine = state.collection.filter((entry) => entry.spare > 0 && entry.card).toSorted(byRarity);
|
||||
const recipient = traders?.find((trader) => trader.id === recipientId);
|
||||
// Les cartes qui manquent au joueur passent d'abord : ce sont celles qu'il cherche.
|
||||
const spares = state.collection.filter((entry) => entry.spare > 0 && entry.card);
|
||||
const matches = matchTraders(traders || [], ownedIds, new Set(spares.map((entry) => entry.editionId)));
|
||||
const ranked = rankMatches(matches, { type, editionId });
|
||||
const match = matches.find((item) => item.trader.id === recipientId);
|
||||
const recipient = match?.trader;
|
||||
const chosenName = cards.get(editions.get(editionId)?.cardId)?.name;
|
||||
const matchHint = (item) => (type === "gift" && editionId && item.forThem.includes(editionId)
|
||||
? fillTemplate(content.giftLacksChosen, { card: chosenName })
|
||||
: fillTemplate(type === "gift" ? content.giftMatchHint : content.tradeMatchHint, { forMe: item.forMe.length, forThem: item.forThem.length }));
|
||||
const useful = (item) => (type === "gift" ? item.forThem.length : item.forMe.length) > 0;
|
||||
const suggested = ranked.filter(useful).slice(0, SUGGESTED_PLAYERS);
|
||||
// Tous les doublons restent proposés (un doublon déjà possédé sert aux Éveils) ; ceux qui manquent passent d'abord.
|
||||
const firstMissing = (a, b) => Number(Boolean(b.badge)) - Number(Boolean(a.badge)) || byRarity(a, b);
|
||||
const mine = spares.map((entry) => ({ ...entry, badge: match?.forThem.includes(entry.editionId) ? content.theyLackBadge : "" })).toSorted(firstMissing);
|
||||
const theirs = (recipient?.duplicates || []).flatMap(({ editionId: id, spare }) => {
|
||||
const edition = editions.get(id);
|
||||
const card = edition && cards.get(edition.cardId);
|
||||
return card ? [{ editionId: id, spare, edition, card, missing: !ownedIds.has(id) }] : [];
|
||||
}).toSorted((a, b) => Number(b.missing) - Number(a.missing) || byRarity(a, b));
|
||||
return card ? [{ editionId: id, spare, edition, card, badge: ownedIds.has(id) ? "" : content.missingBadge }] : [];
|
||||
}).toSorted(firstMissing);
|
||||
const chooseRecipient = (value) => { setRecipientId(value); setRequestedId(""); };
|
||||
|
||||
const offered = mine.find((entry) => entry.editionId === editionId);
|
||||
const requested = theirs.find((entry) => entry.editionId === requestedId);
|
||||
|
|
@ -80,10 +90,19 @@ export function TransferComposer({ catalog, state, initial, content, runMutation
|
|||
{loadError && <p className="nds-inline-notice" data-variant="danger" role="alert">{loadError}</p>}
|
||||
{traders?.length === 0
|
||||
? <div className="nds-empty-state"><p>{content.noPlayers}</p></div>
|
||||
: <SelectDropdown label={content.playerLabel} value={recipientId} placeholder={traders ? content.playerPlaceholder : content.playerLoading} disabled={!traders} options={(traders || []).map((trader) => ({ value: trader.id, label: `${trader.displayName} (${trader.duplicates.reduce((total, entry) => total + entry.spare, 0)} ${content.duplicatesShort})` }))} onChange={(value) => { setRecipientId(value); setRequestedId(""); }} />}
|
||||
: <div className="nebula-trade-recipient">
|
||||
<SelectDropdown label={content.playerLabel} value={recipientId} placeholder={traders ? content.playerPlaceholder : content.playerLoading} disabled={!traders} options={ranked.map((item) => ({ value: item.trader.id, label: `${item.trader.displayName} (${item.trader.duplicates.reduce((total, entry) => total + entry.spare, 0)} ${content.duplicatesShort})`, hint: matchHint(item) }))} onChange={chooseRecipient} />
|
||||
{suggested.length > 0 && <div className="nebula-trade-suggestions" role="group" aria-label={content.suggestionsLabel}>
|
||||
<span>{content.suggestionsLabel}</span>
|
||||
{suggested.map((item) => <button key={item.trader.id} className="nds-chip" data-size="sm" type="button" aria-pressed={item.trader.id === recipientId} title={matchHint(item)} onClick={() => chooseRecipient(item.trader.id)}>
|
||||
{item.trader.displayName}
|
||||
<span className="nds-badge" data-variant="gold">{type === "gift" ? item.forThem.length : item.forMe.length}</span>
|
||||
</button>)}
|
||||
</div>}
|
||||
</div>}
|
||||
<div className="nebula-trade-columns" data-type={type}>
|
||||
<DuplicatePicker catalog={catalog} label={content.youGive} entries={mine} selectedId={editionId} onSelect={setEditionId} empty={content.noDuplicates} newLabel={content.missingBadge} />
|
||||
{type === "trade" && <DuplicatePicker catalog={catalog} label={content.youReceive} entries={theirs} selectedId={requestedId} onSelect={setRequestedId} empty={recipient ? content.playerNoDuplicates : content.choosePlayerFirst} newLabel={content.missingBadge} />}
|
||||
<DuplicatePicker catalog={catalog} label={content.youGive} entries={mine} selectedId={editionId} onSelect={setEditionId} empty={content.noDuplicates} />
|
||||
{type === "trade" && <DuplicatePicker catalog={catalog} label={content.youReceive} entries={theirs} selectedId={requestedId} onSelect={setRequestedId} empty={recipient ? content.playerNoDuplicates : content.choosePlayerFirst} />}
|
||||
</div>
|
||||
{sameCard && <p className="nds-inline-notice" data-variant="warning" role="alert">{content.sameCard}</p>}
|
||||
<p className="nebula-form-help">{type === "gift" ? content.giftHelp : content.tradeHelp}</p>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,41 @@
|
|||
/**
|
||||
* @file Présente les propositions d'échange reçues et envoyées, les transferts terminés et l'accès à la
|
||||
* création d'un don ou d'un échange.
|
||||
* @file Présente les deux actions (échanger, donner) avec les cartes qui manquent de part et d'autre, puis les
|
||||
* propositions reçues et envoyées et les transferts terminés.
|
||||
*/
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { acceptTransfer, cancelTransfer, declineTransfer } from "./cardsApi.js";
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { acceptTransfer, cancelTransfer, declineTransfer, loadTraders } from "./cardsApi.js";
|
||||
import { NebulaCard } from "./rendering/NebulaCard.jsx";
|
||||
import { TransferComposer } from "./TransferComposer.jsx";
|
||||
import { formatRelative } from "./admin/adminFormat.js";
|
||||
import { fillTemplate } from "./textFormat.js";
|
||||
import { matchTraders, summarizeMatches } from "./transferSuggestions.js";
|
||||
|
||||
const TILE_PREVIEW = 4;
|
||||
|
||||
/**
|
||||
* Grande tuile d'action : l'illustration de la carte qui la représente, ce qu'elle permet, combien de cartes et de
|
||||
* joueurs elle concerne, et quelques-unes de ces cartes.
|
||||
*/
|
||||
function ActionTile({ catalog, kind, image, title, text, hint, found, previews, action, variant, disabled, onClick }) {
|
||||
return <article className="nds-card nebula-transfer-action" data-kind={kind}>
|
||||
<img className="nebula-transfer-action-cover" src={image} alt="" loading="lazy" />
|
||||
<div className="nebula-transfer-action-body">
|
||||
<h3>{title}</h3>
|
||||
<p>{text}</p>
|
||||
{hint && <p className="nebula-transfer-action-hint" data-found={found || undefined}>{hint}</p>}
|
||||
{previews.length > 0 && <div className="nebula-transfer-action-cards" aria-hidden="true">
|
||||
{previews.map((entry) => <NebulaCard key={entry.editionId} catalog={catalog} entry={entry} size="sm" />)}
|
||||
</div>}
|
||||
<button className="nds-button" data-variant={variant} type="button" disabled={disabled} onClick={onClick}>{action}</button>
|
||||
</div>
|
||||
</article>;
|
||||
}
|
||||
|
||||
/** Accorde « {cards} carte{s} … {players} joueur{ps} ». */
|
||||
function countHint(template, { cards, players }) {
|
||||
return fillTemplate(template, { cards: cards.length, s: cards.length > 1 ? "s" : "", nt: cards.length > 1 ? "nt" : "", players, ps: players > 1 ? "s" : "" });
|
||||
}
|
||||
|
||||
function TransferSide({ catalog, label, entry }) {
|
||||
const rarity = catalog.rarities.find((item) => item.id === entry?.edition?.rarity)?.label;
|
||||
|
|
@ -56,6 +84,8 @@ export function TransfersPanel({ catalog, state, runMutation, busy, content, dra
|
|||
const [showFinished, setShowFinished] = useState(false);
|
||||
const [now] = useState(() => Date.now());
|
||||
const [notice, setNotice] = useState("");
|
||||
const [traders, setTraders] = useState(null);
|
||||
const [loadError, setLoadError] = useState("");
|
||||
const toProcess = state.transfers.filter((transfer) => transfer.status === "open" && transfer.direction === "received");
|
||||
const sent = state.transfers.filter((transfer) => transfer.status === "open" && transfer.direction === "sent");
|
||||
const finished = state.transfers.filter((transfer) => transfer.status !== "open");
|
||||
|
|
@ -64,21 +94,58 @@ export function TransfersPanel({ catalog, state, runMutation, busy, content, dra
|
|||
if (draft) onDraftUsed();
|
||||
}, [draft, onDraftUsed]);
|
||||
|
||||
// Rechargés après chaque don ou décision : les doublons des uns et des autres ont pu changer.
|
||||
const refreshTraders = useCallback(() => loadTraders()
|
||||
.then((result) => { setTraders(result.traders); setLoadError(""); })
|
||||
.catch((error) => setLoadError(error.message)), []);
|
||||
useEffect(() => { refreshTraders(); }, [refreshTraders]);
|
||||
|
||||
const lookup = useMemo(() => {
|
||||
const editions = new Map(catalog.editions.map((edition) => [edition.id, edition]));
|
||||
const cards = new Map(catalog.cards.map((card) => [card.id, card]));
|
||||
const rank = new Map(catalog.rarities.map((rarity, index) => [rarity.id, index]));
|
||||
const entryOf = (editionId) => {
|
||||
const edition = editions.get(editionId);
|
||||
const card = edition && cards.get(edition.cardId);
|
||||
return card ? { editionId, edition, card } : null;
|
||||
};
|
||||
const byRarity = (a, b) => (rank.get(editions.get(b)?.rarity) ?? 0) - (rank.get(editions.get(a)?.rarity) ?? 0);
|
||||
return { entryOf, byRarity };
|
||||
}, [catalog]);
|
||||
const spares = useMemo(() => state.collection.filter((entry) => entry.spare > 0 && entry.card), [state.collection]);
|
||||
const summary = useMemo(() => traders && summarizeMatches(
|
||||
matchTraders(traders, new Set(state.collection.map((entry) => entry.editionId)), new Set(spares.map((entry) => entry.editionId))),
|
||||
lookup.byRarity
|
||||
), [traders, state.collection, spares, lookup]);
|
||||
const previews = (ids) => ids.slice(0, TILE_PREVIEW).map(lookup.entryOf).filter(Boolean);
|
||||
const tradeHint = summary && (summary.trade.cards.length ? countHint(content.tradeTileHint, summary.trade) : content.tradeTileNone);
|
||||
const giftHint = !spares.length ? content.noDuplicates
|
||||
: summary && (summary.gift.cards.length ? countHint(content.giftTileHint, summary.gift) : content.giftTileNone);
|
||||
|
||||
async function decide(action, message) {
|
||||
setNotice("");
|
||||
const result = await runMutation(action);
|
||||
if (result) setNotice(message);
|
||||
if (result) {
|
||||
setNotice(message);
|
||||
refreshTraders();
|
||||
}
|
||||
}
|
||||
|
||||
return <div className="nebula-transfers">
|
||||
<div className="nds-section-heading nebula-section-heading">
|
||||
<div><p className="eyebrow">{content.eyebrow}</p><h2>{content.title}</h2></div>
|
||||
<div className="nds-toolbar">
|
||||
<button className="nds-button" data-variant="secondary" type="button" disabled={busy} onClick={() => setComposer({ type: "gift" })}>{content.newGift}</button>
|
||||
<button className="nds-button" data-variant="primary" type="button" disabled={busy} onClick={() => setComposer({ type: "trade" })}>{content.newTrade}</button>
|
||||
</div>
|
||||
</div>
|
||||
{notice && <p className="nds-inline-notice" data-variant="success" role="status">{notice}</p>}
|
||||
{loadError && <p className="nds-inline-notice" data-variant="danger" role="alert">{loadError}</p>}
|
||||
|
||||
<div className="nebula-transfer-actions">
|
||||
<ActionTile catalog={catalog} kind="trade" image={content.tradeTileImage} title={content.tradeTileTitle} text={content.tradeTileText} hint={tradeHint} found={Boolean(summary?.trade.cards.length)}
|
||||
previews={previews(summary?.trade.cards || [])}
|
||||
action={content.newTrade} variant="primary" disabled={busy} onClick={() => setComposer({ type: "trade" })} />
|
||||
<ActionTile catalog={catalog} kind="gift" image={content.giftTileImage} title={content.giftTileTitle} text={content.giftTileText} hint={giftHint} found={Boolean(spares.length && summary?.gift.cards.length)}
|
||||
previews={previews(summary?.gift.cards || [])}
|
||||
action={content.newGift} variant="secondary" disabled={busy} onClick={() => setComposer({ type: "gift" })} />
|
||||
</div>
|
||||
|
||||
{toProcess.length > 0 && <section aria-labelledby="nebula-transfers-inbox">
|
||||
<div className="nds-section-heading nebula-section-heading"><h3 id="nebula-transfers-inbox">{content.inboxTitle} <span className="nds-badge" data-variant="gold">{toProcess.length}</span></h3></div>
|
||||
|
|
@ -95,13 +162,11 @@ export function TransfersPanel({ catalog, state, runMutation, busy, content, dra
|
|||
</TransferCard>)}</div>
|
||||
</section>}
|
||||
|
||||
{!toProcess.length && !sent.length && <div className="nds-empty-state"><p>{content.empty}</p></div>}
|
||||
|
||||
{finished.length > 0 && <section aria-label={content.finishedTitle}>
|
||||
<button className="nds-button" data-size="sm" data-variant="secondary" type="button" aria-expanded={showFinished} onClick={() => setShowFinished(!showFinished)}>{content.finishedTitle} ({finished.length})</button>
|
||||
{showFinished && <div className="nebula-transfers-list nebula-transfers-finished">{finished.map((transfer) => <TransferCard key={transfer.id} catalog={catalog} transfer={transfer} content={content} now={now} />)}</div>}
|
||||
</section>}
|
||||
|
||||
{composer && <TransferComposer key={`${composer.type}-${composer.editionId || ""}`} catalog={catalog} state={state} initial={composer} content={content} runMutation={runMutation} busy={busy} onClose={() => setComposer(null)} onSent={(message) => { setNotice(message); setComposer(null); }} />}
|
||||
{composer && <TransferComposer key={`${composer.type}-${composer.editionId || ""}`} catalog={catalog} state={state} traders={traders} loadError={loadError} initial={composer} content={content} runMutation={runMutation} busy={busy} onClose={() => setComposer(null)} onSent={(message) => { setNotice(message); setComposer(null); refreshTraders(); }} />}
|
||||
</div>;
|
||||
}
|
||||
|
|
|
|||
58
website/src/features/cards/transferSuggestions.js
Normal file
58
website/src/features/cards/transferSuggestions.js
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/**
|
||||
* @file Règles pures des suggestions d'Échanges et dons : quels joueurs ont un doublon qui me manque, à qui manquent
|
||||
* mes doublons, et dans quel ordre les proposer.
|
||||
*
|
||||
* Utilisé par : TransfersPanel.jsx (tuiles d'accueil) et TransferComposer.jsx (ordre des joueurs et des doublons).
|
||||
* Attention : ne filtre jamais. Un doublon déjà possédé reste échangeable (Éveils) ; les suggestions ne font que
|
||||
* remonter les cartes qui manquent. `wants` vient de GET /api/cards/traders : seuls mes doublons y sont comparés.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Ce que chaque joueur peut m'apporter et ce que je peux lui apporter.
|
||||
* @param {Array<{ id: string, duplicates: Array<{ editionId: string }>, wants?: string[] }>} traders Joueurs de l'API.
|
||||
* @param {Set<string>} ownedIds Variations de ma collection.
|
||||
* @param {Set<string>} spareIds Mes doublons disponibles, pour ignorer un `wants` périmé.
|
||||
* @returns {Array<{ trader: object, forMe: string[], forThem: string[] }>} Dans l'ordre reçu.
|
||||
*/
|
||||
export function matchTraders(traders, ownedIds, spareIds) {
|
||||
return traders.map((trader) => ({
|
||||
trader,
|
||||
forMe: trader.duplicates.map((entry) => entry.editionId).filter((id) => !ownedIds.has(id)),
|
||||
forThem: (trader.wants || []).filter((id) => spareIds.has(id))
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Trie les joueurs du plus intéressant au moins intéressant, sans en retirer. Échange : d'abord ceux qui ont des
|
||||
* doublons qui me manquent, puis ceux à qui les miens manquent (échange utile aux deux). Don : d'abord ceux à qui
|
||||
* manque la carte choisie, puis le plus de mes doublons. À égalité, l'ordre reçu (alphabétique) est conservé.
|
||||
* @param {ReturnType<typeof matchTraders>} matches Résultat de `matchTraders`.
|
||||
* @param {{ type: "trade" | "gift", editionId?: string }} options Type de proposition et doublon déjà choisi.
|
||||
* @returns {ReturnType<typeof matchTraders>} Une nouvelle liste triée.
|
||||
*/
|
||||
export function rankMatches(matches, { type, editionId = "" }) {
|
||||
const lacksChosen = (match) => Number(Boolean(editionId) && match.forThem.includes(editionId));
|
||||
const keys = type === "gift"
|
||||
? (match) => [lacksChosen(match), match.forThem.length]
|
||||
: (match) => [match.forMe.length, lacksChosen(match), match.forThem.length];
|
||||
return matches.toSorted((a, b) => {
|
||||
const left = keys(a);
|
||||
const right = keys(b);
|
||||
return left.reduce((order, value, index) => order || right[index] - value, 0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Chiffres des tuiles d'accueil : cartes distinctes à trouver ou à offrir et joueurs concernés, plus quelques
|
||||
* variations à montrer (les plus rares d'abord).
|
||||
* @param {ReturnType<typeof matchTraders>} matches Résultat de `matchTraders`.
|
||||
* @param {(a: string, b: string) => number} byRarity Ordre des variations, les plus rares d'abord.
|
||||
* @returns {{ trade: { cards: string[], players: number }, gift: { cards: string[], players: number } }}
|
||||
*/
|
||||
export function summarizeMatches(matches, byRarity) {
|
||||
const side = (key) => ({
|
||||
cards: [...new Set(matches.flatMap((match) => match[key]))].toSorted(byRarity),
|
||||
players: matches.filter((match) => match[key].length).length
|
||||
});
|
||||
return { trade: side("forMe"), gift: side("forThem") };
|
||||
}
|
||||
|
|
@ -1034,9 +1034,27 @@ main:has(.nebula-dashboard) { overflow-x: clip; }
|
|||
.nebula-admin-layout h2 { margin-top: 0; }
|
||||
.nebula-form { display: grid; gap: var(--space-3); }
|
||||
.nebula-form-help { margin: 0; color: var(--color-text-muted); font-size: var(--font-size-xs); }
|
||||
.nebula-transfers { display: grid; gap: var(--space-5); min-width: 0; }
|
||||
.nebula-transfers { container: transfers / inline-size; display: grid; gap: var(--space-5); min-width: 0; }
|
||||
.nebula-transfers-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: var(--space-4); }
|
||||
.nebula-transfers-finished { margin-top: var(--space-3); }
|
||||
// Accueil des échanges : deux tuiles (échanger en or, donner) de 360 px au plus, côte à côte dès 620 px de panneau et
|
||||
// centrées, l'illustration de L'Échange Écarlate ou du Don de l'Aube en bandeau 2:1, fondue vers le texte. La largeur
|
||||
// est plafonnée pour que le bandeau garde les visages des personnages.
|
||||
.nebula-transfer-actions { display: grid; grid-template-columns: minmax(0, 360px); justify-content: center; gap: var(--space-4); }
|
||||
.nds-card.nebula-transfer-action { display: grid; grid-template-rows: auto 1fr; overflow: hidden; padding: 0; }
|
||||
.nds-card.nebula-transfer-action[data-kind="trade"] { border-color: rgba(246, 196, 83, 0.45); }
|
||||
.nebula-transfer-action-cover { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; object-position: center 30%; mask-image: linear-gradient(to bottom, #000 60%, transparent); }
|
||||
.nebula-transfer-action-body { display: grid; grid-template-rows: auto auto 1fr auto; justify-items: start; gap: var(--space-2); padding: 0 var(--space-5) var(--space-5); }
|
||||
.nebula-transfer-action-body h3 { margin: 0; font-size: var(--font-size-lg); }
|
||||
.nebula-transfer-action-body p { margin: 0; color: var(--color-text-muted); font-size: var(--font-size-sm); }
|
||||
.nebula-transfer-action-body .nebula-transfer-action-hint { color: var(--color-text); font-weight: 600; }
|
||||
.nebula-transfer-action-body .nebula-transfer-action-hint[data-found] { color: var(--color-accent-gold); }
|
||||
.nebula-transfer-action-cards { display: flex; gap: var(--space-1); }
|
||||
.nebula-transfer-action-cards > .nebula-card { width: 44px; }
|
||||
.nebula-transfer-action-body > .nds-button { margin-top: var(--space-2); }
|
||||
@container transfers (min-width: 620px) {
|
||||
.nebula-transfer-actions { grid-template-columns: repeat(2, minmax(0, 360px)); }
|
||||
}
|
||||
.nds-card.nebula-transfer-card { display: grid; gap: var(--space-3); padding: var(--space-4); }
|
||||
.nebula-transfer-card header, .nebula-transfer-card footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
|
||||
.nebula-transfer-card footer { justify-content: flex-end; }
|
||||
|
|
@ -1049,6 +1067,10 @@ main:has(.nebula-dashboard) { overflow-x: clip; }
|
|||
.nebula-trade-composer.nds-modal { box-sizing: border-box; display: grid; gap: var(--space-3); width: min(1040px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
|
||||
.nebula-trade-composer h2 { margin: 0; }
|
||||
.nds-section-heading.nebula-section-heading:has(.nds-radio-button-group) { flex-wrap: wrap; margin-bottom: 0; }
|
||||
.nebula-trade-recipient { display: grid; gap: var(--space-2); }
|
||||
.nebula-trade-suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
|
||||
.nebula-trade-suggestions > span { color: var(--color-text-muted); font-size: var(--font-size-xs); }
|
||||
.nebula-trade-suggestions .nds-chip { grid-auto-flow: column; }
|
||||
.nebula-trade-columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
|
||||
.nebula-trade-columns[data-type="trade"] { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
|
||||
.nebula-trade-picker { display: grid; align-content: start; gap: var(--space-2); min-width: 0; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue