diff --git a/locales/en-US.yml b/locales/en-US.yml index 9a00f027e..5ce5f13b3 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1285,9 +1285,11 @@ clipNoteLimitExceeded: "No more notes can be added to this clip." timeTravel: "Time Travel" timeTravelDescription: "Show posts before this date." pariPlusInfo: "Pari Plus! customized Misskey~!" +pariPlusSystemSettings: "Pari Plus! system settings" pariPlusNoteSettings: "Pari Plus! note settings" pariPlusAppearanceSettings: "Pari Plus! appearance settings" pariPlusFontPicker: "Default fonts" +useHardwareAcceleration: "Enable hardware Acceleration" autoTranslateButton: "Display translation function on notes in different languages" showDetailTimeWhenHover: "Hover the timestamp of the note to expand the detailed time" noteClickToOpen: "Click to open note details" diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml index a8182ddb7..ecf49ca02 100644 --- a/locales/zh-CN.yml +++ b/locales/zh-CN.yml @@ -1294,9 +1294,11 @@ passkeyVerificationSucceededButPasswordlessLoginDisabled: "通行密钥验证成 timeTravel: "时光机" timeTravelDescription: "显示该日期以前的帖子" pariPlusInfo: "Pari Plus! 定制 Misskey~!" +pariPlusSystemSettings: "Pari Plus! 系统设置" pariPlusNoteSettings: "Pari Plus! 帖文设置" pariPlusAppearanceSettings: "Pari Plus! 外观设置" pariPlusFontPicker: "默认字体" +useHardwareAcceleration: "启用硬件加速" autoTranslateButton: "在不同语言的帖文上显示翻译功能" showDetailTimeWhenHover: "悬浮/长按帖文时间戳时,展开详细时间" noteClickToOpen: "点击展开帖文详情" diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml index 559f11d96..ba7f79d6a 100644 --- a/locales/zh-TW.yml +++ b/locales/zh-TW.yml @@ -1294,9 +1294,11 @@ passkeyVerificationSucceededButPasswordlessLoginDisabled: "雖然驗證金鑰成 timeTravel: "時光機" timeTravelDescription: "回到指定的日期" pariPlusInfo: "Pari Plus! 自訂 Misskey~!" +pariPlusSystemSettings: "Pari Plus! 系統設定" pariPlusNoteSettings: "Pari Plus! 貼文設定" pariPlusAppearanceSettings: "Pari Plus! 外觀設定" pariPlusFontPicker: "預設字體" +useHardwareAcceleration: "啓用硬件加速" autoTranslateButton: "在不同語言的貼文上顯示翻譯功能" showDetailTimeWhenHover: "長按貼文時間戳記時展開詳細時間" noteClickToOpen: "點擊展開貼文詳情" diff --git a/packages/frontend/src/boot/common.ts b/packages/frontend/src/boot/common.ts index 90ae49ee5..322b6bbe9 100644 --- a/packages/frontend/src/boot/common.ts +++ b/packages/frontend/src/boot/common.ts @@ -197,6 +197,19 @@ export async function common(createVue: () => App) { } }, { immediate: true }); + watch(defaultStore.reactiveState.useHardwareAcceleration, v => { + if (v) { + const miHwAcc = document.createElement('style'); + miHwAcc.textContent = `html { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + }`; + document.head.appendChild(miHwAcc); + } else { + document.querySelector('style')?.remove(); + } + }, { immediate: true }); + // Keep screen on const onVisibilityChange = () => document.addEventListener('visibilitychange', () => { if (document.visibilityState === 'visible') { diff --git a/packages/frontend/src/pages/settings/pari.vue b/packages/frontend/src/pages/settings/pari.vue index f8010725a..ccf007950 100644 --- a/packages/frontend/src/pages/settings/pari.vue +++ b/packages/frontend/src/pages/settings/pari.vue @@ -7,6 +7,14 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.pariPlusInfo }} + +
{{ i18n.ts.pariPlusSystemSettings }}
+
+
+ {{ i18n.ts.useHardwareAcceleration }} +
+
+
{{ i18n.ts.pariPlusAppearanceSettings }}
@@ -102,6 +110,8 @@ function saveFontSize() { fontSizeNumberOld.value = fontSizeNumber.value; } +const useHardwareAcceleration = computed(defaultStore.makeGetterSetter('useHardwareAcceleration')); + const autoTranslateButton = computed(defaultStore.makeGetterSetter('autoTranslateButton')); const showDetailTimeWhenHover = computed(defaultStore.makeGetterSetter('showDetailTimeWhenHover')); const noteClickToOpen = computed(defaultStore.makeGetterSetter('noteClickToOpen')); diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index 9408f4fac..5f270ad87 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -508,6 +508,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: { type: 'syuilo/bubble1', volume: 1 } as SoundStore, }, + useHardwareAcceleration: { + where: 'device', + default: true, + }, autoTranslateButton: { where: 'device', default: false,