wip: not loading themes until reload, missing in dashboard, bad alignment and scaling

This commit is contained in:
rasmusq
2025-11-28 00:26:43 +01:00
parent 85f8671c72
commit 7c6ff9458f
21 changed files with 417 additions and 20 deletions

51
src/lib/utils/themes.ts Normal file
View File

@@ -0,0 +1,51 @@
/**
* Theme configuration for SVG overlays
*/
export type ThemePattern = 'waves' | 'geometric' | 'dots' | 'none';
export interface Theme {
name: string;
pattern: ThemePattern;
opacity: number;
}
export const AVAILABLE_THEMES: Record<string, Theme> = {
none: {
name: 'None',
pattern: 'none',
opacity: 0
},
waves: {
name: 'Waves',
pattern: 'waves',
opacity: 0.1
},
geometric: {
name: 'Geometric',
pattern: 'geometric',
opacity: 0.1
},
dots: {
name: 'Dots',
pattern: 'dots',
opacity: 0.15
}
};
export const DEFAULT_THEME = 'none';
export function getTheme(themeName?: string | null): Theme {
if (!themeName || !AVAILABLE_THEMES[themeName]) {
return AVAILABLE_THEMES[DEFAULT_THEME];
}
return AVAILABLE_THEMES[themeName];
}
/**
* Get color from a CSS color string or class
* For now, we'll use currentColor which inherits from the parent
*/
export function getThemeColor(color?: string | null): string {
return color || 'currentColor';
}