From 0a1133959129f8fd60e5f6cbea991fdd82e0ceee Mon Sep 17 00:00:00 2001 From: Rshig <90143161+rshigg@users.noreply.github.com> Date: Mon, 26 Jan 2026 22:07:48 -0500 Subject: [PATCH 1/9] feat: add accent color picker to settings --- app/components/AccentColorPicker.vue | 44 ++++++++++++++++++++ app/components/SearchInput.vue | 60 ++++++++++++++++++++++++++++ app/components/SettingsMenu.vue | 4 ++ app/composables/useAccentColor.ts | 42 +++++++++++++++++++ app/pages/index.vue | 8 ++-- app/pages/search.vue | 4 +- nuxt.config.ts | 6 +++ uno.config.ts | 3 +- 8 files changed, 164 insertions(+), 7 deletions(-) create mode 100644 app/components/AccentColorPicker.vue create mode 100644 app/components/SearchInput.vue create mode 100644 app/composables/useAccentColor.ts diff --git a/app/components/AccentColorPicker.vue b/app/components/AccentColorPicker.vue new file mode 100644 index 0000000000..b1cd9cd4b6 --- /dev/null +++ b/app/components/AccentColorPicker.vue @@ -0,0 +1,44 @@ + + + diff --git a/app/components/SearchInput.vue b/app/components/SearchInput.vue new file mode 100644 index 0000000000..6ec04bc59d --- /dev/null +++ b/app/components/SearchInput.vue @@ -0,0 +1,60 @@ + + + diff --git a/app/components/SettingsMenu.vue b/app/components/SettingsMenu.vue index 9a857e81bb..3936992678 100644 --- a/app/components/SettingsMenu.vue +++ b/app/components/SettingsMenu.vue @@ -163,6 +163,10 @@ onKeyStroke(',', e => { + +
+ +
diff --git a/app/composables/useAccentColor.ts b/app/composables/useAccentColor.ts new file mode 100644 index 0000000000..2762b5aeb1 --- /dev/null +++ b/app/composables/useAccentColor.ts @@ -0,0 +1,42 @@ +import { computed } from 'vue' +import { useLocalStorage } from '@vueuse/core' + +export interface AccentColor { + id: string + name: string + value: string +} + +export const ACCENT_COLORS = [ + { id: 'rose', name: 'Rose', value: '#e9aeba' }, + { id: 'amber', name: 'Amber', value: '#fbbf24' }, + { id: 'emerald', name: 'Emerald', value: '#34d399' }, + { id: 'sky', name: 'Sky', value: '#38bdf8' }, + { id: 'violet', name: 'Violet', value: '#a78bfa' }, + { id: 'coral', name: 'Coral', value: '#fb7185' }, +] as const satisfies readonly AccentColor[] + +export type ColorId = (typeof ACCENT_COLORS)[number]['id'] + +function applyColorToDocument(color: string | null) { + if (color) { + document.documentElement.style.setProperty('--accent-color', color) + } else { + document.documentElement.style.removeProperty('--accent-color') + } +} + +export function useAccentColor() { + const accentColorId = useLocalStorage('app-accent', null) + + function setAccentColor(id: ColorId | null) { + const chosenColor = ACCENT_COLORS.find(color => color.id === id)?.value ?? null + applyColorToDocument(chosenColor) + accentColorId.value = id + } + + return { + accentColorId: computed(() => accentColorId.value), + setAccentColor, + } +} diff --git a/app/pages/index.vue b/app/pages/index.vue index bbc7a93a76..3dba648d7a 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -27,7 +27,7 @@ defineOgImageComponent('Default')

- ./npmx + ./npmx