Replace the prismatic backdrop with a prismatic parallax and redraw the Long Night legendaries
The prismatic-backdrop finish, now labelled « Parallaxe prismatique », lays a card's cut-out hero over a backdrop without it and shifts both with the tilt, the palette tinting the backdrop, lighting each layer's highlights and fringing the hero. Cards declare the backdrop next to the cutout (backdropImage, fullBackdropImage), validated by name. The Visual Lab is back to its usual effect cards. The three Long Night legendaries are redrawn in the collection's style, and La Pioche Mythique gets its parallax layers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3f70a5638d
commit
efdb5c558c
27 changed files with 279 additions and 50 deletions
|
|
@ -4,8 +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"]);
|
||||
// Effets holographiques qui découpent l'illustration en calques de parallaxe (décor, puis héros détouré).
|
||||
const PARALLAX_EFFECTS = new Set(["prismatic-backdrop"]);
|
||||
|
||||
function useCardTilt() {
|
||||
const cardRef = useRef(null);
|
||||
|
|
@ -35,6 +35,9 @@ function useCardTilt() {
|
|||
card.style.setProperty("--card-lift", `${current.lift.toFixed(2)}px`);
|
||||
card.style.setProperty("--card-pointer-x", `${current.pointerX.toFixed(1)}%`);
|
||||
card.style.setProperty("--card-pointer-y", `${current.pointerY.toFixed(1)}%`);
|
||||
// Tilt normalisé (-1 à 1) : +1 quand le pointeur est au bord droit ou au bord bas. Les calques de parallaxe s'en servent.
|
||||
card.style.setProperty("--card-tilt-nx", (current.y / 5).toFixed(3));
|
||||
card.style.setProperty("--card-tilt-ny", (-current.x / 4).toFixed(3));
|
||||
// Énergie du tilt (0 à 1) : nulle au repos, modérée sur une carte à plat, maximale sur les bords.
|
||||
const engaged = Math.min(1, current.lift / -4);
|
||||
const inclination = Math.min(1, Math.hypot(current.x / 4, current.y / 5));
|
||||
|
|
@ -96,6 +99,22 @@ function useCardTilt() {
|
|||
|
||||
return cardRef;
|
||||
}
|
||||
|
||||
// Calques de parallaxe, deux au plus : le décor sans le héros puis le héros détouré. `depth` vaut 1 au fond, 0 au plan de la
|
||||
// carte et devient négatif devant. Sans plaque de décor, le composite la remplace (mode de compatibilité) ; sans héros détouré,
|
||||
// l'illustration reste un seul plan immobile, qui garde le prisme de la palette.
|
||||
function resolveParallaxLayers(card, fullArt, compositeImage) {
|
||||
const cutout = fullArt ? card.fullCutoutImage : card.cutoutImage;
|
||||
const backdrop = fullArt ? card.fullBackdropImage : card.backdropImage;
|
||||
if (!cutout) return compositeImage ? { setup: "flat", layers: [{ id: "backdrop", role: "backdrop", depth: 0, src: compositeImage }] } : null;
|
||||
return {
|
||||
setup: backdrop ? "clean" : "compat",
|
||||
layers: [
|
||||
{ id: "backdrop", role: "backdrop", depth: 1, src: backdrop || compositeImage },
|
||||
{ id: "subject", role: "subject", depth: -0.2, src: cutout }
|
||||
]
|
||||
};
|
||||
}
|
||||
function RaritySymbol({ rarity, label }) {
|
||||
return <span className="nebula-card-rarity-symbol" data-rarity={rarity} title={label}>
|
||||
<svg viewBox="0 0 32 32" aria-hidden="true">
|
||||
|
|
@ -195,9 +214,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;
|
||||
// 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;
|
||||
const image = (fullArt && card.fullImage) || card.image;
|
||||
const parallax = PARALLAX_EFFECTS.has(visual.effectPreset?.id) ? resolveParallaxLayers(card, fullArt, image) : null;
|
||||
const loading = size === "lg" ? "eager" : "lazy";
|
||||
return <div
|
||||
className="nebula-card-face"
|
||||
data-card-layout={visual.layout}
|
||||
|
|
@ -206,10 +225,19 @@ 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">
|
||||
{/* 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 className={`nebula-card-art ${image ? "has-image" : ""}`} data-parallax-setup={parallax?.setup} aria-hidden="true">
|
||||
{/* Chaque calque porte sa profondeur ; son image sert aussi de masque au reflet prismatique qui ne touche que lui. */}
|
||||
{parallax ? parallax.layers.map((layer, index) => <span
|
||||
key={layer.id}
|
||||
className="nebula-card-depth-layer"
|
||||
data-depth-layer={layer.id}
|
||||
data-depth-role={layer.role}
|
||||
style={{ "--layer-depth": layer.depth, "--layer-depth-abs": Math.abs(layer.depth), "--layer-index": index, "--layer-image": `url("${layer.src}")`, zIndex: index }}
|
||||
>
|
||||
<img src={layer.src} alt="" loading={loading} decoding="async" />
|
||||
{layer.role === "backdrop" && <span className="nebula-card-depth-tint" />}
|
||||
<span className="nebula-card-depth-foil" />
|
||||
</span>) : image ? <img src={image} alt="" loading={loading} decoding="async" /> : <span className="nebula-card-placeholder-mark" />}
|
||||
</div>
|
||||
{showName && <h3><span>{card.name}</span></h3>}
|
||||
{showDetails && <div className="nebula-card-copy">
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ 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 || "");
|
||||
// Un effet à sous-couche s'ouvre en pleine illustration quand la carte en a une version à zones vides et pas la version standard.
|
||||
// La parallaxe s'ouvre en pleine illustration quand la carte n'a de héros détouré que dans ce format.
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@
|
|||
.nebula-opening-odds :is(h3, p) { margin: 0; }
|
||||
.nebula-opening-odds h3 { font-size: var(--font-size-sm); }
|
||||
|
||||
.nebula-card { --card-tilt-x: 0deg; --card-tilt-y: 0deg; --card-pointer-x: 50%; --card-pointer-y: 35%; --card-lift: 0px; --card-tilt-energy: 0; position: relative; isolation: isolate; display: block; width: 100%; max-width: 300px; aspect-ratio: 5 / 7; padding: 0; border: 0; border-radius: 16px; background: transparent; color: inherit; text-align: left; perspective: 1200px; }
|
||||
.nebula-card { --card-tilt-x: 0deg; --card-tilt-y: 0deg; --card-pointer-x: 50%; --card-pointer-y: 35%; --card-lift: 0px; --card-tilt-energy: 0; --card-tilt-nx: 0; --card-tilt-ny: 0; position: relative; isolation: isolate; display: block; width: 100%; max-width: 300px; aspect-ratio: 5 / 7; padding: 0; border: 0; border-radius: 16px; background: transparent; color: inherit; text-align: left; perspective: 1200px; }
|
||||
.nebula-card[data-card-size="sm"] { max-width: 118px; }
|
||||
.nebula-card[data-card-size="md"] { max-width: 180px; }
|
||||
.nebula-card::before { position: absolute; inset: -8px; content: ""; border-radius: 22px; }
|
||||
|
|
@ -401,34 +401,66 @@ $diffraction-glitter-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/
|
|||
@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);
|
||||
/* Parallaxe prismatique (`prismatic-backdrop`) : l'illustration empile au plus deux calques, le décor sans le héros puis le héros
|
||||
détouré, chacun décalé au tilt selon sa profondeur (`--layer-depth` : 1 au fond, 0 au plan de la carte, négatif devant).
|
||||
`--parallax-reach` est la course du calque le plus lointain, en fraction de sa largeur ; l'agrandissement de chaque calque
|
||||
couvre exactement sa course, pour qu'aucun bord ne se découvre. Sans héros détouré, l'illustration reste un seul plan immobile. */
|
||||
.nebula-card-depth-layer {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
isolation: isolate;
|
||||
transform:
|
||||
translate3d(calc(var(--card-tilt-nx) * var(--layer-depth) * var(--parallax-reach, 0.045) * -100%), calc(var(--card-tilt-ny) * var(--layer-depth) * var(--parallax-reach, 0.045) * -100%), 0)
|
||||
scale(calc(1 + var(--layer-depth-abs) * var(--parallax-reach, 0.045) * 2.2));
|
||||
will-change: transform;
|
||||
}
|
||||
.nebula-card-depth-tint, .nebula-card-depth-foil { position: absolute; inset: 0; pointer-events: none; }
|
||||
/* Prisme, en trois touches liées à la profondeur :
|
||||
1. le décor prend la teinte de la palette dans ses zones sombres (overlay épargne les lumières chaudes), et cette teinte glisse avec l'angle ;
|
||||
2. chaque calque irise ses hautes lumières (color-dodge laisse les ombres intactes), avec une phase propre à sa profondeur :
|
||||
au tilt, les plans changent de couleur à des rythmes différents, comme la lumière dans un prisme ;
|
||||
3. la silhouette du héros se frange de deux couleurs opposées de la palette, décalées en sens inverse. */
|
||||
.nebula-card[data-holo-effect="prismatic-backdrop"] { --prism-angle: calc(118deg + var(--card-tilt-nx) * 28deg - var(--card-tilt-ny) * 16deg); }
|
||||
.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; }
|
||||
.nebula-card[data-holo-effect="prismatic-backdrop"] .nebula-card-holo-primary { opacity: 0; }
|
||||
.nebula-card[data-holo-effect="prismatic-backdrop"] .nebula-card-holo-secondary {
|
||||
opacity: calc(var(--card-tilt-energy) * 0.22);
|
||||
background: radial-gradient(circle at var(--card-pointer-x) var(--card-pointer-y), color-mix(in srgb, var(--holo-highlight) 62%, white), transparent 30%);
|
||||
mix-blend-mode: soft-light;
|
||||
}
|
||||
.nebula-card-depth-tint {
|
||||
background-image: linear-gradient(var(--prism-angle), var(--holo-1), var(--holo-2), var(--holo-3), var(--holo-4), var(--holo-5), var(--holo-6), var(--holo-7), var(--holo-1));
|
||||
background-size: 260% 260%;
|
||||
background-position: calc(50% + var(--card-tilt-nx) * 40%) calc(50% + var(--card-tilt-ny) * 30%);
|
||||
mix-blend-mode: overlay;
|
||||
opacity: calc(0.5 + var(--card-tilt-energy) * 0.4);
|
||||
}
|
||||
.nebula-card-depth-foil {
|
||||
background-image: repeating-linear-gradient(var(--prism-angle), var(--holo-1) 0%, var(--holo-2) 5%, var(--holo-3) 10%, var(--holo-4) 15%, var(--holo-5) 20%, var(--holo-6) 25%, var(--holo-7) 30%, var(--holo-1) 35%);
|
||||
background-size: 300% 300%;
|
||||
background-position: calc(50% + var(--layer-index) * 17% + var(--card-tilt-nx) * var(--layer-depth) * 55%) calc(50% + var(--card-tilt-ny) * var(--layer-depth) * 40%);
|
||||
mask: var(--layer-image) center / cover no-repeat;
|
||||
mix-blend-mode: color-dodge;
|
||||
opacity: calc(0.1 + var(--card-tilt-energy) * 0.38);
|
||||
}
|
||||
/* Le décor est déjà teinté : son reflet reste léger, sinon les couleurs claires d'une palette y tracent des traits trop nets. */
|
||||
[data-depth-role="backdrop"] > .nebula-card-depth-foil { opacity: calc(0.04 + var(--card-tilt-energy) * 0.16); }
|
||||
[data-depth-role="subject"] > .nebula-card-depth-foil {
|
||||
background-position: calc(50% + var(--layer-index) * 17% + var(--card-tilt-nx) * 30%) calc(50% + var(--card-tilt-ny) * 22%);
|
||||
opacity: calc(0.04 + var(--card-tilt-energy) * 0.24);
|
||||
}
|
||||
[data-depth-role="subject"] > img {
|
||||
filter:
|
||||
drop-shadow(calc(var(--card-tilt-nx) * 3px) calc(var(--card-tilt-ny) * 2px) 1.5px color-mix(in srgb, var(--holo-2) calc(var(--card-tilt-energy) * 85%), transparent))
|
||||
drop-shadow(calc(var(--card-tilt-nx) * -3px) calc(var(--card-tilt-ny) * -2px) 1.5px color-mix(in srgb, var(--holo-6) calc(var(--card-tilt-energy) * 85%), transparent))
|
||||
drop-shadow(0 6px 10px rgba(5, 7, 17, 0.34));
|
||||
}
|
||||
@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); }
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.nebula-card-depth-layer { transform: none; will-change: auto; }
|
||||
}
|
||||
.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; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue