The effects move out of Board.svelte into src/fx-sprites/ — one component per flourish, markup and animation CSS together, so editing the fireball means opening Fireball.svelte and nothing else. A registry (index.ts) maps kind to sprite; Board renders through it. The event mapping stays in fx.ts. And a viewer: /?fx opens the Flourish Workshop — every sprite on a labeled parchment tile, replaying on a 2.2-second beat. Under the dev server, editing any sprite file hot-reloads the gallery mid-loop. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
24 lines
576 B
Svelte
24 lines
576 B
Svelte
<script lang="ts">
|
|
import type { FxOf } from "../fx";
|
|
import { center } from "./geom";
|
|
let { fx }: { fx: FxOf<"slime-stuck"> } = $props();
|
|
const c = $derived(center(fx.at));
|
|
</script>
|
|
|
|
<circle cx={c.x} cy={c.y} r="12" class="slime" />
|
|
|
|
<style>
|
|
.slime {
|
|
transform-box: fill-box;
|
|
transform-origin: center;
|
|
fill: rgba(140, 200, 60, 0.5);
|
|
stroke: #7a9e2e;
|
|
stroke-width: 3;
|
|
animation: sink 0.9s ease-out forwards;
|
|
}
|
|
@keyframes sink {
|
|
0% { opacity: 0.9; transform: scale(1.3); }
|
|
100% { opacity: 0; transform: scale(0.7); }
|
|
}
|
|
</style>
|