Show a New badge when a pack reveals an unowned card edition
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 19m49s
Validate and deploy Sokko G / deploy (push) Successful in 10s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-06 10:11:57 +01:00
parent c95f767b63
commit 1adccb4e04
7 changed files with 19 additions and 5 deletions

View file

@ -213,7 +213,7 @@ function CardFace({ entry, quantity, visual, size }) {
</div>;
}
export function NebulaCard({ catalog, entry, quantity = 0, size = "lg", faceUp = true, onReveal, onRevealComplete, onConceal, onSelect, selectLabel, selected, revealed = false, replayable = false, revealLabel = "la carte", disabled = false, concealed = false, backCollection = null }) {
export function NebulaCard({ catalog, entry, quantity = 0, size = "lg", faceUp = true, onReveal, onRevealComplete, onConceal, onSelect, selectLabel, selected, revealed = false, replayable = false, revealLabel = "la carte", disabled = false, concealed = false, backCollection = null, newBadge = null }) {
const cardSize = ["sm", "md", "lg"].includes(size) ? size : "lg";
const rarity = entry.edition?.rarity || "common";
const finish = entry.edition?.finishIds?.join(" ") || "standard";
@ -309,7 +309,7 @@ export function NebulaCard({ catalog, entry, quantity = 0, size = "lg", faceUp =
const faceVisible = ["revealing", "revealed"].includes(revealPhase);
const particlesVisible = faceVisible && rarity !== "common" && openingVisual.particlePreset;
const ariaLabel = revealPhase === "revealed"
? (replayable ? `Remettre ${revealLabel} face cachée` : `${entry.card.name} révélée`)
? (replayable ? `Remettre ${revealLabel} face cachée` : `${entry.card.name} révélée${newBadge ? ", nouvelle carte" : ""}`)
: `Révéler ${revealLabel}`;
return <button
ref={cardRef}
@ -342,6 +342,7 @@ export function NebulaCard({ catalog, entry, quantity = 0, size = "lg", faceUp =
><CollectionCardBack collection={backCollection} /></span>
<CardFace entry={entry} quantity={quantity} visual={visual} size={cardSize} />
</span>
{newBadge && revealPhase === "revealed" && <span className="nds-badge nebula-card-new-badge" aria-hidden="true">{newBadge}</span>}
</span>
{hasAuraPalette && <><span className="nebula-card-opening-aura-palette" aria-hidden="true" /><span className="nebula-card-opening-crown-palette" aria-hidden="true" /><span className="nebula-card-opening-glow-palette" aria-hidden="true"><span /></span></>}
{particlesVisible && <span className="nebula-card-particles" aria-hidden="true">{rarity === "mythic" && <><span className="nebula-card-particle-ring-glow" data-glow="outer"><span><span /></span></span><span className="nebula-card-particle-ring-glow" data-glow="inner"><span><span /></span></span></>}{Array.from({ length: openingVisual.particlePreset.count }, (_, index) => <i key={index} style={particlePosition(index, openingVisual.particlePreset.count, rarity === "legendary" || rarity === "mythic", openingVisual.particlePalette?.colors[index % openingVisual.particlePalette.colors.length])} />)}</span>}