Add the Prismatic Backdrop holographic effect for cutout artwork

The new mythic effect works on two levels. An opaque iridescent film is
painted under the artwork and only shows through its transparent areas,
while a light overlay makes the whole card shine. Both follow the card
tilt without any running animation, like the Diffraction Sheen.

Cards can declare cutout versions of their artwork with the __cutout
suffix: cutoutImage for the standard format and fullCutoutImage for the
full-art format. The catalog only accepts the format's own image name
followed by __cutout. Prismatic Backdrop finishes use them when present
and fall back to the opaque artwork otherwise. The Mythic Card Pull gets
both cutout versions, and the admin visual lab previews the effect on them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-08 21:33:35 +01:00
parent 24992e5502
commit bd1da42c7f
9 changed files with 76 additions and 7 deletions

View file

@ -47,6 +47,11 @@
"id": "diffraction-sheen",
"kind": "holographic",
"label": "Reflet diffractif"
},
{
"id": "prismatic-backdrop",
"kind": "holographic",
"label": "Écrin prismatique"
}
],
"cardFormats": [
@ -940,7 +945,9 @@
"name": "La Pioche Mythique",
"description": "On raconte que le Dragon du Néant Étoilé resta sans voix devant une carte mythique. Depuis, il ouvre chaque booster avec le même espoir.",
"image": "/static/img/cards/astral-genesis/legendary/mythic_card_pull.webp",
"fullImage": "/static/img/cards/astral-genesis/legendary/mythic_card_pull__full.webp"
"cutoutImage": "/static/img/cards/astral-genesis/legendary/mythic_card_pull__cutout.webp",
"fullImage": "/static/img/cards/astral-genesis/legendary/mythic_card_pull__full.webp",
"fullCutoutImage": "/static/img/cards/astral-genesis/legendary/mythic_card_pull__full__cutout.webp"
},
{
"id": "crimson-card-trade",

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 KiB

View file

@ -4,6 +4,8 @@ import { CollectionCardBack } from "./CollectionCardBack.jsx";
import { MATCH_HOLO_PALETTE_ID, MATCH_HOLO_PALETTE_LABEL, resolveMythicOpeningStyle, resolveOpeningEffect } from "./openingEffects.js";
const STANDARD_CARD_LAYOUT = "standard";
// Effets holographiques peints sous l'illustration, visibles seulement à travers ses zones transparentes.
const UNDERLAY_EFFECTS = new Set(["prismatic-backdrop"]);
function useCardTilt() {
const cardRef = useRef(null);
@ -188,7 +190,9 @@ function CardFace({ entry, quantity, visual, size }) {
// Pleine illustration : l'image remplit la carte et seul le nom reste, gravé par-dessus.
const fullArt = visual.layout !== STANDARD_CARD_LAYOUT;
const showDetails = size === "lg" && !fullArt;
const image = (fullArt && card.fullImage) || card.image;
// Les effets à sous-couche préfèrent l'illustration à zones vides (`__cutout`) : la sous-couche apparaît à travers ses vides.
const cutout = UNDERLAY_EFFECTS.has(visual.effectPreset?.id) && (fullArt ? card.fullCutoutImage : card.cutoutImage);
const image = cutout || (fullArt && card.fullImage) || card.image;
return <div
className="nebula-card-face"
data-card-layout={visual.layout}
@ -197,7 +201,11 @@ function CardFace({ entry, quantity, visual, size }) {
data-holo-effect={visual.effectPreset?.id}
data-holo-palette={visual.palette?.id}
>
<div className={`nebula-card-art ${image ? "has-image" : ""}`} aria-hidden="true">{image ? <img src={image} alt="" loading={size === "lg" ? "eager" : "lazy"} decoding="async" /> : <span className="nebula-card-placeholder-mark" />}</div>
<div className={`nebula-card-art ${image ? "has-image" : ""}`} aria-hidden="true">
{/* Sous-couche holographique : peinte sous l'illustration, elle n'apparaît qu'à travers ses zones transparentes. */}
{UNDERLAY_EFFECTS.has(visual.effectPreset?.id) && <span className="nebula-card-holo-underlay" />}
{image ? <img src={image} alt="" loading={size === "lg" ? "eager" : "lazy"} decoding="async" /> : <span className="nebula-card-placeholder-mark" />}
</div>
{showName && <h3><span>{card.name}</span></h3>}
{showDetails && <div className="nebula-card-copy">
<p>{card.description}</p>

View file

@ -52,7 +52,8 @@ function OpeningEffectPreview({ catalog, lookup, effect }) {
function HolographicEffectPreview({ catalog, effect, editions, previewCard }) {
const finishes = catalog.finishes.filter((finish) => finish.effectPresetId === effect.id);
const [paletteId, setPaletteId] = useState(finishes[0]?.paletteId || catalog.effectPalettes[0]?.id || "");
const [formatId, setFormatId] = useState("standard");
// Un effet à sous-couche s'ouvre en pleine illustration quand la carte en a une version à zones vides et pas la version standard.
const [formatId, setFormatId] = useState(effect.id === "prismatic-backdrop" && previewCard.fullCutoutImage && !previewCard.cutoutImage ? "full-art" : "standard");
// Chaque combinaison format × effet × palette existe déjà comme finition générée.
const finishId = finishes.find((finish) => finish.paletteId === paletteId && finish.formatId === formatId)?.id || finishes[0]?.id;
const edition = { id: `admin-effect-preview-${effect.id}`, cardId: previewCard.id, rarity: "mythic", finishIds: [finishId], promotional: false };

View file

@ -242,6 +242,34 @@ button.nebula-card { cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
.nebula-card[data-holo-effect="diffraction-sheen"]:hover .nebula-card-face, .nebula-card[data-holo-effect="diffraction-sheen"]:focus-visible .nebula-card-face { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1), 0 18px 38px color-mix(in srgb, var(--holo-4) 16%, transparent), var(--shadow-md); }
}
/* Écrin prismatique : deux niveaux. Sous l'illustration, un film irisé opaque n'apparaît qu'à travers les zones transparentes
de l'image ; par-dessus, une surcouche discrète fait seulement briller la carte. Tout suit le tilt, sans animation. */
.nebula-card-holo-underlay { position: absolute; inset: 0; display: none; pointer-events: none; }
.nebula-card[data-holo-effect="prismatic-backdrop"] { --backdrop-angle: calc(128deg + var(--card-tilt-y) * 4 - var(--card-tilt-x) * 3); --backdrop-gloss-rest: 0.06; }
.nebula-card[data-holo-effect="prismatic-backdrop"] .nebula-card-holo-underlay {
display: block;
/* De haut en bas : point lumineux, voile nacré, trame diamant du film, interférences, puis bandes irisées répétées. */
background-image:
radial-gradient(circle at var(--card-pointer-x) var(--card-pointer-y), color-mix(in srgb, var(--holo-highlight) 70%, transparent), transparent 36%),
linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3)),
repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.5) 0 1px, transparent 1px 4px),
repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.5) 0 1px, transparent 1px 4px),
repeating-linear-gradient(calc(var(--backdrop-angle) - 72deg), var(--holo-4) 0%, var(--holo-6) 4%, var(--holo-1) 8%, var(--holo-3) 12%, var(--holo-5) 16%, var(--holo-7) 20%, var(--holo-2) 24%, var(--holo-4) 28%),
repeating-linear-gradient(var(--backdrop-angle), var(--holo-1) 0%, var(--holo-2) 6%, var(--holo-3) 12%, var(--holo-4) 18%, var(--holo-5) 24%, var(--holo-6) 30%, var(--holo-7) 36%, var(--holo-1) 42%);
background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 160% 160%, 180% 180%;
background-position: 0 0, 0 0, 0 0, 0 0, var(--card-pointer-x) var(--card-pointer-y), calc(100% - var(--card-pointer-x)) calc(100% - var(--card-pointer-y));
background-blend-mode: screen, soft-light, overlay, overlay, soft-light, normal;
filter: saturate(0.9) brightness(1.06);
}
.nebula-card[data-holo-effect="prismatic-backdrop"] .nebula-card-holo-layer { transition: none; }
.nebula-card[data-holo-effect="prismatic-backdrop"] .nebula-card-holo-primary { opacity: calc(0.05 + var(--card-tilt-energy) * 0.16); background-image: linear-gradient(var(--backdrop-angle), var(--holo-1), var(--holo-3), var(--holo-5), var(--holo-7), var(--holo-2), var(--holo-4), var(--holo-6)); background-size: 240% 240%; background-position: var(--card-pointer-x) var(--card-pointer-y); mix-blend-mode: overlay; }
.nebula-card[data-holo-effect="prismatic-backdrop"] .nebula-card-holo-secondary { opacity: calc(var(--backdrop-gloss-rest) + var(--card-tilt-energy) * 0.42); background-image: linear-gradient(var(--backdrop-angle), transparent 34%, color-mix(in srgb, var(--holo-highlight) 55%, white) 50%, transparent 66%); background-size: 260% 260%; background-position: calc(100% - var(--card-pointer-x)) calc(100% - var(--card-pointer-y)); mix-blend-mode: soft-light; }
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
.nebula-card[data-holo-effect="prismatic-backdrop"] { --backdrop-gloss-rest: 0.22; }
}
@media (hover: hover) and (pointer: fine) {
.nebula-card[data-holo-effect="prismatic-backdrop"]:hover .nebula-card-face, .nebula-card[data-holo-effect="prismatic-backdrop"]:focus-visible .nebula-card-face { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1), 0 18px 38px color-mix(in srgb, var(--holo-4) 16%, transparent), var(--shadow-md); }
}
.nebula-card-reveal:focus-visible, .nebula-card-select:focus-visible { outline: 3px solid var(--color-accent-gold); outline-offset: 5px; }
.nebula-card-particles { position: absolute; inset: 50%; z-index: 8; color: var(--opening-aura, var(--card-rarity, var(--color-primary))); pointer-events: none; }
.nebula-card-reveal[data-reveal-phase="revealed"] .nebula-card-particles { display: none; }