mirror of
https://github.com/fankes/komari-theme-purcarte.git
synced 2025-10-19 11:59:21 +08:00
feat(theme): 新增主题可配置项,优化代码逻辑和样式
- 在 `komari-theme.json` 中添加了新的配置选项 - 支持自定义标题栏、内容区、实例页面和通用UI元素 - 优化部分组件调用逻辑 - 优化页面样式
This commit is contained in:
@@ -1,5 +1,38 @@
|
||||
export const BACKGROUND = {
|
||||
backgroundImage: "",
|
||||
// switchTime: 10, // 10 seconds
|
||||
// transition: "background-image 0.8s ease-in-out", // CSS transition for background change
|
||||
// 配置类型定义
|
||||
export interface ConfigOptions {
|
||||
backgroundImage?: string; // 背景图片URL
|
||||
tagDefaultColorList?: string; // 标签默认颜色列表
|
||||
enableLogo?: boolean; // 是否启用Logo
|
||||
logoUrl?: string; // Logo图片URL
|
||||
enableTitle?: boolean; // 是否启用标题
|
||||
titleText?: string; // 标题文本
|
||||
enableSearchButton?: boolean; // 是否启用搜索按钮
|
||||
selectedDefaultView?: "grid" | "table"; // 默认视图模式
|
||||
selectedDefaultAppearance?: "light" | "dark" | "system"; // 默认外观模式
|
||||
enableAdminButton?: boolean; // 是否启用管理员按钮
|
||||
enableStatsBar?: boolean; // 是否启用统计栏
|
||||
enableGroupedBar?: boolean; // 是否启用分组栏
|
||||
enableInstanceDetail?: boolean; // 是否启用实例详情
|
||||
enablePingChart?: boolean; // 是否启用延迟图表
|
||||
pingChartMaxPoints?: number; // 延迟图表最大点数
|
||||
}
|
||||
|
||||
// 默认配置值
|
||||
export const DEFAULT_CONFIG: ConfigOptions = {
|
||||
backgroundImage: "/assets/Moonlit-Scenery.webp",
|
||||
tagDefaultColorList:
|
||||
"ruby,gray,gold,bronze,brown,yellow,amber,orange,tomato,red,crimson,pink,plum,purple,violet,iris,indigo,blue,cyan,teal,jade,green,grass,lime,mint,sky",
|
||||
enableLogo: false,
|
||||
logoUrl: "/assets/logo.png",
|
||||
enableTitle: true,
|
||||
titleText: "Komari",
|
||||
enableSearchButton: true,
|
||||
selectedDefaultView: "grid",
|
||||
selectedDefaultAppearance: "system",
|
||||
enableAdminButton: true,
|
||||
enableStatsBar: true,
|
||||
enableGroupedBar: true,
|
||||
enableInstanceDetail: true,
|
||||
enablePingChart: true,
|
||||
pingChartMaxPoints: 0,
|
||||
};
|
||||
|
Reference in New Issue
Block a user