Update the Aniimo catalog and regional filters
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 18m8s
Validate and deploy Sokko G / deploy (push) Successful in 9s

This commit is contained in:
Shinuwa 2026-10-30 00:03:04 +01:00
parent c08452d5a4
commit ae10661b63
62 changed files with 2799 additions and 130 deletions

View file

@ -880,10 +880,13 @@ Date picker et menus compacts :
- les contrôles de retournement Aniimo sont dans chaque face et tournent avec elle ; le focus clavier rejoint le contrôle de la nouvelle face ;
- afficher les portraits dans un cadre compact 3 / 4 plafonné à 250 px de hauteur, avec `object-fit: cover` et cadrage centré ; les fichiers source restent inchangés ;
- les deux variantes de Petit Esprit de Feu utilisent `object-position: center 20%` pour descendre légèrement le personnage dans son cadre ;
- les deux variantes d’Elfe solidaire utilisent `object-position: center 20%` pour descendre légèrement le personnage dans son cadre ;
- la grille utilise un minimum de 220 px pour afficher cinq colonnes à 1920 px, puis réduit le nombre de colonnes selon la largeur disponible ; limiter les cartes à 280 px de largeur ; le recto fixe leur hauteur avec le portrait et un pied de 96 px, indépendamment des noms et des variantes ;
- le nom de forme revient à la ligne au recto, dans le pied fixe de 96 px ;
- le recto affiche uniquement les icônes d'éléments, centrées dans le pied de carte, avec texte alternatif et infobulle ;
- la région figure en haut du portrait ; le filtre Régions accepte plusieurs choix en OU et se combine aux autres familles avant regroupement ; « Spéciaux » reste en dernière position ;
- les options de région sans icône utilisent deux colonnes internes, case à cocher et libellé, pour afficher les noms complets ;
- un portrait déclaré absent utilise un emplacement textuel de même taille ; un rôle inconnu affiche « Non renseigné » et les variantes marquées incomplètes portent une notice au verso ;
- le numéro Aniimo reste un texte HTML visible en bas à gauche du portrait, afin de rester accessible à la recherche du navigateur ;
- les onglets affichent des initiales ou une abréviation de trois lettres pour les formes à un seul mot (PLA, PRA, PRI) ; le nom complet reste accessible via `Tooltip`, au survol et au focus ;
- placer les onglets au-dessus du contrôle de retournement, avec navigation clavier ; une grille de colonnes égales affiche les sept formes sur une ligne sans couper les libellés ;
@ -898,9 +901,9 @@ Date picker et menus compacts :
- réduire l'animation selon `prefers-reduced-motion` ;
- les filtres se cumulent par famille et sont évalués sur chaque variante avant regroupement ; les compétences de logis sont toujours cumulatives et leur sélecteur compact `≥ / =`, aligné comme « Correspondance », utilise le niveau minimum par défaut ; les libellés complets restent accessibles ;
- l’option directe « Prismana » reprend le style et les dimensions des `nds-filter-option`, utilise une étoile SVG arc-en-ciel et limite les résultats à `prismana_form` avant regroupement ; son nom accessible reste « Prismana uniquement » ;
- la barre horizontale avancée ouvre trois menus distincts pour Rôles, Éléments et Compétences de logis ; chaque trigger conserve le nombre de critères sélectionnés ;
- la barre horizontale avancée ouvre quatre menus distincts pour Régions, Rôles, Éléments et Compétences de logis ; chaque trigger conserve le nombre de critères sélectionnés ;
- rôles et éléments utilisent des chips `sm` avec icône et texte, réparties sur deux colonnes via `data-columns="2"` ; le menu des compétences sépare sans titre visible les éléments et les actions en deux colonnes accessibles, le séparateur étant porté par la colonne des éléments, plus haute ; chaque ligne conserve icône, texte, curseur et valeur ; un seuil à 0 reste visible mais ne participe pas au filtrage ;
- recherche, Prismana, rôles, éléments et niveaux actifs sont rappelés sous la barre par des badges supprimables individuellement ;
- recherche, Prismana, régions, rôles, éléments et niveaux actifs sont rappelés sous la barre par des badges supprimables individuellement ;
- les menus restent ouverts pendant une sélection multiple et se ferment au clic extérieur, à `Escape` ou quand le focus quitte le menu.
### Liaison des guides aux checklists

View file

@ -88,7 +88,7 @@ Checklist à suivre lors de l'ajout ou de la modification d'un outil, d'une page
- Pour les guides à cartes, vérifier le toggle de lien à côté du « + » dans l'en-tête de chaque checklist compatible : il affiche les commandes, masquées par défaut. Vérifier l'association exclusive, le masquage désactivé sur les autres listes et la mise à jour immédiate depuis le panneau latéral. Refermer les commandes conserve l'association. La checkbox des cartes met à jour toutes les lignes exactes correspondantes, respecte les quantités cibles et ne retourne pas les cartes.
- Vérifier le changement de checklist, la dissociation, la restauration de session, la suppression d'un module et le changement de toolbox. La réinitialisation des filtres conserve la liaison ; une liste devenue sans correspondance reste sélectionnée avec un message.
- Pour les résultats filtrables Aniimo, MHW et Diablo, vérifier que le bouton visible « Résultats vers checklist » utilise l'icône checklist, conserve un libellé accessible contextuel et ouvre une modale rappelant que seuls les éléments visibles sont utilisés. Le groupe titre, compteur et action doit revenir à la ligne sans débordement dès 768 px. La copie reste disponible sans toolbox liée ; la création est alors désactivée avec une indication explicite. Avec une toolbox liée, la création ajoute une nouvelle checklist dans son espace actif sans remplacer l'association guide/checklist existante.
- Pour Aniimo, vérifier la copie et la création des espèces ou des formes selon l'affichage, les noms français/anglais, la priorité des formes et le masquage avant regroupement. Compteurs, copie et création doivent correspondre aux résultats affichés.
- Pour Aniimo, vérifier la copie et la création des espèces ou des formes selon l'affichage, les noms français/anglais, la priorité des formes et le masquage avant regroupement. Compteurs, copie et création doivent correspondre aux résultats affichés. Les numéros identiques entre régions restent des espèces distinctes ; le filtre Régions se combine aux autres filtres avant regroupement et copie.
## Listes de jeu

View file

