Skip to content

Commit 7fe773a

Browse files
style: add unique themes for wisteria, space, train, forest, and magic ambient sounds
1 parent 88d6fc5 commit 7fe773a

2 files changed

Lines changed: 115 additions & 1 deletion

File tree

‎frontend/js/ambient.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ class AmbientManager {
258258
if (this.spaceToggle) {
259259
this.spaceToggle.addEventListener('change', () => {
260260
if (this.spaceToggle.checked) {
261+
if (typeof setTheme === 'function') setTheme('space');
261262
this.spaceAudio.currentTime = 0;
262263
this.spaceAudio.play().then(() => {
263264
this.saveAudioState('space', true);
@@ -272,6 +273,7 @@ class AmbientManager {
272273
if (this.trainToggle) {
273274
this.trainToggle.addEventListener('change', () => {
274275
if (this.trainToggle.checked) {
276+
if (typeof setTheme === 'function') setTheme('train');
275277
this.trainAudio.currentTime = 0;
276278
this.trainAudio.play().then(() => {
277279
this.saveAudioState('train', true);
@@ -286,6 +288,7 @@ class AmbientManager {
286288
if (this.forestToggle) {
287289
this.forestToggle.addEventListener('change', () => {
288290
if (this.forestToggle.checked) {
291+
if (typeof setTheme === 'function') setTheme('forest');
289292
this.forestAudio.currentTime = 0;
290293
this.forestAudio.play().then(() => {
291294
this.saveAudioState('forest', true);
@@ -300,6 +303,7 @@ class AmbientManager {
300303
if (this.magicToggle) {
301304
this.magicToggle.addEventListener('change', () => {
302305
if (this.magicToggle.checked) {
306+
if (typeof setTheme === 'function') setTheme('magic');
303307
this.magicAudio.currentTime = 0;
304308
this.magicAudio.play().then(() => {
305309
this.saveAudioState('magic', true);
@@ -314,6 +318,7 @@ class AmbientManager {
314318
if (this.animeToggle) {
315319
this.animeToggle.addEventListener('change', () => {
316320
if (this.animeToggle.checked) {
321+
if (typeof setTheme === 'function') setTheme('anime');
317322
this.animeAudio.currentTime = 0;
318323
this.animeAudio.play().then(() => {
319324
this.saveAudioState('anime', true);

‎frontend/js/theme-manager.js‎

Lines changed: 110 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,118 @@ const THEMES = {
135135
"--theme-border": "#4e342e",
136136
"--theme-pill-bg": "#3e2723"
137137
}
138+
},
139+
"space": {
140+
light: {
141+
"--theme-bg": "#f3e8ff",
142+
"--theme-surface": "#ffffff",
143+
"--theme-accent": "#7b2cbf",
144+
"--theme-accent-light": "#9d4edd",
145+
"--theme-text": "#240046",
146+
"--theme-text-muted": "#5a189a",
147+
"--theme-border": "#e0aaff",
148+
"--theme-pill-bg": "#faf5ff"
149+
},
150+
dark: {
151+
"--theme-bg": "#10002b",
152+
"--theme-surface": "#240046",
153+
"--theme-accent": "#9d4edd",
154+
"--theme-accent-light": "#c77dff",
155+
"--theme-text": "#e0aaff",
156+
"--theme-text-muted": "#9d4edd",
157+
"--theme-border": "#3c096c",
158+
"--theme-pill-bg": "#240046"
159+
}
160+
},
161+
"anime": {
162+
light: {
163+
"--theme-bg": "#fdf4ff",
164+
"--theme-surface": "#ffffff",
165+
"--theme-accent": "#d946ef",
166+
"--theme-accent-light": "#e879f9",
167+
"--theme-text": "#4a044e",
168+
"--theme-text-muted": "#86198f",
169+
"--theme-border": "#f5d0fe",
170+
"--theme-pill-bg": "#faf5ff"
171+
},
172+
dark: {
173+
"--theme-bg": "#2e1026",
174+
"--theme-surface": "#4a044e",
175+
"--theme-accent": "#e879f9",
176+
"--theme-accent-light": "#f0abfc",
177+
"--theme-text": "#fae8ff",
178+
"--theme-text-muted": "#f5d0fe",
179+
"--theme-border": "#701a75",
180+
"--theme-pill-bg": "#4a044e"
181+
}
182+
},
183+
"train": {
184+
light: {
185+
"--theme-bg": "#e0e7ff",
186+
"--theme-surface": "#ffffff",
187+
"--theme-accent": "#4f46e5",
188+
"--theme-accent-light": "#6366f1",
189+
"--theme-text": "#1e1b4b",
190+
"--theme-text-muted": "#3730a3",
191+
"--theme-border": "#c7d2fe",
192+
"--theme-pill-bg": "#eef2ff"
193+
},
194+
dark: {
195+
"--theme-bg": "#0f172a",
196+
"--theme-surface": "#1e293b",
197+
"--theme-accent": "#fbbf24",
198+
"--theme-accent-light": "#fcd34d",
199+
"--theme-text": "#f8fafc",
200+
"--theme-text-muted": "#94a3b8",
201+
"--theme-border": "#334155",
202+
"--theme-pill-bg": "#1e293b"
203+
}
204+
},
205+
"forest": {
206+
light: {
207+
"--theme-bg": "#ecfdf5",
208+
"--theme-surface": "#ffffff",
209+
"--theme-accent": "#059669",
210+
"--theme-accent-light": "#10b981",
211+
"--theme-text": "#022c22",
212+
"--theme-text-muted": "#065f46",
213+
"--theme-border": "#a7f3d0",
214+
"--theme-pill-bg": "#f0fdf4"
215+
},
216+
dark: {
217+
"--theme-bg": "#022c22",
218+
"--theme-surface": "#064e3b",
219+
"--theme-accent": "#34d399",
220+
"--theme-accent-light": "#6ee7b7",
221+
"--theme-text": "#ecfdf5",
222+
"--theme-text-muted": "#a7f3d0",
223+
"--theme-border": "#065f46",
224+
"--theme-pill-bg": "#064e3b"
225+
}
226+
},
227+
"magic": {
228+
light: {
229+
"--theme-bg": "#f0fdfa",
230+
"--theme-surface": "#ffffff",
231+
"--theme-accent": "#0d9488",
232+
"--theme-accent-light": "#14b8a6",
233+
"--theme-text": "#134e4a",
234+
"--theme-text-muted": "#0f766e",
235+
"--theme-border": "#ccfbf1",
236+
"--theme-pill-bg": "#f0fdfa"
237+
},
238+
dark: {
239+
"--theme-bg": "#134e4a",
240+
"--theme-surface": "#0f766e",
241+
"--theme-accent": "#22d3ee",
242+
"--theme-accent-light": "#67e8f9",
243+
"--theme-text": "#f0fdfa",
244+
"--theme-text-muted": "#ccfbf1",
245+
"--theme-border": "#115e59",
246+
"--theme-pill-bg": "#0f766e"
247+
}
138248
}
139249
};
140-
141250
/**
142251
* Applies a specific theme to the UI by setting CSS variables on the root element.
143252
* @param {string} themeName - The key of the theme to apply.

0 commit comments

Comments
 (0)