feat(backgrounds): add matrix-rain background

This commit is contained in:
Boris Kovalskii
2026-06-11 10:28:26 +10:00
parent 3df2ef0f39
commit ab91c86f81
8 changed files with 182 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ const backgroundImports: Record<Exclude<BackgroundType, 'none'>, () => Promise<u
fireflies: () => import('./fireflies'),
snowfall: () => import('./snowfall'),
starfield: () => import('./starfield'),
'matrix-rain': () => import('./matrix-rain'),
};
/** Prefetch the JS chunk for a background type (call early to avoid lazy-load delay) */
@@ -53,6 +54,7 @@ export const backgroundComponents: Record<
fireflies: lazy(() => import('./fireflies')),
snowfall: lazy(() => import('./snowfall')),
starfield: lazy(() => import('./starfield')),
'matrix-rain': lazy(() => import('./matrix-rain')),
};
// Registry of all background definitions with settings for the editor
@@ -683,4 +685,42 @@ export const backgroundRegistry: BackgroundDefinition[] = [
},
],
},
{
type: 'matrix-rain',
labelKey: 'admin.backgrounds.matrixRain',
descriptionKey: 'admin.backgrounds.matrixRainDesc',
category: 'canvas',
settings: [
{ key: 'color', label: 'admin.backgrounds.particleColor', type: 'color', default: '#00ff41' },
{
key: 'density',
label: 'admin.backgrounds.density',
type: 'number',
min: 10,
max: 100,
step: 5,
default: 70,
},
{
key: 'speed',
label: 'admin.backgrounds.speed',
type: 'number',
min: 0.2,
max: 3,
step: 0.1,
default: 1,
},
{
key: 'charset',
label: 'admin.backgrounds.charset',
type: 'select',
default: 'katakana',
options: [
{ label: 'Katakana', value: 'katakana' },
{ label: 'Latin', value: 'latin' },
{ label: 'Binary', value: 'binary' },
],
},
],
},
];