From 06e2d70aa461b7c6aad21ee2888cb2bba6d915e3 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sat, 9 Nov 2024 18:36:28 +0000 Subject: [PATCH] [frontend] Mobile UX (reduce margin, hide on scroll) --- locales/en-US.yml | 3 ++ locales/index.d.ts | 12 +++++ locales/ja-JP.yml | 3 ++ packages/frontend/src/components/MkNote.vue | 21 ++++++++- .../frontend/src/pages/settings/general.vue | 9 ++++ packages/frontend/src/pages/timeline.vue | 16 ++++++- packages/frontend/src/store.ts | 12 +++++ packages/frontend/src/ui/universal.vue | 47 ++++++++++++++++++- 8 files changed, 119 insertions(+), 4 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index 1662f9158d88..bf693a67d0ed 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -481,6 +481,9 @@ passwordLessLogin: "Password-less login" passwordLessLoginDescription: "Allows password-less login using a security- or passkey only" resetPassword: "Reset password" newPasswordIs: "The new password is \"{password}\"" +hideNavFooter: "Automatically hide footer buttons on mobile devices" +reduceUiMargin: "Reduce UI margins on mobile devices" +largeNoteText: "Slightly enlarge note texts" reduceUiAnimation: "Reduce UI animations" share: "Share" notFound: "Not found" diff --git a/locales/index.d.ts b/locales/index.d.ts index a66761e33f91..741097eb1784 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1950,6 +1950,18 @@ export interface Locale extends ILocale { * 新しいパスワードは「{password}」です */ "newPasswordIs": ParameterizedString<"password">; + /** + * モバイルデバイスのとき下のボタンを自動で隠す + */ + "hideNavFooter": string; + /** + * モバイルデバイスのときUIの余白を減らす + */ + "reduceUiMargin": string; + /** + * ノートの文字を少し大きくする + */ + "largeNoteText": string; /** * UIのアニメーションを減らす */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index c653e5091f8e..8553696f5a36 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -483,6 +483,9 @@ passwordLessLogin: "パスワードレスログイン" passwordLessLoginDescription: "パスワードを使用せず、セキュリティキーやパスキーなどのみでログインします" resetPassword: "パスワードをリセット" newPasswordIs: "新しいパスワードは「{password}」です" +hideNavFooter: "モバイルデバイスのとき下のボタンを自動で隠す" +reduceUiMargin: "モバイルデバイスのときUIの余白を減らす" +largeNoteText: "ノートの文字を少し大きくする" reduceUiAnimation: "UIのアニメーションを減らす" share: "共有" notFound: "見つかりません" diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index 397838ca08a7..860a894078cc 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -45,7 +45,7 @@ SPDX-License-Identifier: AGPL-3.0-only -
+
@@ -64,7 +64,7 @@ SPDX-License-Identifier: AGPL-3.0-only

-
+
({{ i18n.ts.private }})
+ {{ i18n.ts.reduceUiMargin }} + {{ i18n.ts.largeNoteText }} + {{ i18n.ts.hideNavFooter }} {{ i18n.ts.reduceUiAnimation }} {{ i18n.ts.useBlurEffect }} {{ i18n.ts.useBlurEffectForModal }} @@ -284,6 +287,9 @@ const showClipButtonInNoteFooter = computed(defaultStore.makeGetterSetter('showC const reactionsDisplaySize = computed(defaultStore.makeGetterSetter('reactionsDisplaySize')); const limitWidthOfReaction = computed(defaultStore.makeGetterSetter('limitWidthOfReaction')); const collapseRenotes = computed(defaultStore.makeGetterSetter('collapseRenotes')); +const reduceMargin = computed(defaultStore.makeGetterSetter('reduceMargin')); +const largeNoteText = computed(defaultStore.makeGetterSetter('largeNoteText')); +const hideNavFooter = computed(defaultStore.makeGetterSetter('hideNavFooter')); const reduceAnimation = computed(defaultStore.makeGetterSetter('animation', v => !v, v => !v)); const useBlurEffectForModal = computed(defaultStore.makeGetterSetter('useBlurEffectForModal')); const useBlurEffect = computed(defaultStore.makeGetterSetter('useBlurEffect')); @@ -364,6 +370,9 @@ watch([ alwaysConfirmFollow, confirmWhenRevealingSensitiveMedia, contextMenu, + reduceMargin, + largeNoteText, + hideNavFooter, ], async () => { await reloadAsk({ reason: i18n.ts.reloadToApplySetting, unison: true }); }); diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue index 77b5328a339e..d8f1161b7168 100644 --- a/packages/frontend/src/pages/timeline.vue +++ b/packages/frontend/src/pages/timeline.vue @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only