feat(backgrounds): add constellation background

This commit is contained in:
Boris Kovalskii
2026-06-11 10:31:45 +10:00
parent 71160c6700
commit 510e4bd738
8 changed files with 176 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ const backgroundImports: Record<Exclude<BackgroundType, 'none'>, () => Promise<u
starfield: () => import('./starfield'),
'matrix-rain': () => import('./matrix-rain'),
'liquid-gradient': () => import('./liquid-gradient'),
constellation: () => import('./constellation'),
};
/** Prefetch the JS chunk for a background type (call early to avoid lazy-load delay) */
@@ -57,6 +58,7 @@ export const backgroundComponents: Record<
starfield: lazy(() => import('./starfield')),
'matrix-rain': lazy(() => import('./matrix-rain')),
'liquid-gradient': lazy(() => import('./liquid-gradient')),
constellation: lazy(() => import('./constellation')),
};
// Registry of all background definitions with settings for the editor
@@ -757,4 +759,37 @@ export const backgroundRegistry: BackgroundDefinition[] = [
},
],
},
{
type: 'constellation',
labelKey: 'admin.backgrounds.constellation',
descriptionKey: 'admin.backgrounds.constellationDesc',
category: 'canvas',
settings: [
{
key: 'particleColor',
label: 'admin.backgrounds.particleColor',
type: 'color',
default: '#818cf8',
},
{ key: 'lineColor', label: 'admin.backgrounds.lineColor', type: 'color', default: '#818cf8' },
{
key: 'count',
label: 'admin.backgrounds.count',
type: 'number',
min: 10,
max: 200,
step: 5,
default: 60,
},
{
key: 'linkDistance',
label: 'admin.backgrounds.linkDistance',
type: 'number',
min: 40,
max: 300,
step: 10,
default: 120,
},
],
},
];