@ -359,6 +359,15 @@ lignes exactes qui lui correspondent : cocher porte `qtyCurrent` à `qtyTarget`,
décocher le remet à `0`. Les données passent par le flux React/IndexedDB existant ;
aucune copie de progression n'est conservée dans l'association du guide.
Le catalogue public Aniimo identifie chaque espèce par `uid = region:id` : le numéro
`id` seul peut se répéter entre régions. Les clés de variantes `uid:form` servent
au rendu et aux correspondances en mémoire ; elles ne sont pas persistées dans
les checklists, dont la reconnaissance reste fondée sur les libellés. Le champ
optionnel `image: null` déclare un portrait absent ; retirer ce champ une fois
le fichier `<name>__<form>.webp` ajouté. Un rôle `null` exige une vérification
`pending` et la lacune `role_not_verified`. Les métadonnées `verification` et
`data_gaps` signalent les données à confirmer sans inventer de valeurs.
La copie Aniimo utilise `Nom:1` en affichage regroupé et `Nom — Forme:1` en
affichage séparé. Les noms et formes français et anglais sont reconnus. Une ligne
sans forme couvre toutes les variantes ; une ligne spécifique à une forme prend

View file

@ -40,7 +40,7 @@ for (const width of [1280, 390]) {
await expect(prismana).toHaveAttribute("aria-pressed", "false");
await prismana.focus();
await prismana.press("Space");
await expect(cards(page)).toHaveCount(27);
await expect(cards(page)).toHaveCount(31);
await expect(prismana).toHaveText("Prismana");
await expect(prismana).toHaveClass(/nds-filter-option/);
const prismanaBadge = page.getByRole("button", { name: "Retirer le filtre Prismana", exact: true });
@ -63,7 +63,7 @@ for (const width of [1280, 390]) {
await expect(page.getByRole("heading", { name: "Aucun résultat" })).toBeVisible();
await page.getByRole("button", { name: "Réinitialiser les filtres", exact: true }).click();
await expect(prismana).toHaveAttribute("aria-pressed", "false");
await expect(cards(page)).toHaveCount(208);
await expect(cards(page)).toHaveCount(252);
await expect(page.getByRole("button", { name: "Regrouper les variantes", exact: true })).toHaveAttribute("aria-pressed", "false");
expect(await page.evaluate(() => globalThis.document.documentElement.scrollWidth <= globalThis.innerWidth)).toBe(true);
});
@ -127,8 +127,8 @@ test("catalogue, overview and deferred Aniimo loading preserve filters across na
await expect(cover).toHaveCSS("object-position", "50% 38%");
await expect(cover).toHaveCSS("height", "120px");
await page.locator('a[href="#/games/aniimo/aniimos"]').click();
await expect(cards(page)).toHaveCount(88);
await expect(page.getByRole("status")).toHaveText("88 / 88 Aniimos · 208 / 208 variantes");
await expect(cards(page)).toHaveCount(120);
await expect(page.getByRole("status")).toHaveText("120 / 120 Aniimos · 252 / 252 variantes");
const switchLabel = page.getByRole("button", { name: "Regrouper les variantes", exact: true }).locator("span:not(.ui-icon)");
expect(await switchLabel.evaluate((element) => element.scrollWidth <= element.clientWidth)).toBe(true);
await page.getByRole("searchbox", { name: "Nom" }).fill("EMBERPUP");
@ -177,7 +177,7 @@ test("tabs, flip, matching variants and reset remain independent", async ({ page
await page.getByRole("button", { name: "Regrouper les variantes", exact: true }).click();
await expect(cards(page)).toHaveCount(1);
await page.getByRole("button", { name: "Réinitialiser les filtres", exact: true }).click();
await expect(cards(page)).toHaveCount(208);
await expect(cards(page)).toHaveCount(252);
await expect(page.getByRole("button", { name: "Regrouper les variantes", exact: true })).toHaveAttribute("aria-pressed", "false");
});
@ -234,7 +234,7 @@ test("ability levels use independent native ranges and retain name constraints",
await reopenedCarry.press("Home");
await reopenedCrafting.press("Home");
await expect(reopenedCarry).toHaveAttribute("aria-valuetext", "Sans filtre");
await expect(cards(page)).toHaveCount(88);
await expect(cards(page)).toHaveCount(120);
await page.getByRole("searchbox").fill("does-not-exist");
await expect(page.getByRole("heading", { name: "Aucun résultat" })).toBeVisible();
await page.getByRole("button", { name: "Réinitialiser les filtres", exact: true }).click();
@ -284,7 +284,7 @@ for (const width of [1280, 390]) {
await page.setViewportSize({ width, height: 844 });
await page.emulateMedia({ reducedMotion: "reduce" });
await page.goto(route);
await expect(cards(page)).toHaveCount(88);
await expect(cards(page)).toHaveCount(120);
const sizes = await page.locator(".aniimo-card").evaluateAll((elements) => elements.map((element) => {
const { width, height } = element.getBoundingClientRect();
return { width, height };
@ -385,7 +385,7 @@ test("portrait geometry, stable faces and mobile layout", async ({ page }) => {
test("desktop grid uses the width freed by horizontal filters and shows complete stats", async ({ page }) => {
await page.setViewportSize({ width: 1920, height: 1080 });
await page.goto(route);
await expect(cards(page)).toHaveCount(88);
await expect(cards(page)).toHaveCount(120);
const columns = await page.locator(".aniimo-grid").evaluate((element) => globalThis.getComputedStyle(element).gridTemplateColumns.split(" ").length);
expect(columns).toBe(6);
await expect(page.locator(".ui-icon-multiple")).toHaveCSS("mask-image", /multiples\.svg/);
@ -439,3 +439,72 @@ test("pending and failed data requests show loading and error states", async ({
releaseRequests();
await expect(page.getByRole("heading", { name: "Impossible de charger Aniimo" })).toBeVisible();
});
for (const width of [768, 1440]) {
test(`regional filters preserve identities, keyboard access and combinations at ${width}px`, async ({ page }) => {
await page.setViewportSize({ width, height: 900 });
await page.goto(route);
await expect(cards(page)).toHaveCount(120);
const catalogueRegions = await cards(page).evaluateAll((items) => items.map((item) => item.dataset.region));
expect(catalogueRegions.slice(0, -9)).not.toContain("special");
expect(catalogueRegions.slice(-9)).toEqual(Array(9).fill("special"));
await expect(page.locator('[data-aniimo="001"]')).toHaveCount(2);
const regions = await openFilter(page, "Régions");
const regionLabels = regions.locator(".nds-filter-menu-option > span:last-child");
await expect(regionLabels).toHaveText(["Breezy Plains", "Whisperwake Isles", "Spéciaux"]);
await expect.poll(() => regionLabels.evaluateAll((labels) => labels.map((label) => label.scrollWidth <= label.clientWidth))).toEqual([true, true, true]);
await page.screenshot({ path: test.info().outputPath(`aniimo-region-menu-${width}.png`) });
await regions.getByRole("checkbox", { name: "Whisperwake Isles", exact: true }).focus();
await page.keyboard.press("Space");
await expect(cards(page)).toHaveCount(29);
await expect(page.locator('.aniimo-result:not([data-region="whisperwake_isles"])')).toHaveCount(0);
await regions.getByRole("checkbox", { name: "Breezy Plains", exact: true }).check();
await expect(cards(page)).toHaveCount(111);
await page.keyboard.press("Escape");
await expect(filterTrigger(page, "Régions")).toBeFocused();
await page.getByRole("button", { name: "Retirer le filtre Régions : Breezy Plains", exact: true }).click();
await expect(cards(page)).toHaveCount(29);
await page.locator('.game-breadcrumb a[href="#/games/aniimo"]').click();
await page.locator('a[href="#/games/aniimo/aniimos"]').click();
await expect(cards(page)).toHaveCount(29);
await page.getByRole("searchbox").fill("reefish");
await expect(cards(page)).toHaveCount(1);
await expect(cards(page)).toHaveAttribute("data-uid", "whisperwake_isles:001");
await expect(cards(page).getByRole("tab")).toHaveCount(2);
const elements = await openFilter(page, "Éléments");
await elements.getByRole("checkbox", { name: "Eau", exact: true }).check();
await expect(cards(page).getByRole("tab")).toHaveCount(0);
await expect(cards(page)).toHaveAttribute("data-form", "basic_form");
await page.keyboard.press("Escape");
await expect.poll(() => cards(page).locator('.aniimo-portrait img').evaluate((image) => image.naturalWidth)).toBeGreaterThan(0);
await page.getByRole("button", { name: "Regrouper les variantes", exact: true }).click();
await expect(cards(page)).toHaveCount(1);
await page.getByRole("button", { name: "Réinitialiser les filtres", exact: true }).click();
await expect(cards(page)).toHaveCount(252);
await expect(filterTrigger(page, "Régions")).toHaveAccessibleName("Régions");
expect(await page.evaluate(() => globalThis.document.documentElement.scrollWidth <= globalThis.innerWidth)).toBe(true);
await page.screenshot({ path: test.info().outputPath(`aniimo-regions-${width}.png`) });
});
}
test("incomplete Aniimo cards show unknown roles and missing portraits without failing", async ({ page }) => {
const errors = [];
page.on("pageerror", (error) => errors.push(error.message));
await page.route("**/data/aniimo/aniimos.json", async (route) => {
const response = await route.fetch();
const catalogue = await response.json();
catalogue.find((aniimo) => aniimo.name === "hoptail").variations[0].image = null;
await route.fulfill({ response, json: catalogue });
});
await page.goto(route);
await page.getByRole("searchbox").fill("jabster");
await expect(cards(page)).toHaveCount(1);
await cards(page).getByRole("button", { name: /Afficher les capacités/ }).click();
await expect(cards(page).getByText("Non renseigné", { exact: true })).toBeVisible();
await expect(cards(page).getByText("Certaines données de cette variante restent à confirmer.")).toBeVisible();
await expect(cards(page).getByRole("progressbar")).toHaveCount(6);
await page.getByRole("searchbox").fill("hoptail");
await expect(cards(page).getByRole("img", { name: "Voltibond — Portrait indisponible", exact: true })).toBeVisible();
await expect(cards(page).locator('.aniimo-portrait img')).toHaveCount(0);
expect(errors).toEqual([]);
});

View file

@ -140,12 +140,12 @@ test("Aniimo copies visible species or forms and round-trips through checklist i
await expect(copy).toHaveAccessibleName(/sans les variantes/);
await expect(copy).toContainText("Résultats vers checklist");
await expect(copy.locator(".ui-icon-checklist")).toBeVisible();
await expect(page.locator('[data-copy-target="true"]')).toHaveText("1 / 88 Aniimos");
await expect(page.locator('[data-copy-target="true"]')).toHaveText("1 / 120 Aniimos");
await copyVisibleResults(page);
await expect.poll(() => page.evaluate(() => globalThis.navigator.clipboard.readText())).toBe("Loufeuteau:1");
await page.getByRole("button", { name: "Regrouper les variantes", exact: true }).click();
await expect(copy).toHaveAccessibleName(/toutes les variantes/);
await expect(page.locator('[data-copy-target="true"]')).toHaveText("3 / 208 variantes");
await expect(page.locator('[data-copy-target="true"]')).toHaveText("3 / 252 variantes");
await copyVisibleResults(page);
const text = await page.evaluate(() => globalThis.navigator.clipboard.readText());
const imported = importChecklistText(text, { uid: (prefix) => `${prefix}-${Math.random()}`, normalizeChecklistData });

View file

@ -4,6 +4,7 @@ import assert from "node:assert/strict";
import { test } from "node:test";
import { createAniimoFilters, filterAniimoVariants, groupAniimoVariants, prepareAniimoData } from "../website/src/features/games/aniimo/utils.js";
import { loadAniimoData } from "../website/src/features/games/loaders.js";
import { aniimoChecklistEntries } from "../website/src/features/games/guideChecklist.js";
import { validateAniimoData } from "./helpers/data-validation.mjs";
const readJson = async (path) => JSON.parse(await readFile(`website/public/data/${path}`, "utf8"));
@ -25,19 +26,65 @@ test("Aniimo attributes have valid stats and matching totals", () => {
});
const filter = (overrides, variants = data.variants) => filterAniimoVariants(variants, { ...createAniimoFilters(), ...overrides });
test("regional identities keep repeated numbers distinct before and after filtering", () => {
assert.equal(new Set(data.variants.map((v) => v.key)).size, data.variants.length);
const sameNumber = data.variants.filter((v) => v.aniimoId === "001");
assert.deepEqual(groupAniimoVariants(sameNumber).map(([v]) => v.name), ["emberpup", "reefish"]);
assert.deepEqual(data.filterOptions.regions, ["breezy_plains", "whisperwake_isles", "special"]);
assert.ok(aniimos.slice(0, -9).every((aniimo) => aniimo.region !== "special"));
assert.ok(aniimos.slice(-9).every((aniimo) => aniimo.region === "special"));
assert.equal(groupAniimoVariants(filter({ regions: ["whisperwake_isles"] })).length, 29);
assert.equal(groupAniimoVariants(filter({ regions: ["breezy_plains", "whisperwake_isles"] })).length, 111);
assert.deepEqual(filter({ regions: ["whisperwake_isles"], name: "emberpup" }), []);
assert.deepEqual(filter({ regions: ["whisperwake_isles"], name: "reefish", elements: ["water"] }).map((v) => v.key), ["whisperwake_isles:001:basic_form"]);
assert.ok(filter({ regions: ["whisperwake_isles"], prismanaOnly: true }).every((v) => v.form === "prismana_form" && v.region === "whisperwake_isles"));
const reordered = prepareAniimoData([aniimos.at(-1), ...aniimos.slice(0, -1)], fr, en).variants;
assert.equal(reordered.at(-1).region, "special");
assert.ok(reordered.slice(0, reordered.findIndex((variant) => variant.region === "special")).every((variant) => variant.region !== "special"));
});
test("validation requires regional uids and explicitly documented unknown roles", () => {
const entry = structuredClone(aniimos[0]);
entry.uid = entry.id;
assert.throws(() => validateAniimoData([entry], [fr, en]), /uid must combine/);
assert.throws(() => validateAniimoData([aniimos[0], aniimos[0]], [fr, en]), /Duplicate Aniimo uid/);
const pending = structuredClone(aniimos.find((v) => v.variations.some((form) => form.role === null)));
validateAniimoData([pending], [fr, en]);
delete pending.variations.find((v) => v.role === null).data_gaps;
assert.throws(() => validateAniimoData([pending], [fr, en]), /Unknown role must/);
assert.ok(!data.filterOptions.roles.includes(null));
assert.ok(filter({ roles: data.filterOptions.roles }).every((v) => v.role !== null));
assert.ok(filter({}).some((v) => v.role === null));
});
test("Sparkelf uses only its current French and English names", () => {
const variants = filter({ name: "Elfe solidaire" });
assert.equal(variants.length, 2);
assert.ok(variants.every((v) => v.name === "sparkelf"));
assert.deepEqual(filter({ name: "Sparkelf" }), variants);
assert.deepEqual(filter({ name: "Little Fire Spirit" }), []);
assert.equal(Object.hasOwn(fr, "little_fire_spirit"), false);
assert.equal(Object.hasOwn(en, "little_fire_spirit"), false);
const entries = aniimoChecklistEntries(variants, fr, en);
assert.ok(entries[0].labels.includes("Elfe solidaire — Forme de base"));
assert.ok(entries[0].labels.includes("Sparkelf — Basic Form"));
});
test("Aniimo data has valid variants, translations, portraits and icons", async () => {
validateAniimoData(aniimos, [fr, en]);
const game = (await readJson("games.json")).games.find((game) => game.id === "aniimo");
assert.ok(game);
assert.equal(game.images.aniimosCover, "/static/img/aniimo/emberpup__basic_form.webp");
const assets = new Set([game.images.cardCover, game.images.heroBg, game.images.aniimosCover, ...data.variants.map((variant) => variant.image)]);
for (const option of Object.values(data.filterOptions).flat()) assets.add(`/static/img/aniimo/${option}.webp`);
const assets = new Set([game.images.cardCover, game.images.heroBg, game.images.aniimosCover, ...data.variants.map((variant) => variant.image).filter(Boolean)]);
for (const option of [...data.filterOptions.roles, ...data.filterOptions.elements, ...data.filterOptions.abilities]) assets.add(`/static/img/aniimo/${option}.webp`);
await Promise.all([...assets].map((asset) => access(`website/public${asset}`)));
for (const variant of data.variants) {
if (variant.image === null) continue;
const webp = await readFile(`website/public${variant.image}`);
assert.equal(webp.toString("ascii", 0, 4), "RIFF");
assert.equal(webp.toString("ascii", 8, 12), "WEBP");
assert.deepEqual(readWebpCanvasSize(webp), [512, 840]);
const [width, height] = readWebpCanvasSize(webp);
assert.ok(width >= 280 && height > width, `Portrait must be a usable vertical image: ${variant.image}`);
}
});
@ -83,7 +130,7 @@ test("Prismana remains the final variation in data and grouped results", () => {
});
const fixture = prepareAniimoData([{
id: "001", name: "example", elements: ["rock", "water"], role: "support",
id: "001", uid: "breezy_plains:001", region: "breezy_plains", name: "example", elements: ["rock", "water"], role: "support",
variations: [
{ form: "rock_form", elements: ["rock"], role: "dps", homeland_abilities: [{ type: "carry", level: 3 }] },
{ form: "water_form", elements: ["water"], role: "heal", homeland_abilities: [{ type: "crafting", level: 2 }] },

View file

@ -16,9 +16,11 @@ export function validateAniimoData(aniimos, dictionaries) {
}
for (const aniimo of aniimos) {
assert.match(aniimo.id, /^\d+$/);
assert.ok(!ids.has(aniimo.id), `Duplicate Aniimo id: ${aniimo.id}`);
translated(aniimo.region);
assert.equal(aniimo.uid, `${aniimo.region}:${aniimo.id}`, "Aniimo uid must combine region and id");
assert.ok(!ids.has(aniimo.uid), `Duplicate Aniimo uid: ${aniimo.uid}`);
assert.ok(!names.has(aniimo.name), `Duplicate Aniimo name: ${aniimo.name}`);
ids.add(aniimo.id);
ids.add(aniimo.uid);
names.add(aniimo.name);
translated(aniimo.name);
assert.ok(Array.isArray(aniimo.variations) && aniimo.variations.length > 0);
@ -31,7 +33,17 @@ export function validateAniimoData(aniimos, dictionaries) {
assert.ok(!forms.has(variation.form), `Duplicate form: ${aniimo.name}/${variation.form}`);
forms.add(variation.form);
translated(variation.form);
translated(variation.role);
if (variation.role === null) {
assert.ok(variation.verification === "pending" && variation.data_gaps?.includes("role_not_verified"), "Unknown role must be explicitly pending verification");
} else translated(variation.role);
if (Object.hasOwn(variation, "image")) assert.equal(variation.image, null, "Only a missing portrait may override the standard image path");
if (Object.hasOwn(variation, "verification")) assert.ok(["partial", "pending", "confirmed"].includes(variation.verification), "Invalid verification status");
if (Object.hasOwn(variation, "data_gaps")) {
assertStringArray(variation, "data_gaps");
assert.ok(["partial", "pending"].includes(variation.verification), "Data gaps require a partial or pending verification");
const gaps = ["homeland_abilities_not_verified", "attributes_not_verified", "elements_not_verified", "role_not_verified", "additional_forms_not_verified"];
assert.ok(variation.data_gaps.every((gap) => gaps.includes(gap)), "Unknown data gap");
}
assertStringArray(variation, "elements");
assert.equal(new Set(variation.elements).size, variation.elements.length);
variation.elements.forEach(translated);
@ -137,6 +149,10 @@ export function validateSiteContent(site) {
"aniimo.searchPlaceholder",
"aniimo.prismanaOnly",
"aniimo.prismana",
"aniimo.regions",
"aniimo.unknownRole",
"aniimo.portraitUnavailable",
"aniimo.unverifiedData",
"aniimo.elements",
"aniimo.roles",
"aniimo.role",

File diff suppressed because it is too large Load diff

View file

@ -10,28 +10,37 @@
"bonesky": "Bonesky",
"bouldus": "Bouldus",
"break": "BREAK",
"breezy_plains": "Breezy Plains",
"bubbeep": "Bubbeep",
"budclaw": "Budclaw",
"budsquire": "Budsquire",
"buffby": "Buffby",
"bulbly": "Bulbly",
"carry": "Carry",
"celestis": "Celestis",
"chirpi": "Chirpi",
"climb": "Climb",
"cloudy_mist_form": "Cloudy Mist Form",
"coinwisp": "Coinwisp",
"coraliz": "Coraliz",
"cornet": "Cornet",
"cozite": "Cozite",
"crafting": "Crafting",
"crocobask": "Crocobask",
"cubbo": "Cubbo",
"dark": "dark",
"dash": "Dash",
"dazmand": "Dazmand",
"deluge_form": "Deluge Form",
"dewlop": "Dewlop",
"dewple": "Dewple",
"dewy": "Dewy",
"dig": "Dig",
"dps": "DPS",
"dreaple": "Dreaple",
"eklue": "Eklue",
"eko": "Eko",
"ekrim": "Ekrim",
"electric": "electric",
"emberpup": "Emberpup",
"enhanced_jump": "Enhanced Jump",
@ -49,9 +58,11 @@
"forest_form": "Forest Form",
"fragrancier": "Fragrancier",
"fulmintis": "Fulmintis",
"gachapus": "Gachapus",
"geoclaw": "Geoclaw",
"geodeback": "Geodeback",
"glacy": "Glacy",
"glameep": "Glameep",
"glynsera": "Glynsera",
"gracewing": "Gracewing",
"grappling_hook": "Grappling Hook",
@ -65,7 +76,10 @@
"helmwhelp": "Helmwhelp",
"highlands": "Highlands",
"holy": "holy",
"hoptail": "Hoptail",
"hummin": "Hummin",
"hypnowl": "Hypnowl",
"hypnyto": "Hypnyto",
"ice": "ice",
"ignitis": "Ignitis",
"infergon": "Infergon",
@ -73,16 +87,21 @@
"iris": "Iris",
"irisal": "Irisal",
"irisalis": "Irisalis",
"jabster": "Jabster",
"jaguaraun": "Jaguaraun",
"jawling": "Jawling",
"jeburst": "Jeburst",
"jeglid": "Jeglid",
"lavazar": "Lavazar",
"leafy": "Leafy",
"leisure": "Leisure",
"lighting": "Lighting",
"little_fire_spirit": "Little Fire Spirit",
"lilipole": "Lilipole",
"luminelle": "Luminelle",
"lunara": "Lunara",
"magmarex": "Magmarex",
"melloblum": "Melloblum",
"mesmerowl": "Mesmerowl",
"minespine": "Minespine",
"mountain_form": "Mountain Form",
"mountain_woods_form": "Mountain Woods Form",
@ -98,14 +117,24 @@
"plateau_form": "Plateau Form",
"pomawk": "Pomawk",
"pomegg": "Pomegg",
"popapus": "Popapus",
"popota": "Popota",
"pouchwisp": "Pouchwisp",
"pranky": "Pranky",
"prawnch": "Prawnch",
"prismana_form": "Prismana Form",
"puffby": "Puffby",
"rainfall_form": "Rainfall Form",
"reefish": "Reefish",
"regen": "REGEN",
"rock": "rock",
"rookey": "Rookey",
"rosetower_woods_form": "Rosetower Woods Form",
"royalby": "Royalby",
"salabask": "Salabask",
"saws": "Saws",
"scorchhowl": "Scorchhowl",
"scrubbit": "Scrubbit",
"sea_of_flowers_form": "Sea of Flowers Form",
"sheldon": "Sheldon",
"shelly": "Shelly",
@ -114,15 +143,21 @@
"skippy": "Skippy",
"snowfield_form": "Snowfield Form",
"somniwing": "Somniwing",
"sparkelf": "Sparkelf",
"sparki": "Sparki",
"special": "Special",
"sprint": "Sprint",
"squarrel": "Squarrel",
"squashel": "Squashel",
"stealth": "Stealth",
"stellarys": "Stellarys",
"sugarfish": "Sugarfish",
"sugarslime": "Sugarslime",
"sugartini": "Sugartini",
"support": "Support",
"susuta": "Susuta",
"swim": "Swim",
"tempest_form": "Tempest Form",
"terrain_interaction": "Terrain Interaction",
"thornblade": "Thornblade",
"thunderstorm_form": "Thunderstorm Form",
@ -134,7 +169,10 @@
"vision": "Vision",
"waleetle": "Waleetle",
"water": "water",
"waterfall_form": "Waterfall Form",
"whirlbite": "Whirlbite",
"whisperwake_isles": "Whisperwake Isles",
"wind": "wind",
"wisptis": "Wisptis",
"witchin": "Witchin"
}
}

View file

@ -10,28 +10,37 @@
"bonesky": "Osky",
"bouldus": "Boulabée",
"break": "RUPT.",
"breezy_plains": "Breezy Plains",
"bubbeep": "Algobulle",
"budclaw": "Crabourgeon",
"budsquire": "Bourgeonnet",
"buffby": "Grosabeye",
"bulbly": "Bulbi",
"carry": "Porter",
"celestis": "Célestia",
"chirpi": "Cuicui",
"climb": "Grimper",
"cloudy_mist_form": "Forme des brumes nuageuses",
"coinwisp": "Farfapièce",
"coraliz": "Coraleurre",
"cornet": "Clairbec",
"cozite": "Cabaroc",
"crafting": "Artisanat",
"crocobask": "Crocosouche",
"cubbo": "Ourso",
"dark": "Ténèbres",
"dash": "Dash",
"dazmand": "Danzard",
"deluge_form": "Forme des déluges",
"dewlop": "Goutti",
"dewple": "Farangoutte",
"dewy": "Plumiel",
"dig": "Creuser",
"dps": "DPS",
"dreaple": "Lainirique",
"eklue": "Ekolombo",
"eko": "Eko",
"ekrim": "Eklepto",
"electric": "Électrique",
"emberpup": "Loufeuteau",
"enhanced_jump": "Saut amélioré",
@ -49,9 +58,11 @@
"forest_form": "Forme des forêts",
"fragrancier": "Fragrancier",
"fulmintis": "Fulmi",
"gachapus": "Gachapoulpe",
"geoclaw": "Cristocrabe",
"geodeback": "Géodosaure",
"glacy": "Givrotus",
"glameep": "Algoglam",
"glynsera": "Molosabre",
"gracewing": "Voletti",
"grappling_hook": "Grappin",
@ -65,7 +76,10 @@
"helmwhelp": "Casquimord",
"highlands": "Hautes-plaines",
"holy": "Sacré",
"hoptail": "Voltibond",
"hummin": "Fredon",
"hypnowl": "Hypnibou",
"hypnyto": "Hypnotou",
"ice": "glace",
"ignitis": "Igniti",
"infergon": "Infergon",
@ -73,16 +87,21 @@
"iris": "Iris",
"irisal": "Valsiris",
"irisalis": "Lumiris",
"jabster": "Crustabasse",
"jaguaraun": "Jagaura",
"jawling": "Machou",
"jeburst": "Jeyser",
"jeglid": "Jebond",
"lavazar": "Lavasaure",
"leafy": "Voilotus",
"leisure": "Loisir",
"lighting": "Éclairage",
"little_fire_spirit": "Petit Esprit de Feu",
"lilipole": "Têtuphar",
"luminelle": "Luminelle",
"lunara": "Lunara",
"magmarex": "Magmarex",
"melloblum": "Méliflore",
"mesmerowl": "Magnibou",
"minespine": "Cristorex",
"mountain_form": "Forme des montagnes",
"mountain_woods_form": "Forme des montagnes boisées",
@ -98,14 +117,24 @@
"plateau_form": "Forme des plateaux",
"pomawk": "Pomawk",
"pomegg": "Pomœuf",
"popapus": "Poulplash",
"popota": "Bulloutre",
"pouchwisp": "Farfabourse",
"pranky": "Filoutus",
"prawnch": "Gambaston",
"prismana_form": "Forme prismana",
"puffby": "Titabeye",
"rainfall_form": "Forme des pluies",
"reefish": "Coracroc",
"regen": "RÉGÉN.",
"rock": "Roche",
"rookey": "Casquillon",
"rosetower_woods_form": "Forme de tourbois",
"royalby": "Royabeye",
"salabask": "Salasouche",
"saws": "Sciéleron",
"scorchhowl": "Hurlebrasier",
"scrubbit": "Frottêtard",
"sea_of_flowers_form": "Mer florale",
"sheldon": "Astor",
"shelly": "Astrid",
@ -114,15 +143,21 @@
"skippy": "Tilotus",
"snowfield_form": "Forme des neiges",
"somniwing": "Vitti",
"sparkelf": "Elfe solidaire",
"sparki": "Farfafeu",
"special": "Spéciaux",
"sprint": "Sprint",
"squarrel": "Écurixe",
"squashel": "Écurouste",
"stealth": "Furtivité",
"stellarys": "Stellaria",
"sugarfish": "Poissucre",
"sugarslime": "Bavosucre",
"sugartini": "Sucrini",
"support": "SOUTIEN",
"susuta": "Louloutre",
"swim": "Nager",
"tempest_form": "Forme des tempêtes",
"terrain_interaction": "Interaction terrain",
"thornblade": "Rapiéronce",
"thunderstorm_form": "Forme des orages",
@ -134,6 +169,9 @@
"vision": "Vision",
"waleetle": "Coléobée",
"water": "eau",
"waterfall_form": "Forme des cascades",
"whirlbite": "Morsquale",
"whisperwake_isles": "Whisperwake Isles",
"wind": "Vent",
"wisptis": "Flammi",
"witchin": "Sorcelonde"

View file

@ -2944,8 +2944,8 @@
},
"aniimo": {
"title": "Aniimos",
"description": "Filtrez les variantes par nom, éléments, rôle et compétences de logis, puis retournez les cartes pour consulter leurs capacités.",
"homeDescription": "Recherche par nom, rôle, éléments et compétences de logis.",
"description": "Filtrez les variantes par nom, région, éléments, rôle et compétences de logis, puis retournez les cartes pour consulter leurs capacités.",
"homeDescription": "Recherche par nom, région, rôle, éléments et compétences de logis.",
"copyChecklist": "Utiliser les Aniimos visibles sans les variantes pour une checklist",
"copyVariantsChecklist": "Utiliser toutes les variantes visibles pour une checklist",
"variantsChecklistTitle": "Variantes Aniimo",
@ -2957,6 +2957,10 @@
"searchPlaceholder": "Nom français ou anglais…",
"prismanaOnly": "Prismana uniquement",
"prismana": "Prismana",
"regions": "Régions",
"unknownRole": "Non renseigné",
"portraitUnavailable": "Portrait indisponible",
"unverifiedData": "Certaines données de cette variante restent à confirmer.",
"elements": "Éléments",
"roles": "Rôles",
"role": "Rôle",

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View file

@ -24,7 +24,8 @@ function CardFaces({ variant, t, content, checklist, statsMax }) {
<div className="aniimo-card-inner">
<div className="aniimo-face aniimo-front nds-card" aria-hidden={flipped} inert={flipped}>
<div className="aniimo-portrait">
<img src={variant.image} alt={t(variant.name)} width="512" height="840" loading="lazy" />
{variant.image ? <img src={variant.image} alt={t(variant.name)} width="512" height="840" loading="lazy" /> : <div className="aniimo-portrait-placeholder" role="img" aria-label={`${t(variant.name)} — ${content.portraitUnavailable}`}><Icon name="picture" /><span>{content.portraitUnavailable}</span></div>}
<span className="aniimo-region">{t(variant.region)}</span>
<span className="aniimo-number">N° {variant.aniimoId}</span>
<GuideChecklistCheckbox checklist={checklist} itemKey={variant.key} />
</div>
@ -43,8 +44,9 @@ function CardFaces({ variant, t, content, checklist, statsMax }) {
<div className="aniimo-card-body aniimo-back-details nds-scrollbox" data-variant="ghost" role="region" aria-label={`${content.showBack} — ${t(variant.name)}`} tabIndex="0">
<div className="aniimo-back-summary">
<div><h3>{content.elements}</h3><Attributes values={variant.elements} t={t} /></div>
<div><h3>{content.role}</h3><Attributes values={[variant.role]} t={t} /></div>
<div><h3>{content.role}</h3>{variant.role ? <Attributes values={[variant.role]} t={t} /> : <span className="nds-badge" data-variant="neutral">{content.unknownRole}</span>}</div>
</div>
{variant.data_gaps?.length > 0 && <p className="nds-inline-notice" data-variant="info">{content.unverifiedData}</p>}
<h3>{content.abilities}</h3>
<ul className="aniimo-abilities">{variant.homeland_abilities.map((ability) => <li key={ability.type}>
<img src={aniimoAsset(ability.type)} alt="" width="24" height="24" />
@ -81,7 +83,7 @@ export function AniimoCard({ variants, t, content, checklist, statsMax }) {
target.parentElement.children[index].focus();
}
return (
<article className="aniimo-result" data-checklist-complete={checklist.isCompleted(variant.key) || undefined} data-aniimo={variant.aniimoId} data-form={variant.form} aria-label={t(variant.name)}>
<article className="aniimo-result" data-checklist-complete={checklist.isCompleted(variant.key) || undefined} data-aniimo={variant.aniimoId} data-uid={variant.aniimoUid} data-region={variant.region} data-form={variant.form} aria-label={t(variant.name)}>
<div className="aniimo-tabs-slot">
{multiple && <div className="aniimo-tabs nds-radio-button-group" data-size="xs" role="tablist" aria-label={`${content.variants} — ${t(variant.name)}`}>
{variants.map((item, index) => <Tooltip as="button" content={t(item.form)} aria-label={t(item.form)} key={item.key} type="button" role="tab" data-form={item.form} id={`${id}-${item.form}`} aria-controls={`${id}-panel`} aria-selected={item.key === variant.key} tabIndex={item.key === variant.key ? 0 : -1} className={item.key === variant.key ? "active" : ""} onClick={() => setSelectedKey(item.key)} onKeyDown={(event) => {

View file

@ -40,6 +40,7 @@ export function AniimoFilters({ filters, onChange, options, t, content }) {
const activeBadges = [
...(filters.name.trim() ? [{ id: "name", label: `${content.name} : ${filters.name.trim()}`, onRemove: () => onChange({ ...filters, name: "" }) }] : []),
...(filters.prismanaOnly ? [{ id: "prismana", label: content.prismana, onRemove: () => onChange({ ...filters, prismanaOnly: false }) }] : []),
...filters.regions.map((option) => ({ id: `region-${option}`, label: `${content.regions} : ${t(option)}`, onRemove: () => toggle("regions", option, false) })),
...filters.roles.map((option) => ({ id: `role-${option}`, label: `${content.roles} : ${t(option)}`, onRemove: () => toggle("roles", option, false) })),
...filters.elements.map((option) => ({ id: `element-${option}`, label: `${content.elements} : ${t(option)}`, onRemove: () => toggle("elements", option, false) })),
...Object.entries(filters.abilities).map(([option, level]) => ({ id: `ability-${option}`, label: `${t(option)} ${filters.abilityExact ? "=" : "≥"} ${level}`, onRemove: () => updateAbility(option, 0) }))
@ -56,6 +57,9 @@ export function AniimoFilters({ filters, onChange, options, t, content }) {
<img src="/static/icons/prismana.svg" alt="" width="16" height="16" />
<span className="nds-filter-option-label">{content.prismana}</span>
</button>
<GameFilterDropdown label={content.regions} count={filters.regions.length}>
{() => <FilterCheckboxOptions filterKey="regions" label={content.regions} values={options.regions} selected={filters.regions} t={t} onToggle={toggle} withIcons={false} />}
</GameFilterDropdown>
<GameFilterDropdown label={content.roles} count={filters.roles.length} icon="shield" columns={2}>
{() => <FilterCheckboxOptions filterKey="roles" label={content.roles} values={options.roles} selected={filters.roles} t={t} onToggle={toggle} />}
</GameFilterDropdown>
@ -93,13 +97,13 @@ export function AniimoFilters({ filters, onChange, options, t, content }) {
);
}
function FilterCheckboxOptions({ filterKey, label, values, selected, t, onToggle }) {
function FilterCheckboxOptions({ filterKey, label, values, selected, t, onToggle, withIcons = true }) {
return (
<div className="nds-filter-menu-options aniimo-filter-options aniimo-chip-options" role="region" aria-label={label}>
{values.map((option) => (
<label key={option} className={`filter-chip nds-chip nds-filter-menu-option ${selected.includes(option) ? "active" : ""}`} data-size="sm">
<label key={option} className={`filter-chip nds-chip nds-filter-menu-option ${selected.includes(option) ? "active" : ""}`} data-size="sm" data-with-icons={withIcons}>
<input className="nds-checkbox" data-size="sm" type="checkbox" checked={selected.includes(option)} onChange={(event) => onToggle(filterKey, option, event.target.checked)} />
<img src={aniimoAsset(option)} alt="" width="16" height="16" />
{withIcons && <img src={aniimoAsset(option)} alt="" width="16" height="16" />}
<span>{t(option)}</span>
</label>
))}

View file

@ -17,7 +17,7 @@ function AniimoListing({ game, aniimo, filters, setFilters, content }) {
const filtered = useMemo(() => filterAniimoVariants(aniimo.variants, active), [aniimo.variants, active]);
const visible = filtered.filter((variant) => checklist.isVisible(variant.key));
const groups = useMemo(() => groupAniimoVariants(visible), [visible]);
const totalAniimos = useMemo(() => new Set(aniimo.variants.map((variant) => variant.aniimoId)).size, [aniimo.variants]);
const totalAniimos = useMemo(() => new Set(aniimo.variants.map((variant) => variant.aniimoUid)).size, [aniimo.variants]);
const t = (key) => aniimoLabel(aniimo.translations, key);
const cards = active.grouped ? groups : visible.map((variant) => [variant]);
const update = (next) => setFilters((current) => ({ ...current, aniimo: next }));
@ -48,7 +48,7 @@ function AniimoListing({ game, aniimo, filters, setFilters, content }) {
<section className="game-layout aniimo-layout">
<aside className="game-filters"><AniimoFilters filters={active} onChange={update} options={aniimo.filterOptions} t={t} content={content} /></aside>
<section className="game-results" aria-label={content.results}>
{cards.length ? <div className="game-grid aniimo-grid">{cards.map((variants) => <AniimoCard key={active.grouped ? variants[0].aniimoId : variants[0].key} variants={variants} t={t} content={content} checklist={checklist} statsMax={statsMax} />)}</div> : <div className="empty nds-empty-state"><h2>{content.emptyTitle}</h2><p>{content.emptyText}</p></div>}
{cards.length ? <div className="game-grid aniimo-grid">{cards.map((variants) => <AniimoCard key={active.grouped ? variants[0].aniimoUid : variants[0].key} variants={variants} t={t} content={content} checklist={checklist} statsMax={statsMax} />)}</div> : <div className="empty nds-empty-state"><h2>{content.emptyTitle}</h2><p>{content.emptyText}</p></div>}
</section>
</section>
</>;

View file

@ -1,6 +1,6 @@
// Rôle : prépare les variantes Aniimo et applique les critères avant leur regroupement.
export function createAniimoFilters() {
return { name: "", prismanaOnly: false, elements: [], roles: [], abilities: {}, elementsLogic: "and", abilityExact: false, grouped: true };
return { name: "", prismanaOnly: false, regions: [], elements: [], roles: [], abilities: {}, elementsLogic: "and", abilityExact: false, grouped: true };
}
export const ANIIMO_STATS = ["hp", "atk", "p_def", "m_def", "break", "regen"];
@ -23,20 +23,26 @@ function normalizeName(value) {
}
export function prepareAniimoData(aniimos, translations, englishTranslations) {
const variants = aniimos.flatMap((aniimo) => aniimo.variations.map((variation) => ({
const orderedAniimos = [...aniimos].sort((left, right) => Number(left.region === "special") - Number(right.region === "special"));
const variants = orderedAniimos.flatMap((aniimo) => aniimo.variations.map((variation) => ({
...variation,
aniimoId: aniimo.id,
aniimoUid: aniimo.uid,
region: aniimo.region,
name: aniimo.name,
key: `${aniimo.id}:${variation.form}`,
image: aniimoAsset(`${aniimo.name}__${variation.form}`),
key: `${aniimo.uid}:${variation.form}`,
image: variation.image === null ? null : aniimoAsset(`${aniimo.name}__${variation.form}`),
searchNames: [aniimo.name, translations[aniimo.name], englishTranslations[aniimo.name]].filter(Boolean).map(normalizeName)
})));
const sorted = (values) => [...new Set(values)].sort((a, b) => aniimoLabel(translations, a).localeCompare(aniimoLabel(translations, b), "fr"));
const regions = sorted(variants.map((variant) => variant.region));
regions.sort((left, right) => Number(left === "special") - Number(right === "special"));
return {
variants,
filterOptions: {
regions,
elements: sorted(variants.flatMap((variant) => variant.elements)),
roles: sorted(variants.map((variant) => variant.role)),
roles: sorted(variants.map((variant) => variant.role).filter(Boolean)),
abilities: sorted(variants.flatMap((variant) => variant.homeland_abilities.map((ability) => ability.type)))
}
};
@ -52,6 +58,7 @@ export function filterAniimoVariants(variants, filters) {
return variants.filter((variant) => (
(!search || variant.searchNames.some((name) => name.includes(search)))
&& (!filters.prismanaOnly || variant.form === "prismana_form")
&& (!filters.regions.length || filters.regions.includes(variant.region))
&& matchesSelection(filters.elements, filters.elementsLogic, (element) => variant.elements.includes(element))
&& (!filters.roles.length || filters.roles.includes(variant.role))
&& abilities.every(([type, level]) => variant.homeland_abilities.some((ability) => ability.type === type && (filters.abilityExact ? ability.level === level : ability.level >= level)))
@ -61,8 +68,8 @@ export function filterAniimoVariants(variants, filters) {
export function groupAniimoVariants(variants) {
const groups = new Map();
for (const variant of variants) {
if (!groups.has(variant.aniimoId)) groups.set(variant.aniimoId, []);
groups.get(variant.aniimoId).push(variant);
if (!groups.has(variant.aniimoUid)) groups.set(variant.aniimoUid, []);
groups.get(variant.aniimoUid).push(variant);
}
return [...groups.values()];
}

View file

@ -14,6 +14,7 @@
}
.aniimo-chip-options { gap: 6px; }
.aniimo-chip-options .filter-chip { min-width: 0; }
.aniimo-chip-options .nds-filter-menu-option[data-with-icons="false"] { grid-template-columns: 18px minmax(0, 1fr); }
.aniimo-ability-options { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; overflow: visible; }
.aniimo-ability-column { display: grid; min-width: 0; align-content: start; gap: 6px; }
.aniimo-ability-column:first-child { padding-right: 12px; border-right: 1px solid var(--color-border); }
@ -142,6 +143,17 @@
overflow: hidden;
img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
}
.aniimo-portrait-placeholder {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: var(--space-3);
height: 100%;
color: var(--color-text-muted);
font-size: var(--font-size-sm);
}
.aniimo-region,
.aniimo-number {
position: absolute;
bottom: 10px;
@ -158,7 +170,8 @@
line-height: 1.2;
pointer-events: none;
}
// Les deux portraits de Petit Esprit de Feu ont davantage de vide sous le personnage.
.aniimo-region { top: 10px; bottom: auto; max-width: calc(100% - 20px); }
// Les deux portraits d’Elfe solidaire ont davantage de vide sous le personnage.
.aniimo-result[data-aniimo="11001"] .aniimo-portrait img { object-position: center 20%; }
.aniimo-card-body {
padding: 10px 12px;