Group Sokko TCG's interface files by Guild quest and card rendering
The 48 files of the Daily Card, Expeditions, Daily Team and race, Broken Mirror and card rendering move to daily/, expeditions/, team/, mirror/ and rendering/ under website/src/features/cards, with every relative import rewritten. The root keeps the page, server calls, cache and the player sections outside the Guild. The cards README, the quest recipe and the current docs follow the new paths; dated audits and plans keep theirs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
863050437f
commit
88c7bf8317
74 changed files with 165 additions and 161 deletions
|
|
@ -0,0 +1,45 @@
|
|||
/**
|
||||
* @file Une carte jouable dans la préparation d'une expédition ou l'inscription à une expédition ouverte : la
|
||||
* carte, sa Puissance en haut à droite, ses stats en icônes (nom au survol) et ses étiquettes : celles
|
||||
* utiles à la destination en pastilles (condition, dangers parés, Affinité), toutes au survol de
|
||||
* l'icône d'étiquette.
|
||||
*/
|
||||
|
||||
import { Tooltip } from "../../../components/Tooltip.jsx";
|
||||
import { fillTemplate } from "../dailyShare.js";
|
||||
import { cardHelps, editionEntry, formatDecimal, STAT_BY_PLAN, STAT_IDS, tagLabel } from "./expeditionFormat.js";
|
||||
import { MaskIcon } from "./ExpeditionLabels.jsx";
|
||||
import { NebulaCard } from "../rendering/NebulaCard.jsx";
|
||||
|
||||
export function ExpeditionCardTile({ catalog, card, destination, content, selected, sortKey = null, onSelect }) {
|
||||
const entry = editionEntry(catalog, card.editionId);
|
||||
if (!entry) return null;
|
||||
const vocation = STAT_BY_PLAN[card.plan];
|
||||
const helps = cardHelps(card, destination);
|
||||
const tags = (card.tags || []).map((tag) => tagLabel(catalog, tag));
|
||||
const powerLabel = vocation ? fillTemplate(content.powerVocation, { power: card.power, stat: content.stats[vocation] }) : fillTemplate(content.power, { power: card.power });
|
||||
return <li data-busy={card.busy || undefined} data-selected={selected || undefined}>
|
||||
<div className="nebula-expedition-card-frame">
|
||||
<NebulaCard catalog={catalog} entry={entry} size="sm" selected={selected} disabled={card.busy} onSelect={card.busy ? undefined : onSelect}
|
||||
selectLabel={fillTemplate(content.chooseCard, { card: entry.card.name })} />
|
||||
<Tooltip className="nebula-expedition-card-power" content={powerLabel} aria-label={powerLabel} tabIndex={-1}>
|
||||
{vocation && <MaskIcon name={vocation} />}<span aria-hidden="true">{card.power}</span>
|
||||
</Tooltip>
|
||||
{card.busy && <span className="nebula-expedition-card-busy">{content.busy}</span>}
|
||||
</div>
|
||||
<span className="nebula-expedition-stats" role="list" aria-label={content.chosenStats}>{STAT_IDS.map((stat) => {
|
||||
const label = `${content.stats[stat]} : ${formatDecimal(card.stats[stat])}`;
|
||||
return <Tooltip key={stat} className="nebula-expedition-stat" content={content.stats[stat]} role="listitem" aria-label={label} tabIndex={-1} data-sorted={stat === sortKey || undefined}>
|
||||
<MaskIcon name={stat} /><span aria-hidden="true">{formatDecimal(card.stats[stat])}</span>
|
||||
</Tooltip>;
|
||||
})}</span>
|
||||
<span className="nebula-expedition-card-tags">
|
||||
{helps.condition && <span className="nds-badge" data-variant="success">{content.tagCondition}</span>}
|
||||
{helps.dangers.map((danger) => <span key={danger.id} className="nds-badge" data-variant="success">{fillTemplate(content.tagParry, { label: danger.label })}</span>)}
|
||||
{helps.affinity && <span className="nds-badge" data-variant="gold">{content.tagAffinity}</span>}
|
||||
<Tooltip className="nebula-expedition-card-taglist" content={tags.length ? tags.join(" · ") : content.tagsNone} aria-label={fillTemplate(content.tagsLabel, { tags: tags.join(", ") || content.tagsNone })} tabIndex={0}>
|
||||
<MaskIcon name="tag" /><span aria-hidden="true">{tags.length}</span>
|
||||
</Tooltip>
|
||||
</span>
|
||||
</li>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue