feat(backgrounds): add fireflies background

This commit is contained in:
Boris Kovalskii
2026-06-11 10:11:55 +10:00
parent caf499a824
commit 1d00ca97e5
8 changed files with 170 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ const backgroundImports: Record<Exclude<BackgroundType, 'none'>, () => Promise<u
dots: () => import('./grid-background'),
spotlight: () => import('./spotlight-bg'),
ripple: () => import('./background-ripple'),
fireflies: () => import('./fireflies'),
};
/** Prefetch the JS chunk for a background type (call early to avoid lazy-load delay) */
@@ -47,6 +48,7 @@ export const backgroundComponents: Record<
dots: lazy(() => import('./grid-background')),
spotlight: lazy(() => import('./spotlight-bg')),
ripple: lazy(() => import('./background-ripple')),
fireflies: lazy(() => import('./fireflies')),
};
// Registry of all background definitions with settings for the editor
@@ -578,4 +580,40 @@ export const backgroundRegistry: BackgroundDefinition[] = [
},
],
},
{
type: 'fireflies',
labelKey: 'admin.backgrounds.fireflies',
descriptionKey: 'admin.backgrounds.firefliesDesc',
category: 'canvas',
settings: [
{ key: 'color', label: 'admin.backgrounds.particleColor', type: 'color', default: '#ffd166' },
{
key: 'count',
label: 'admin.backgrounds.count',
type: 'number',
min: 5,
max: 200,
step: 5,
default: 40,
},
{
key: 'speed',
label: 'admin.backgrounds.speed',
type: 'number',
min: 0.1,
max: 3,
step: 0.1,
default: 1,
},
{
key: 'size',
label: 'admin.backgrounds.size',
type: 'number',
min: 0.5,
max: 6,
step: 0.5,
default: 2,
},
],
},
];