Compare commits
2 commits
24992e5502
...
80fe7fadad
| Author | SHA1 | Date | |
|---|---|---|---|
| 80fe7fadad | |||
| bd1da42c7f |
10 changed files with 79 additions and 7 deletions
|
|
@ -311,3 +311,6 @@
|
|||
{"id":"int-d86ad22e3bc9217bedf6fdd88235a3a3","kind":"field_change","created_at":"2026-11-07T23:01:17.554482472Z","actor":"Shinuwa","issue_id":"sokko-g-a66i","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Compteur séparé pour /api/cards/reserve et relectures espacées."}}
|
||||
{"id":"int-3c8c952dedff3bd70a87bbed86a36755","kind":"field_change","created_at":"2026-11-08T08:15:47.101549921Z","actor":"Shinuwa","issue_id":"sokko-g-84oq","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Limites par minute levées sur le serveur de dev ; check:full vert sans 429."}}
|
||||
{"id":"int-e227d3aed0b8c346f255680b2a7991cd","kind":"field_change","created_at":"2026-11-08T18:04:55.995286972Z","actor":"Shinuwa","issue_id":"sokko-g-dxak","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"82 descriptions + description de collection réécrites (monde-archipel, ~150 car.)"}}
|
||||
{"id":"int-4de6c9ae13ca807c814f65382fb642ef","kind":"field_change","created_at":"2026-11-08T19:48:08.53725125Z","actor":"Shinuwa","issue_id":"sokko-g-41qz","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Effet prismatic-backdrop ajouté (sous-couche irisée + surcouche brillante), testé avec l'illustration kitsune"}}
|
||||
{"id":"int-633284aa6fc744bf308c88c771084e6a","kind":"field_change","created_at":"2026-11-08T20:02:42.172749274Z","actor":"Shinuwa","issue_id":"sokko-g-dpmx","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"fullCutoutImage (__full__cutout.webp) ajouté, utilisé par l'Écrin prismatique en pleine illustration et dans l'atelier visuel"}}
|
||||
{"id":"int-1a0d33af6e6918e44355b03fbe79c01f","kind":"field_change","created_at":"2026-11-08T20:24:22.325406842Z","actor":"Shinuwa","issue_id":"sokko-g-3e9e","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"cutoutImage ajouté et utilisé en Standard ; image redimensionnée en 800x800"}}
|
||||
|
|
|
|||
|
|
@ -798,7 +798,16 @@ test("administrator navigates sections, manages mythic content and previews visu
|
|||
expect(Math.abs((mythicBox.x - gridBox.x) - (gridBox.x + gridBox.width - mythicBox.x - mythicBox.width))).toBeLessThanOrEqual(1);
|
||||
|
||||
const effectStyles = page.locator(".nebula-admin-effect-grid .nebula-admin-style-card");
|
||||
await expect(effectStyles.locator("h4")).toHaveText(["Prisme spectral", "Reflet diffractif"]);
|
||||
await expect(effectStyles.locator("h4")).toHaveText(["Prisme spectral", "Reflet diffractif", "Écrin prismatique"]);
|
||||
// L'Écrin prismatique affiche la version à zones vides de chaque format : sa sous-couche se voit à travers.
|
||||
const backdropStyle = effectStyles.filter({ has: page.getByRole("heading", { name: "Écrin prismatique", exact: true }) });
|
||||
const backdropCard = backdropStyle.locator('.nebula-card[data-holo-effect="prismatic-backdrop"]');
|
||||
await expect(backdropCard.locator('.nebula-card-art img[src$="/mythic_card_pull__cutout.webp"]')).toBeVisible();
|
||||
await expect(backdropCard.locator(".nebula-card-art .nebula-card-holo-underlay")).toHaveCSS("display", "block");
|
||||
await chooseOption(backdropStyle, "Format", "Pleine illustration");
|
||||
await expect(backdropCard.locator('.nebula-card-art img[src$="/mythic_card_pull__full__cutout.webp"]')).toBeVisible();
|
||||
await chooseOption(backdropStyle, "Format", "Standard");
|
||||
await expect(effectStyles.filter({ has: page.getByRole("heading", { name: "Prisme spectral", exact: true }) }).locator(".nebula-card-holo-underlay")).toHaveCount(0);
|
||||
const spectralStyle = effectStyles.filter({ has: page.getByRole("heading", { name: "Prisme spectral", exact: true }) });
|
||||
// Les aperçus holographiques gardent le vrai format `lg`, 300 x 420 px.
|
||||
const holoPreviewBox = await spectralStyle.locator(".nebula-admin-style-preview > .nebula-card").boundingBox();
|
||||
|
|
|
|||
|
|
@ -124,6 +124,12 @@ export function validateCardsCatalog(catalog) {
|
|||
if (!card.description || card.description.length > 200) throw new TypeError(`Card ${card.id} description must contain 1 to 200 characters.`);
|
||||
if (card.image != null && !CARD_IMAGE_PATTERN.test(card.image)) throw new TypeError(`Card ${card.id} image must use a canonical WebP path.`);
|
||||
if (card.fullImage != null && !CARD_IMAGE_PATTERN.test(card.fullImage)) throw new TypeError(`Card ${card.id} full image must use a canonical WebP path.`);
|
||||
// Illustrations à zones vides : même fichier que l'illustration de leur format, suffixé `__cutout`, pour les effets à sous-couche.
|
||||
for (const [cutoutKey, imageKey, label] of [["cutoutImage", "image", "image"], ["fullCutoutImage", "fullImage", "full image"]]) {
|
||||
if (card[cutoutKey] != null && (!card[imageKey] || card[cutoutKey] !== card[imageKey].replace(/\.webp$/, "__cutout.webp"))) {
|
||||
throw new TypeError(`Card ${card.id} ${cutoutKey === "cutoutImage" ? "cutout" : "full cutout"} image must be its ${label} suffixed with __cutout.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const edition of catalog.editions) {
|
||||
|
|
|
|||
|
|
@ -128,7 +128,17 @@ test("full-art mythics need a full image and declare one per legendary card", as
|
|||
assert.ok(card.fullImage, `${cardId} needs a full image`);
|
||||
await access(`website/public${card.image}`);
|
||||
await access(`website/public${card.fullImage}`);
|
||||
if (card.cutoutImage) await access(`website/public${card.cutoutImage}`);
|
||||
if (card.fullCutoutImage) await access(`website/public${card.fullCutoutImage}`);
|
||||
}
|
||||
// Une illustration à zones vides reprend le nom de l'illustration pleine, suffixé `__cutout`.
|
||||
assert.ok(baseCatalog.cards.some((card) => card.fullCutoutImage?.endsWith("__full__cutout.webp")));
|
||||
const wrongCutout = structuredClone(rawCatalog);
|
||||
wrongCutout.cards.find((card) => card.id === "mythic-card-pull").fullCutoutImage = "/static/img/cards/astral-genesis/legendary/mythic_card_pull__cutout.webp";
|
||||
assert.throws(() => prepareVersionedCatalog(wrongCutout), /suffixed with __cutout/);
|
||||
const wrongStandardCutout = structuredClone(rawCatalog);
|
||||
wrongStandardCutout.cards.find((card) => card.id === "mythic-card-pull").cutoutImage = "/static/img/cards/astral-genesis/legendary/mythic_card_pull__full__cutout.webp";
|
||||
assert.throws(() => prepareVersionedCatalog(wrongStandardCutout), /cutout image must be its image suffixed/);
|
||||
const directory = await mkdtemp(join(tmpdir(), "sokkog-cards-full-art-"));
|
||||
const database = new CardsDatabase(join(directory, "cards.sqlite"));
|
||||
t.after(async () => {
|
||||
|
|
@ -232,7 +242,7 @@ test("finishes are generated: standard plus one per holographic effect and seven
|
|||
assert.equal("finishes" in rawCatalog, false);
|
||||
const preset = catalog.effectPresets.find((effect) => effect.id === "spectral-prism");
|
||||
assert.equal(preset.kind, "holographic");
|
||||
assert.deepEqual(catalog.finishes.map((finish) => finish.id), ["standard", ...["", "full-art-"].flatMap((format) => ["spectral-prism", "diffraction-sheen"].flatMap((effect) => ["rainbow", "solar", "dusk", "crimson", "nature", "aurora", "winter", "cosmic", "darkness"].map((palette) => `${format}${effect}-${palette}`)))]);
|
||||
assert.deepEqual(catalog.finishes.map((finish) => finish.id), ["standard", ...["", "full-art-"].flatMap((format) => ["spectral-prism", "diffraction-sheen", "prismatic-backdrop"].flatMap((effect) => ["rainbow", "solar", "dusk", "crimson", "nature", "aurora", "winter", "cosmic", "darkness"].map((palette) => `${format}${effect}-${palette}`)))]);
|
||||
assert.deepEqual(catalog.finishes[0], { id: "standard", label: "Standard", effectPresetId: null, paletteId: null, formatId: "standard" });
|
||||
assert.ok(catalog.finishes.every((finish) => !("particlePresetId" in finish)));
|
||||
assert.ok(catalog.effectPalettes.every((palette) => palette.colors.length === 7 && new Set(palette.colors).size === 7));
|
||||
|
|
@ -245,7 +255,7 @@ test("finishes are generated: standard plus one per holographic effect and seven
|
|||
withNewEffect.effectPresets.push({ id: "effect-x", kind: "holographic", label: "Effet X" });
|
||||
withNewEffect.effectPalettes.push({ id: "ember", label: "Braise", colors: ["#7f1d1d", "#b91c1c", "#ef4444", "#f97316", "#fb923c", "#fdba74", "#fff7ed"], highlight: "#ffffff" });
|
||||
const generated = prepareVersionedCatalog(withNewEffect).finishes;
|
||||
assert.equal(generated.length, 1 + 2 * 3 * 10);
|
||||
assert.equal(generated.length, 1 + 2 * 4 * 10);
|
||||
assert.deepEqual(generated.find((finish) => finish.id === "effect-x-ember"), { id: "effect-x-ember", label: "Effet X — Braise", effectPresetId: "effect-x", paletteId: "ember", formatId: "standard" });
|
||||
|
||||
const invalidPalette = structuredClone(rawCatalog);
|
||||
|
|
|
|||
|
|
@ -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 |
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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 };
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue