From 55f52a3c53ff7c2f553722c5b97a9eff7404d300 Mon Sep 17 00:00:00 2001 From: nae Date: Fri, 6 Sep 2024 16:44:57 -0500 Subject: [PATCH] add option for text outline --- src/pages/Home.vue | 5 ++++ src/pages/settings/Appearance.vue | 38 +++++++++++++++++++++++++++++++ src/plugins/localization/en.ts | 5 ++++ src/plugins/localization/ja.ts | 5 ++++ src/stores/appearance.ts | 3 +++ 5 files changed, 56 insertions(+) diff --git a/src/pages/Home.vue b/src/pages/Home.vue index bff1fef..78188df 100644 --- a/src/pages/Home.vue +++ b/src/pages/Home.vue @@ -56,6 +56,9 @@ const interim_color = appearanceStore.text.interim_color const font_name = appearanceStore.text.font.name const font_subtype = appearanceStore.text.font.sub_type +const outline_size = `${appearanceStore.text.outline ? appearanceStore.text.outline_size : 0}px` +const outline_color = appearanceStore.text.outline_color + const overlay_main = ref(false) const overlay_page = ref(0) @@ -100,6 +103,8 @@ html { font-size: v-bind(font_size); overflow-y: auto; max-height: calc(100vh - v-bind(outer_size)); + -webkit-text-stroke: v-bind(outline_size) v-bind(outline_color); + paint-order: stroke fill; } .log-list::-webkit-scrollbar { diff --git a/src/pages/settings/Appearance.vue b/src/pages/settings/Appearance.vue index a9641fb..8409b35 100644 --- a/src/pages/settings/Appearance.vue +++ b/src/pages/settings/Appearance.vue @@ -98,6 +98,33 @@ hide-details /> + + + + + + + + + + + + + @@ -167,6 +194,17 @@ + + + {{ $t('settings.appearance.text.outline.color') }} + + + + + + + + diff --git a/src/plugins/localization/en.ts b/src/plugins/localization/en.ts index a4c4690..b721afd 100644 --- a/src/plugins/localization/en.ts +++ b/src/plugins/localization/en.ts @@ -100,6 +100,11 @@ export default { font_family: 'Font family', font_type: 'Type', font_size: 'Font Size', + outline: { + enabled: 'Text outline', + size: 'Text outline size', + color: 'Text outline color' + }, fade: 'Fade text', fade_after: 'Fade text after', seconds: 'seconds', diff --git a/src/plugins/localization/ja.ts b/src/plugins/localization/ja.ts index eb9614c..7c5c65f 100644 --- a/src/plugins/localization/ja.ts +++ b/src/plugins/localization/ja.ts @@ -100,6 +100,11 @@ export default { font_family: 'フォント', font_type: 'タイプ', font_size: '文字の大きさ', + outline: { + enabled: 'テキスト輪郭', + size: 'テキスト輪郭の大きさ', + color: 'テキスト輪郭色' + }, fade: 'フェード', fade_after: '〇〇秒後にフェード', fade_for: '〇〇秒間のフェード', diff --git a/src/stores/appearance.ts b/src/stores/appearance.ts index d129a13..84958d6 100644 --- a/src/stores/appearance.ts +++ b/src/stores/appearance.ts @@ -28,6 +28,9 @@ export const useAppearanceStore = defineStore('appearance', () => { { style: 'italic', weight: '900' }, ], }, + outline: true, + outline_size: 0, + outline_color: '#6d6d6d', font_size: 64, enable_fade: true, hide_after: 10, // seconds