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>
29 lines
1.3 KiB
JavaScript
29 lines
1.3 KiB
JavaScript
/**
|
||
* @file Affiche les deux monnaies de Sokko TCG, la poussière d'étoiles et les Éclats d'étoile, avec leur
|
||
* icône.
|
||
*
|
||
* Les icônes sont des images (static/icons) : leurs dégradés SVG ne peuvent pas entrer en conflit avec la
|
||
* page.
|
||
*/
|
||
|
||
import { formatEclats } from "./expeditions/expeditionFormat.js";
|
||
import { formatStardust } from "./stardustFormat.js";
|
||
|
||
const ICONS = { stardust: "/static/icons/stardust.svg", eclats: "/static/icons/eclat.svg" };
|
||
|
||
export function CurrencyIcon({ kind }) {
|
||
return <img className="nebula-currency-icon" data-currency={kind} src={ICONS[kind]} alt="" aria-hidden="true" />;
|
||
}
|
||
|
||
// Icône suivie d'un texte libre (« 70 Éclats ») dans un bouton ou un badge : un seul bloc en ligne, aligné sur le texte.
|
||
export function CurrencyAmount({ kind, children }) {
|
||
return <span className="nebula-currency-amount"><CurrencyIcon kind={kind} />{children}</span>;
|
||
}
|
||
|
||
export function StardustBalance({ value }) {
|
||
return <span className="nebula-stardust" aria-label={`${formatStardust(value)} d’étoiles`}><CurrencyIcon kind="stardust" />{value.toLocaleString("fr-FR")}</span>;
|
||
}
|
||
|
||
export function EclatsBalance({ value }) {
|
||
return <span className="nebula-eclats" aria-label={`${formatEclats(value)} Éclats d’étoile`}><CurrencyIcon kind="eclats" />{formatEclats(value)}</span>;
|
||
}
|