Add the shattered ice effect and five-step tunings for mythic variations
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 22m39s
Validate and deploy Sokko G / deploy (push) Successful in 14s

« Glace brisée » joins the holographic effects: a seamless shard mosaic in four
facet groups that each light up near their own tilt, with glinting cracks; in
the standard layout it covers the frame and text and stays under the artwork.
Its masks come from scripts/generate-shattered-ice-textures.mjs.

Each mythic variation now tunes its palette intensity and, when the effect
declares one, its own level (prism speed, parallax amplitude, shard size), from
1 to 5 with 3 as the reference render. Tunings are stored on mythic_variations,
set with range sliders when a variation is created or later in the mythic
editor, logged in the history and previewed in the Visual Lab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-21 22:40:24 +01:00
parent efdb5c558c
commit 808adadc0c
23 changed files with 463 additions and 31 deletions

View file

@ -698,6 +698,21 @@ test("administrator navigates sections, manages mythic content and previews visu
await solarVariation.getByRole("button", { name: "Valider la nouvelle finition de Prisme spectral — Solaire" }).click();
await page.getByRole("dialog", { name: "Changer la finition de Prisme spectral — Solaire ?" }).getByRole("button", { name: "Changer la finition" }).click();
await expect(dragonVariations.locator("strong")).toHaveText(["Aurore", "Cosmique"]);
// Les paliers d'une variation, de 1 à 5 : l'aperçu suit le curseur, l'enregistrement suit quand le réglage se pose.
const tunedVariation = mythicEditorPanel.getByRole("group", { name: "Prisme spectral — Aurore" });
const tunedCard = tunedVariation.locator('.nebula-card[data-card-size="sm"]');
await tunedVariation.getByRole("slider", { name: "Intensité" }).fill("5");
await expect(tunedCard).toHaveAttribute("data-holo-intensity", "5");
await tunedVariation.getByRole("slider", { name: "Vitesse" }).fill("1");
await expect(tunedCard).toHaveAttribute("data-holo-level", "1");
const tunedEdition = async () => (await page.evaluate(() => globalThis.fetch("/api/cards/config").then((response) => response.json()))).catalog.editions.find((edition) => edition.id === "starvoid-dragon-spectral-prism-aurora");
await expect.poll(async () => { const edition = await tunedEdition(); return [edition.holoIntensity, edition.holoLevel]; }).toEqual([5, 1]);
// Retour aux paliers centraux : la variation retrouve son rendu de référence, sans attribut.
await tunedVariation.getByRole("slider", { name: "Intensité" }).fill("3");
await tunedVariation.getByRole("slider", { name: "Vitesse" }).fill("3");
await expect.poll(async () => { const edition = await tunedEdition(); return [edition.holoIntensity, edition.holoLevel]; }).toEqual([undefined, undefined]);
await expect(tunedCard).not.toHaveAttribute("data-holo-level");
await expect(tunedCard).not.toHaveAttribute("data-holo-intensity");
await mythicEditorPanel.getByRole("button", { name: "Fermer" }).click();
await expect(mythicEditorPanel).toHaveCount(0);
await expect(dragonTileButton).toHaveAttribute("aria-pressed", "false");
@ -814,6 +829,10 @@ test("administrator navigates sections, manages mythic content and previews visu
await expect(editorSurface).toHaveAttribute("data-particle-shape", "snowflakes");
await expect(editorSurface).toHaveAttribute("data-particle-palette", "match-holo");
await expect(editorSurface).toHaveCSS("--opening-aura", "#ff0000");
// Les paliers se règlent dès la création : ils s'enregistrent avec la nouvelle variation.
const draftVariation = editor.locator(".nebula-admin-mythic-variation[data-new]");
await draftVariation.getByRole("slider", { name: "Intensité" }).fill("4");
await expect(draftVariation.locator('.nebula-card[data-card-size="sm"]')).toHaveAttribute("data-holo-intensity", "4");
await editor.getByRole("button", { name: "Valider la nouvelle variation" }).click();
await expect(editor.locator(".nebula-admin-mythic-variation[data-new]")).toHaveCount(0);
await expect(editor.locator(".nebula-admin-mythic-variation")).toHaveCount(2);
@ -824,7 +843,7 @@ test("administrator navigates sections, manages mythic content and previews visu
await noOverflow();
const config = await page.evaluate(() => globalThis.fetch("/api/cards/config").then((response) => response.json()));
expect(config.catalog.editions.some((edition) => edition.id === "mythic-card-pull-spectral-prism-rainbow")).toBe(true);
expect(config.catalog.editions.find((edition) => edition.id === "mythic-card-pull-spectral-prism-rainbow")?.holoIntensity).toBe(4);
expect(config.catalog.mythicOpeningSettings).toEqual(expect.arrayContaining([
{ scope: "card", targetId: "mythic-card-pull", particleShapeId: null, particlePaletteId: "match-holo" },
{ scope: "collection", targetId: "astral-genesis", particleShapeId: "snowflakes", particlePaletteId: null }
@ -869,7 +888,12 @@ 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", "Parallaxe prismatique"]);
await expect(effectStyles.locator("h4")).toHaveText(["Prisme spectral", "Reflet diffractif", "Parallaxe prismatique", "Glace brisée"]);
const iceCard = effectStyles.filter({ has: page.getByRole("heading", { name: /Glace brisée/ }) }).locator('.nebula-card[data-holo-effect="shattered-ice"]');
await expect(iceCard.locator(".nebula-card-holo-shards > i")).toHaveCount(4);
await expect(iceCard.locator('.nebula-card-holo-shards > [data-facet="0"]')).toHaveCSS("mask-image", /shattered-ice-facet-0\.webp/);
// En format standard, la glace passe sous l'illustration, qui reste intacte.
expect(await iceCard.evaluate((element) => { const view = element.ownerDocument.defaultView; return Number(view.getComputedStyle(element.querySelector(".nebula-card-art")).zIndex) > Number(view.getComputedStyle(element.querySelector(".nebula-card-holo-shards")).zIndex); })).toBe(true);
// La Parallaxe prismatique pose le héros détouré de la carte sur son décor sans lui, puis les décale selon leur profondeur.
const parallaxStyle = effectStyles.filter({ has: page.getByRole("heading", { name: "Parallaxe prismatique", exact: true }) });
const parallaxCard = parallaxStyle.locator('.nebula-card[data-holo-effect="prismatic-backdrop"]');
@ -891,6 +915,18 @@ test("administrator navigates sections, manages mythic content and previews visu
await expect(parallaxCard.locator('[data-depth-layer="backdrop"] img[src$="/mythic_card_pull__full__backdrop.webp"]')).toBeVisible();
await expect(parallaxCard.locator('[data-depth-layer="subject"] img[src$="/mythic_card_pull__full__cutout.webp"]')).toBeVisible();
await chooseOption(parallaxStyle, "Format", "Standard");
// Les paliers, de 1 à 5, s'essaient sur l'aperçu : intensité de la palette pour tous les effets, amplitude pour la parallaxe.
const parallaxIntensity = parallaxStyle.getByRole("slider", { name: "Intensité" });
await expect(parallaxIntensity).toHaveValue("3");
await expect(parallaxCard).not.toHaveAttribute("data-holo-intensity");
await parallaxIntensity.fill("5");
await expect(parallaxCard).toHaveAttribute("data-holo-intensity", "5");
await expect(parallaxStyle.locator(".nebula-admin-tuning-range").first()).toContainText("Très intense");
await parallaxStyle.getByRole("slider", { name: "Amplitude" }).fill("1");
await expect(parallaxCard).toHaveAttribute("data-holo-level", "1");
// Le Reflet diffractif n'a que l'intensité ; la Glace brisée règle la taille de ses éclats.
await expect(effectStyles.filter({ has: page.getByRole("heading", { name: "Reflet diffractif", exact: true }) }).getByRole("slider")).toHaveCount(1);
await expect(effectStyles.filter({ has: page.getByRole("heading", { name: "Glace brisée", exact: true }) }).getByRole("slider", { name: "Taille des éclats" })).toBeVisible();
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();