diff --git a/src/lib/components/wishlist/WishlistItem.svelte b/src/lib/components/wishlist/WishlistItem.svelte
index b4e0461..bcf25d4 100644
--- a/src/lib/components/wishlist/WishlistItem.svelte
+++ b/src/lib/components/wishlist/WishlistItem.svelte
@@ -13,6 +13,7 @@
children?: any;
showDragHandle?: boolean;
theme?: string | null;
+ wishlistColor?: string | null;
}
let {
@@ -20,7 +21,8 @@
showImage = true,
children,
showDragHandle = false,
- theme = null
+ theme = null,
+ wishlistColor = null
}: Props = $props();
const t = $derived(languageStore.t);
@@ -51,7 +53,7 @@
return `${symbol}${amount}`;
}
- const cardStyle = $derived(getCardStyle(item.color));
+ const cardStyle = $derived(getCardStyle(item.color, wishlistColor));
diff --git a/src/lib/stores/theme.svelte.ts b/src/lib/stores/theme.svelte.ts
index f5d14ef..ea236a9 100644
--- a/src/lib/stores/theme.svelte.ts
+++ b/src/lib/stores/theme.svelte.ts
@@ -5,6 +5,7 @@ type ResolvedTheme = 'light' | 'dark';
class ThemeStore {
current = $state('system');
+ resolved = $state('light');
constructor() {
if (browser) {
@@ -27,6 +28,8 @@ class ThemeStore {
const isDark = this.current === 'dark' ||
(this.current === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);
+ this.resolved = isDark ? 'dark' : 'light';
+
if (isDark) {
document.documentElement.classList.add('dark');
} else {
@@ -35,11 +38,7 @@ class ThemeStore {
}
getResolvedTheme(): ResolvedTheme {
- if (!browser) return 'light';
-
- const isDark = this.current === 'dark' ||
- (this.current === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);
- return isDark ? 'dark' : 'light';
+ return this.resolved;
}
toggle() {
diff --git a/src/lib/utils/colors.ts b/src/lib/utils/colors.ts
index c3aaf01..36085c7 100644
--- a/src/lib/utils/colors.ts
+++ b/src/lib/utils/colors.ts
@@ -11,8 +11,10 @@ export function hexToRgba(hex: string, alpha: number): string {
/**
* Generate card style string with color, transparency, and blur
*/
-export function getCardStyle(color: string | null): string {
- if (!color) return '';
+export function getCardStyle(color: string | null, fallbackColor?: string | null): string {
+ const activeColor = color || fallbackColor;
+ if (!activeColor) return '';
- return `background-color: ${hexToRgba(color, 0.2)} !important; backdrop-filter: blur(10px) !important; -webkit-backdrop-filter: blur(10px) !important;`;
+ const opacity = color ? 0.2 : 0.15;
+ return `background-color: ${hexToRgba(activeColor, opacity)} !important; backdrop-filter: blur(10px) !important; -webkit-backdrop-filter: blur(10px) !important;`;
}
diff --git a/src/routes/wishlist/[token]/+page.svelte b/src/routes/wishlist/[token]/+page.svelte
index 1c639c3..f94c3a0 100644
--- a/src/routes/wishlist/[token]/+page.svelte
+++ b/src/routes/wishlist/[token]/+page.svelte
@@ -110,7 +110,7 @@
{#if filteredItems.length > 0}
{#each filteredItems as item}
-
+
(null);
let searchQuery = $state("");
let currentTheme = $state(data.wishlist.theme || 'none');
+ let currentColor = $state(data.wishlist.color);
let items = $state- ([]);
@@ -111,9 +112,14 @@
currentTheme = theme || 'none';
await wishlistUpdates.updateTheme(theme);
}
+
+ async function handleColorUpdate(color: string | null) {
+ currentColor = color;
+ await wishlistUpdates.updateColor(color);
+ }
-
+
@@ -131,6 +137,7 @@