Show what each destination looks for and what it yields in two small panels, and keep specialties off collection destinations
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7d331d1a3f
commit
d85d6d8ffa
9 changed files with 76 additions and 36 deletions
|
|
@ -1,6 +1,7 @@
|
|||
// Rôle : prépare une expédition solo ou de groupe : destination du jour (sa difficulté est tirée avec elle), durée, équipe par rôle
|
||||
// et aperçu exact avant le départ.
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { Tooltip } from "../../components/Tooltip.jsx";
|
||||
import { previewExpedition } from "./cardsApi.js";
|
||||
import { fillTemplate } from "./dailyShare.js";
|
||||
import { conditionText, coverEntry, dangerText, editionEntry, formatDecimal, formatEclats, STAT_IDS, synergyLabels } from "./expeditionFormat.js";
|
||||
|
|
@ -14,16 +15,32 @@ const LOOT_KINDS = ["eclats", "stardust", "cards", "items"];
|
|||
// Vocation d'une carte (son plan de progression) : icône de la stat de son rôle à côté de sa Puissance.
|
||||
const STAT_BY_PLAN = { leader: "bravoure", guardian: "endurance", seeker: "fortune", navigator: "orientation" };
|
||||
|
||||
// Effet de la spécialité sur le butin : flèche verte sur ce qui augmente, rouge sur ce qui baisse.
|
||||
// Effet de la spécialité sur le butin, regroupé par sens : une flèche verte (ce qui augmente) ou rouge (ce qui baisse) suivie
|
||||
// des icônes des butins concernés ; le pourcentage s'affiche dans l'infobulle de la flèche.
|
||||
function LootIcon({ kind }) {
|
||||
return <span className="nebula-loot-icon">{kind === "eclats" || kind === "stardust" ? <CurrencyIcon kind={kind} /> : <MaskIcon name={kind} />}</span>;
|
||||
}
|
||||
|
||||
const ARROW_PATHS = { up: "M5 1 9 5.4H6.4V9H3.6V5.4H1Z", down: "M5 9 1 4.6H3.6V1H6.4V4.6H9Z" };
|
||||
// Flèche avec son infobulle (Tooltip du NDS). Elle est dans le bouton de la destination : pas d'arrêt au clavier en plus,
|
||||
// le libellé complet est porté par la ligne (aria-label).
|
||||
function TrendArrow({ trend, label }) {
|
||||
return <Tooltip className="nebula-loot-arrow-anchor" content={label} tabIndex={-1}>
|
||||
<svg className="nebula-loot-arrow" viewBox="0 0 10 10" aria-hidden="true"><path d={ARROW_PATHS[trend]} /></svg>
|
||||
</Tooltip>;
|
||||
}
|
||||
|
||||
function LootEffects({ specialty, pct, content }) {
|
||||
if (!specialty || !pct) return null;
|
||||
return <span className="nebula-loot-effects" role="list" aria-label={content.specialties[specialty]} title={content.specialties[specialty]}>{LOOT_KINDS.map((kind) => {
|
||||
const up = kind === specialty;
|
||||
const delta = (up ? pct.boostPct : pct.otherPct) - 100;
|
||||
const label = fillTemplate(content.lootEffect, { loot: content.loot[kind], value: `${delta > 0 ? "+" : "−"}${Math.abs(delta)} %` });
|
||||
return <span key={kind} role="listitem" className="nebula-loot-effect" data-trend={up ? "up" : "down"} title={label} aria-label={label}>
|
||||
{kind === "eclats" || kind === "stardust" ? <CurrencyIcon kind={kind} /> : <MaskIcon name={kind} />}
|
||||
<svg className="nebula-loot-arrow" viewBox="0 0 10 10" aria-hidden="true"><path d={up ? "M5 1 9 5.4H6.4V9H3.6V5.4H1Z" : "M5 9 1 4.6H3.6V1H6.4V4.6H9Z"} /></svg>
|
||||
const rows = [
|
||||
{ trend: "up", delta: pct.boostPct - 100, kinds: LOOT_KINDS.filter((kind) => kind === specialty) },
|
||||
{ trend: "down", delta: pct.otherPct - 100, kinds: LOOT_KINDS.filter((kind) => kind !== specialty) }
|
||||
].filter((row) => row.delta && row.kinds.length);
|
||||
return <span className="nebula-loot-effects" role="list" aria-label={content.specialties[specialty]}>{rows.map(({ trend, delta, kinds }) => {
|
||||
const label = fillTemplate(content.lootEffect, { loot: kinds.map((kind) => content.loot[kind]).join(", "), value: `${delta > 0 ? "+" : "−"}${Math.abs(delta)} %` });
|
||||
return <span key={trend} role="listitem" className="nebula-loot-effect" data-trend={trend} aria-label={label}>
|
||||
<TrendArrow trend={trend} label={label} />
|
||||
<span className="nebula-loot-icons" aria-hidden="true">{kinds.map((kind) => <LootIcon key={kind} kind={kind} />)}</span>
|
||||
</span>;
|
||||
})}</span>;
|
||||
}
|
||||
|
|
@ -146,10 +163,18 @@ export function ExpeditionPlanner({ catalog, view, mode = "solo", content, busy,
|
|||
<strong>{item.name}<StarsBadge stars={group ? item.groupStar : item.soloStar} content={content} />{item.bonusSlot && <span className="nds-badge" data-variant="gold">{content.bonusSlots[item.bonusSlot]}</span>}</strong>
|
||||
<span>{item.description}</span>
|
||||
<span className="nebula-expedition-destination-facts">
|
||||
<span className="nebula-expedition-destination-roles" aria-label={content.rolesLabel}>{(group ? item.groupRoles : item.roles).map((stat) => <RoleLabel key={stat} stat={stat} content={content} />)}</span>
|
||||
<LootEffects specialty={item.specialty} pct={view.specialty} content={content} />
|
||||
<span className="nebula-destination-fact">
|
||||
<span className="nebula-destination-fact-title">{content.profileTitle}</span>
|
||||
<span className="nebula-expedition-destination-roles">{(group ? item.groupRoles : item.roles).map((stat) => <RoleLabel key={stat} stat={stat} content={content} />)}</span>
|
||||
</span>
|
||||
{(item.specialty || collection) && <span className="nebula-destination-fact">
|
||||
<span className="nebula-destination-fact-title">{content.lootTitle}</span>
|
||||
<LootEffects specialty={item.specialty} pct={view.specialty} content={content} />
|
||||
{collection && <span className="nebula-loot-effect" data-trend="up" data-kind="collection" aria-label={fillTemplate(content.rewardCollection, { collection })}>
|
||||
<TrendArrow trend="up" label={fillTemplate(content.rewardCollection, { collection })} /><span aria-hidden="true"><MaskIcon name="cards" />{collection}</span>
|
||||
</span>}
|
||||
</span>}
|
||||
</span>
|
||||
{collection && <span className="nebula-expedition-destination-collection" title={fillTemplate(content.rewardCollection, { collection })}><MaskIcon name="cards" />{collection}</span>}
|
||||
</span>
|
||||
</button>;
|
||||
})}</div>
|
||||
|
|
|
|||
|
|
@ -38,10 +38,12 @@
|
|||
.nebula-expedition-destination .nebula-destination-scene img { display: block; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; object-fit: cover; }
|
||||
.nebula-expedition-destination-copy { display: grid; gap: var(--space-1); min-width: 0; }
|
||||
.nebula-expedition-destination-copy > span:not(.nebula-expedition-destination-facts) { color: var(--color-text-secondary); font-size: var(--font-size-sm); text-wrap: pretty; }
|
||||
// Pied de la destination : rôles des places à gauche, effet de sa spécialité sur le butin à droite, puis la collection liée.
|
||||
.nebula-expedition-destination-facts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); margin-top: var(--space-1); }
|
||||
// Pied de la destination : deux mini-cadres, « Profil recherché » (rôles des places) et « Butin » (effet de sa spécialité et
|
||||
// collection liée).
|
||||
.nebula-expedition-destination-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: var(--space-2); margin-top: var(--space-1); }
|
||||
.nebula-destination-fact { display: grid; align-content: start; gap: var(--space-1); padding: var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.18); color: var(--color-text-primary); }
|
||||
.nebula-destination-fact-title { color: var(--color-text-secondary); font-size: var(--font-size-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
|
||||
.nebula-expedition-destination-roles { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
|
||||
.nebula-expedition-destination-collection { display: inline-flex; align-items: center; gap: 0.4em; }
|
||||
|
||||
// Icônes monochromes (static/icons) en masque, teintées par la couleur du texte.
|
||||
.nebula-mask-icon { display: inline-block; flex: 0 0 auto; width: 1.15em; height: 1.15em; background-color: currentColor; mask: var(--nebula-icon) center / contain no-repeat; -webkit-mask: var(--nebula-icon) center / contain no-repeat; }
|
||||
|
|
@ -57,13 +59,23 @@
|
|||
.nebula-role-label small { padding-left: 0.5em; border-left: 1px solid var(--color-border); color: var(--color-text-secondary); font-size: inherit; font-weight: 600; }
|
||||
.nds-button[aria-pressed="true"] .nebula-role-label small { color: inherit; opacity: 0.8; }
|
||||
|
||||
// Spécialité : l'icône de chaque butin suivie d'une flèche verte (augmente) ou rouge (baisse).
|
||||
.nebula-loot-effects { display: inline-flex; align-items: center; gap: var(--space-2); }
|
||||
.nebula-loot-effect { display: inline-flex; align-items: center; gap: 1px; color: var(--color-text-primary); font-size: var(--font-size-md); }
|
||||
.nebula-loot-effect .nebula-currency-icon { margin-right: 0; vertical-align: baseline; }
|
||||
.nebula-loot-effect[data-trend="down"] > :not(.nebula-loot-arrow) { opacity: 0.7; }
|
||||
.nebula-loot-arrow { width: 0.8em; height: 0.8em; fill: var(--color-success); }
|
||||
// Spécialité : par sens, une flèche verte (augmente) ou rouge (baisse) puis les icônes des butins ; le pourcentage est dans
|
||||
// l'infobulle de la flèche.
|
||||
.nebula-loot-effects { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
|
||||
.nebula-loot-effect { display: flex; align-items: center; gap: 0.35em; font-size: var(--font-size-sm); }
|
||||
.nebula-loot-arrow-anchor { display: inline-flex; cursor: help; }
|
||||
// Couleur portée par la flèche elle-même : l'ancre de l'infobulle impose sa propre couleur de texte.
|
||||
.nebula-loot-effect[data-trend="up"] .nebula-loot-arrow { fill: var(--color-success); }
|
||||
.nebula-loot-effect[data-trend="down"] .nebula-loot-arrow { fill: var(--color-danger); }
|
||||
// Destination liée à une collection : flèche verte, icône de carte et nom de la collection, alignés sur la première ligne.
|
||||
.nebula-loot-effect[data-kind="collection"] { align-items: flex-start; }
|
||||
.nebula-loot-effect[data-kind="collection"] > span { color: var(--color-text-primary); }
|
||||
.nebula-loot-effect[data-kind="collection"] .nebula-mask-icon { margin-right: 0.35em; vertical-align: -0.2em; }
|
||||
.nebula-loot-effect[data-kind="collection"] .nebula-loot-arrow-anchor { margin-top: 0.3em; }
|
||||
.nebula-loot-arrow { flex: 0 0 auto; width: 1em; height: 1em; }
|
||||
.nebula-loot-icons { display: inline-flex; align-items: center; gap: 0.4em; color: var(--color-text-primary); font-size: var(--font-size-md); }
|
||||
.nebula-loot-icon { display: inline-flex; }
|
||||
.nebula-loot-icon .nebula-currency-icon { margin-right: 0; vertical-align: baseline; }
|
||||
// Difficulté tirée avec la destination : badge d'étoiles après le nom, et rappelé devant les exigences.
|
||||
.nebula-expedition-destination-copy > strong { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
|
||||
.nds-badge.nebula-expedition-stars { letter-spacing: 1px; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue