Prototype lightning, twinkle and firefly particles in the visual lab
The Particles tab of the visual lab now previews three persistent particle animations for mythic cards, drawn on a canvas inside the illustration or over the whole card. Lightning bolts grow from the edges towards a random point near the hero and pass behind a cut-out hero with the prismatic parallax. Twinkles pop chosen motifs in and out with a light cross at their peak. Fireflies drift on winding paths, pulse and move away from the pointer. Each animation offers a palette, a zone and its own sliders, runs only on a large or hovered card, and stays still under reduced motion. Nothing is saved on the variations yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
9f70bea523
commit
f77a0ca577
15 changed files with 1779 additions and 16 deletions
|
|
@ -3,7 +3,8 @@
|
|||
import { useState } from "react";
|
||||
import { SelectDropdown } from "../../../components/SelectDropdown.jsx";
|
||||
import { Tabs } from "../../../components/Tabs.jsx";
|
||||
import { EffectTuningFields } from "./EffectTuningFields.jsx";
|
||||
import { DEFAULT_FLARE_SCOPE, DEFAULT_FLARE_TUNING, FLARE_EFFECTS, FLARE_SCOPES, MATCH_HOLO_FLARE_LABEL, MATCH_HOLO_FLARE_PALETTE } from "../holoFlares.js";
|
||||
import { EffectTuningFields, TuningRange } from "./EffectTuningFields.jsx";
|
||||
import { variationSummary } from "./effectTuning.js";
|
||||
import { effectMissingHint, fittingFormat, formatMissingHint } from "./finishAvailability.js";
|
||||
import { SwatchDropdown } from "./SwatchDropdown.jsx";
|
||||
|
|
@ -16,6 +17,8 @@ const enabledFirst = (left, right) => Number(left.disabled) - Number(right.disab
|
|||
// `value` : { formatId, effectPresetId, paletteId, intensity, level }. `showEffect` masque le menu d'effet quand l'effet se
|
||||
// choisit ailleurs (miniatures de l'Atelier). Un format ou un effet dont la carte n'a pas les fichiers reste visible mais
|
||||
// désactivé, en bas de liste, avec la liste des fichiers manquants.
|
||||
// `value.flare` ({ id, motifId, paletteId, scope, intensity, level, count }) rend l'onglet Particules réglable ; sans lui (éditeur des variations,
|
||||
// tant que les particules ne s'enregistrent pas), l'onglet reste en lecture seule.
|
||||
// `children` reçoit les actions (Enregistrer, Annuler) sous le résumé.
|
||||
export function VariationCustomizer({ catalog, card, value, showEffect = true, disabled = false, notice = null, onChange, children = null }) {
|
||||
const [tab, setTab] = useState("holo");
|
||||
|
|
@ -29,6 +32,9 @@ export function VariationCustomizer({ catalog, card, value, showEffect = true, d
|
|||
const hint = effectMissingHint(catalog, card, item.id);
|
||||
return { value: item.id, label: item.label, disabled: Boolean(hint), hint };
|
||||
}).toSorted(enabledFirst);
|
||||
const flare = value.flare;
|
||||
const flareEffect = FLARE_EFFECTS.find((item) => item.id === flare?.id);
|
||||
const changeFlare = (next) => onChange({ ...value, flare: { ...flare, ...next } });
|
||||
const changeEffect = (effectPresetId) => onChange({ ...value, effectPresetId, formatId: fittingFormat(catalog, card, effectPresetId, value.formatId) });
|
||||
return <div className="nebula-admin-customizer">
|
||||
<Tabs className="nebula-admin-customizer-tabs" tabs={TABS} activeTab={tab} onChange={setTab} />
|
||||
|
|
@ -40,9 +46,19 @@ export function VariationCustomizer({ catalog, card, value, showEffect = true, d
|
|||
<SwatchDropdown className="nebula-admin-inline-field" label="Palette" accessibleLabel="Palette holographique" value={value.paletteId} options={catalog.effectPalettes} disabled={disabled} onChange={(paletteId) => onChange({ ...value, paletteId })} />
|
||||
</div>
|
||||
<EffectTuningFields catalog={catalog} effect={effect} value={value} disabled={disabled} onChange={(tuning) => onChange({ ...value, ...tuning })} />
|
||||
</> : flare ? <>
|
||||
<div className="nebula-admin-customizer-choices">
|
||||
<SelectDropdown className="nebula-admin-inline-field" label="Animation" size="sm" value={flare.id} disabled={disabled} options={[{ value: "", label: "Aucune" }, ...FLARE_EFFECTS.map((item) => ({ value: item.id, label: item.label }))]} onChange={(id) => changeFlare({ id })} />
|
||||
{flareEffect?.motifs && <SelectDropdown className="nebula-admin-inline-field" label="Motif" size="sm" value={flareEffect.motifs.some((item) => item.id === flare.motifId) ? flare.motifId : flareEffect.motifs[0].id} disabled={disabled} options={flareEffect.motifs.map((item) => ({ value: item.id, label: item.label }))} onChange={(motifId) => changeFlare({ motifId })} />}
|
||||
{flareEffect && <SwatchDropdown className="nebula-admin-inline-field" label="Palette" accessibleLabel="Palette des particules" value={flare.paletteId} options={[{ id: MATCH_HOLO_FLARE_PALETTE, label: MATCH_HOLO_FLARE_LABEL }, ...catalog.effectPalettes]} disabled={disabled} onChange={(paletteId) => changeFlare({ paletteId })} />}
|
||||
{flareEffect && <SelectDropdown className="nebula-admin-inline-field" label="Zone" size="sm" value={flare.scope || DEFAULT_FLARE_SCOPE} disabled={disabled} options={FLARE_SCOPES.map((item) => ({ value: item.id, label: item.label }))} onChange={(scope) => changeFlare({ scope })} />}
|
||||
</div>
|
||||
{flareEffect && <div className="nebula-admin-tuning">
|
||||
{flareEffect.tunings.map((scale) => <TuningRange key={scale.key} scale={scale} value={flare[scale.key] || DEFAULT_FLARE_TUNING} disabled={disabled} onChange={(next) => changeFlare({ [scale.key]: next })} />)}
|
||||
</div>}
|
||||
</> : <>
|
||||
<SelectDropdown className="nebula-admin-inline-field" label="Animation" size="sm" disabled value="" options={[{ value: "", label: "Aucune" }]} onChange={() => {}} />
|
||||
<p className="nebula-form-help">Les animations de particules arrivent une par une.</p>
|
||||
<p className="nebula-form-help">Les particules s’essaient d’abord dans l’Atelier visuel ; elles s’enregistreront ici une fois validées.</p>
|
||||
</>}
|
||||
</div>
|
||||
{notice}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue