Skip to content

Commit 4c3bd9f

Browse files
feat(desktop): add layouts themes and visualizer intensity
- Add layouts D, E, and F with matching window sizes - Persist music visualizer intensity in settings - Register aurora and ember themes in the desktop app - Update the music visualizer to use the new intensity setting
1 parent 7a25a2a commit 4c3bd9f

13 files changed

Lines changed: 652 additions & 49 deletions

File tree

apps/desktop/src-tauri/src/resize.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ pub enum Layout {
66
B,
77
C,
88
D,
9+
E,
10+
F,
911
Settings,
1012
SearchSongs,
1113
AIDJ,
@@ -18,7 +20,9 @@ pub fn set_layout(window: WebviewWindow, layout: Layout) {
1820
Layout::A => LogicalSize { width: 500.0, height: 150.0 },
1921
Layout::B => LogicalSize { width: 400.0, height: 200.0 },
2022
Layout::C => LogicalSize { width: 400.0, height: 200.0 },
21-
Layout::D => LogicalSize { width: 400.0, height: 200.0 },
23+
Layout::D => LogicalSize { width: 520.0, height: 236.0 },
24+
Layout::E => LogicalSize { width: 400.0, height: 424.0 },
25+
Layout::F => LogicalSize { width: 620.0, height: 118.0 },
2226
Layout::Settings => LogicalSize { width: 800.0, height: 800.0 },
2327
Layout::SearchSongs => LogicalSize { width: 400.0, height: 600.0 },
2428
Layout::AIDJ => LogicalSize { width: 400.0, height: 600.0 },

apps/desktop/src-tauri/src/settings.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ pub struct Settings {
6969
pub show_music_visualizer: bool,
7070
#[serde(default = "default_visualizer_color")]
7171
pub music_visualizer_color: String,
72+
#[serde(default = "default_visualizer_intensity")]
73+
pub music_visualizer_intensity: u8,
7274
#[serde(default)]
7375
pub last_played_track: Option<LastPlayedTrack>,
7476
}
@@ -89,6 +91,10 @@ fn default_visualizer_color() -> String {
8991
"theme".to_string()
9092
}
9193

94+
fn default_visualizer_intensity() -> u8 {
95+
100
96+
}
97+
9298
#[derive(Serialize, Deserialize, Debug, Clone)]
9399
pub struct AIProviderConfig {
94100
pub provider: String,
@@ -111,6 +117,7 @@ impl Default for Settings {
111117
window_opacity: 100,
112118
show_music_visualizer: false,
113119
music_visualizer_color: "theme".into(),
120+
music_visualizer_intensity: 100,
114121
last_played_track: None,
115122
}
116123
}

apps/desktop/src/hooks/useWindowLayout.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
import { invoke } from "@tauri-apps/api/core";
22
import { useCallback } from "react";
33

4-
export type Layout = "A" | "B" | "C" | "D" | "Settings" | "SearchSongs" | "AIDJ" | "Volume";
4+
export type Layout =
5+
| "A"
6+
| "B"
7+
| "C"
8+
| "D"
9+
| "E"
10+
| "F"
11+
| "Settings"
12+
| "SearchSongs"
13+
| "AIDJ"
14+
| "Volume";
515

616
export default function useWindowLayout() {
717
const setLayout = useCallback(async (layout: Layout) => {

apps/desktop/src/lib/settingLib.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export type Settings = {
9292
window_opacity: number;
9393
show_music_visualizer: boolean;
9494
music_visualizer_color: string;
95+
music_visualizer_intensity: number;
9596
last_played_track: LastPlayedTrack | null;
9697
provider_playback_cache: ProviderPlaybackCache | null;
9798
youtube_volume: number | null;
@@ -154,6 +155,7 @@ export async function readSettings(): Promise<Settings> {
154155
window_opacity: settings.window_opacity ?? 100,
155156
show_music_visualizer: settings.show_music_visualizer ?? false,
156157
music_visualizer_color: settings.music_visualizer_color ?? "theme",
158+
music_visualizer_intensity: settings.music_visualizer_intensity ?? 100,
157159
last_played_track: settings.last_played_track ?? null,
158160
provider_playback_cache: settings.provider_playback_cache ?? null,
159161
youtube_volume: settings.youtube_volume ?? null,
@@ -172,6 +174,7 @@ export async function readSettings(): Promise<Settings> {
172174
window_opacity: 100,
173175
show_music_visualizer: false,
174176
music_visualizer_color: "theme",
177+
music_visualizer_intensity: 100,
175178
last_played_track: null,
176179
provider_playback_cache: null,
177180
youtube_volume: null,

apps/desktop/src/loader/themeLoader.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import aurora from "../themes/aurora.json" with { type: "json" };
12
import bmw from "../themes/bmw.json" with { type: "json" };
23
import catppuccin from "../themes/catppuccin.json" with { type: "json" };
34
import chatgpt from "../themes/chatgpt.json" with { type: "json" };
45
import dark from "../themes/dark.json" with { type: "json" };
56
import dracula from "../themes/dracula.json" with { type: "json" };
7+
import ember from "../themes/ember.json" with { type: "json" };
68
import light from "../themes/light.json" with { type: "json" };
79
import milka from "../themes/milka.json" with { type: "json" };
810
import youtube from "../themes/youtube.json" with { type: "json" };
@@ -108,6 +110,8 @@ export const THEMES: Record<string, ThemeConfig> = {
108110
bmw: transformTheme(bmw),
109111
youtube: transformTheme(youtube),
110112
chatgpt: transformTheme(chatgpt),
113+
aurora: transformTheme(aurora),
114+
ember: transformTheme(ember),
111115
};
112116

113117
export function applyThemeConfig(t: ThemeConfig): void {
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"name": "aurora",
3+
4+
"panel": {
5+
"background": "linear-gradient(160deg, rgba(9, 20, 24, 0.92) 0%, rgba(12, 26, 33, 0.92) 45%, rgba(17, 24, 39, 0.94) 100%)",
6+
"borderRadius": 18,
7+
"shadow": "0 18px 48px rgba(4, 12, 15, 0.7), 0 0 0 1px rgba(94, 234, 212, 0.08)"
8+
},
9+
10+
"settings": {
11+
"panelBg": "rgba(13, 27, 33, 0.6)",
12+
"panelBorder": "rgba(94, 234, 212, 0.12)",
13+
"text": "#E6FBF6",
14+
"textMuted": "rgba(190, 227, 220, 0.68)",
15+
"itemHover": "rgba(94, 234, 212, 0.08)",
16+
"itemActive": "rgba(94, 234, 212, 0.16)",
17+
"accent": "#5EEAD4"
18+
},
19+
20+
"controls": {
21+
"iconColor": "#B9F4E8",
22+
"iconColorActive": "#FFFFFF",
23+
"iconBackground": "transparent",
24+
"iconBackgroundHover": "rgba(94, 234, 212, 0.1)"
25+
},
26+
27+
"playbar": {
28+
"trackBg": "rgba(148, 233, 218, 0.14)",
29+
"trackFill": "linear-gradient(90deg, #34D399 0%, #22D3EE 52%, #A78BFA 100%)",
30+
"thumbColor": "#ECFEFF",
31+
"timeTextColor": "rgba(174, 224, 216, 0.8)"
32+
},
33+
34+
"typography": {
35+
"songTitle": {
36+
"color": "#F2FFFB",
37+
"weight": 600
38+
},
39+
"songArtist": {
40+
"color": "#6EE7D2",
41+
"weight": 400
42+
}
43+
},
44+
45+
"actions": {
46+
"iconColor": "#A7F3E5",
47+
"iconBackground": "rgba(94, 234, 212, 0.06)",
48+
"iconBackgroundHover": "rgba(94, 234, 212, 0.14)"
49+
},
50+
51+
"cover": {
52+
"borderColor": "rgba(94, 234, 212, 0.35)",
53+
"borderRadius": 12
54+
}
55+
}

apps/desktop/src/themes/ember.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"name": "ember",
3+
4+
"panel": {
5+
"background": "linear-gradient(155deg, rgba(28, 14, 16, 0.93) 0%, rgba(35, 17, 18, 0.93) 50%, rgba(23, 12, 17, 0.94) 100%)",
6+
"borderRadius": 18,
7+
"shadow": "0 18px 48px rgba(12, 4, 4, 0.72), 0 0 0 1px rgba(251, 146, 60, 0.09)"
8+
},
9+
10+
"settings": {
11+
"panelBg": "rgba(38, 19, 20, 0.6)",
12+
"panelBorder": "rgba(251, 146, 60, 0.14)",
13+
"text": "#FDEDE4",
14+
"textMuted": "rgba(234, 200, 186, 0.68)",
15+
"itemHover": "rgba(251, 146, 60, 0.09)",
16+
"itemActive": "rgba(251, 146, 60, 0.17)",
17+
"accent": "#FB923C"
18+
},
19+
20+
"controls": {
21+
"iconColor": "#F8C9A6",
22+
"iconColorActive": "#FFFFFF",
23+
"iconBackground": "transparent",
24+
"iconBackgroundHover": "rgba(251, 146, 60, 0.12)"
25+
},
26+
27+
"playbar": {
28+
"trackBg": "rgba(251, 191, 160, 0.16)",
29+
"trackFill": "linear-gradient(90deg, #F43F5E 0%, #FB923C 55%, #FBBF24 100%)",
30+
"thumbColor": "#FFF7ED",
31+
"timeTextColor": "rgba(245, 206, 184, 0.82)"
32+
},
33+
34+
"typography": {
35+
"songTitle": {
36+
"color": "#FFF6EF",
37+
"weight": 600
38+
},
39+
"songArtist": {
40+
"color": "#FDBA74",
41+
"weight": 400
42+
}
43+
},
44+
45+
"actions": {
46+
"iconColor": "#FBCFA3",
47+
"iconBackground": "rgba(251, 146, 60, 0.07)",
48+
"iconBackgroundHover": "rgba(251, 146, 60, 0.16)"
49+
},
50+
51+
"cover": {
52+
"borderColor": "rgba(251, 146, 60, 0.38)",
53+
"borderRadius": 12
54+
}
55+
}

0 commit comments

Comments
 (0)