From 5f3a5d1f7e31e41d40dd9d6da4ad6bd8739471a2 Mon Sep 17 00:00:00 2001 From: Hakadao Date: Fri, 31 Mar 2023 01:52:58 +0800 Subject: [PATCH] feat: implement theme color switching feature --- src/components/Settings.vue | 48 +++++++++++++++++++++++++++----- src/contentScripts/views/App.vue | 12 ++++++++ src/logic/storage.ts | 1 + src/models/models.ts | 1 + src/utils/main.ts | 18 ++++++++++++ 5 files changed, 73 insertions(+), 7 deletions(-) diff --git a/src/components/Settings.vue b/src/components/Settings.vue index 73d920ee..14b10a63 100644 --- a/src/components/Settings.vue +++ b/src/components/Settings.vue @@ -10,6 +10,28 @@ const { t, locale } = useI18n() const authorizeBtn = ref() as Ref const langsSelect = ref() as Ref +const themeColorOptions = reactive>([ + { + value: '#00a1d6', + label: '#00a1d6', + }, + { + value: '#fb7299', + label: '#fb7299', + }, + { + value: '#49e0ad', + label: '#49e0ad', + }, + { + value: '#0d9488', + label: '#0d9488', + }, + { + value: '#6366f1', + label: '#6366f1', + }, +]) const langs = computed(() => { return [ @@ -56,13 +78,17 @@ function close() { emit('close') } -function onAuthorize() { +function handleAuthorize() { grantAccessKey(authorizeBtn.value) } -function onRevoke() { +function handleRevoke() { revokeAccessKey() } + +function changeThemeColor(color: string) { + settings.value.themeColor = color +}