From f7793de61be3bc714fbebaa4a496f9e26fdc38d8 Mon Sep 17 00:00:00 2001 From: MattyaDaihuku <87429435+MattyaDaihuku@users.noreply.github.com> Date: Sat, 19 Oct 2024 03:12:32 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E3=82=B5=E3=83=BC=E3=83=90=E3=83=BC=E6=83=85=E5=A0=B1?= =?UTF-8?q?=E3=82=92=E3=82=A2=E3=82=A4=E3=82=B3=E3=83=B3=E3=81=AE=E3=81=BF?= =?UTF-8?q?=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/en-US.yml | 1 + locales/index.d.ts | 4 ++ locales/ja-JP.yml | 1 + locales/ja-KS.yml | 1 + locales/ko-KR.yml | 1 + locales/zh-CN.yml | 1 + locales/zh-TW.yml | 1 + .../src/components/MkInstanceIcon.vue | 53 +++++++++++++++++++ packages/frontend/src/components/MkNote.vue | 9 ++-- .../src/components/global/MkAvatar.vue | 43 +++++++++++++++ .../frontend/src/pages/settings/general.vue | 6 +-- packages/frontend/src/store.ts | 4 ++ 12 files changed, 117 insertions(+), 8 deletions(-) create mode 100644 packages/frontend/src/components/MkInstanceIcon.vue diff --git a/locales/en-US.yml b/locales/en-US.yml index d580e324bf..75aa5d33be 100755 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -742,6 +742,7 @@ openInSideView: "Open in side view" defaultNavigationBehaviour: "Default navigation behavior" editTheseSettingsMayBreakAccount: "Editing these settings may damage your account." instanceTicker: "Instance information of notes" +instanceIcon: "Display only the instance's logo on the timeline" waitingFor: "Waiting for {x}" random: "Random" system: "System" diff --git a/locales/index.d.ts b/locales/index.d.ts index ef516b0a28..fbf2571ad0 100755 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -2976,6 +2976,10 @@ export interface Locale extends ILocale { * ノートのサーバー情報 */ "instanceTicker": string; + /** + * サーバー情報をアイコンのみにする + */ + "instanceIcon": string; /** * {x}を待っています */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 61d679ef14..1f37e948eb 100755 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -740,6 +740,7 @@ openInSideView: "サイドビューで開く" defaultNavigationBehaviour: "デフォルトのナビゲーション" editTheseSettingsMayBreakAccount: "これらの設定を編集するとアカウントが破損する可能性があります。" instanceTicker: "ノートのサーバー情報" +instanceIcon: "サーバー情報をアイコンのみにする" waitingFor: "{x}を待っています" random: "ランダム" system: "システム" diff --git a/locales/ja-KS.yml b/locales/ja-KS.yml index e485b144e9..1f0ed41e33 100755 --- a/locales/ja-KS.yml +++ b/locales/ja-KS.yml @@ -721,6 +721,7 @@ openInSideView: "サイドビューで開く" defaultNavigationBehaviour: "デフォルトのナビゲーション" editTheseSettingsMayBreakAccount: "このへんの設定をようわからんままイジるとアカウントが壊れて使えんくなるかも知れへんで?" instanceTicker: "ノートのサーバー情報" +instanceIcon: "サーバー情報をアイコンのみにするで" waitingFor: "{x}を待っとるで" random: "ランダム" system: "システム" diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml index 64bae5a9d7..7b8544cce1 100755 --- a/locales/ko-KR.yml +++ b/locales/ko-KR.yml @@ -711,6 +711,7 @@ openInSideView: "사이드뷰로 열기" defaultNavigationBehaviour: "기본 탐색 동작" editTheseSettingsMayBreakAccount: "이 설정을 변경하면 계정이 손상될 수 있습니다." instanceTicker: "노트의 서버 정보" +instanceIcon: "타임라인에 인스턴스의 아이콘만 표시하기" waitingFor: "{x}을(를) 기다리고 있습니다" random: "무작위" system: "시스템" diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml index 1bc1df7930..5d3846886c 100755 --- a/locales/zh-CN.yml +++ b/locales/zh-CN.yml @@ -717,6 +717,7 @@ openInSideView: "在侧边栏中打开" defaultNavigationBehaviour: "默认导航" editTheseSettingsMayBreakAccount: "编辑这些设置可以会损坏您的账号" instanceTicker: "帖子的服务器来源" +instanceIcon: "在时间轴上只显示实例图标" waitingFor: "等待 {x}" random: "随机" system: "系统" diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml index 80ad2eaf02..75869ed5e3 100755 --- a/locales/zh-TW.yml +++ b/locales/zh-TW.yml @@ -717,6 +717,7 @@ openInSideView: "在側欄中開啟" defaultNavigationBehaviour: "預設導航" editTheseSettingsMayBreakAccount: "修改這些設定可能會毀損您的帳戶" instanceTicker: "貼文的伺服器資訊" +instanceIcon: "僅在時間軸上顯示實例的圖標" waitingFor: "等待{x}" random: "隨機" system: "系統" diff --git a/packages/frontend/src/components/MkInstanceIcon.vue b/packages/frontend/src/components/MkInstanceIcon.vue new file mode 100644 index 0000000000..f43a0ed612 --- /dev/null +++ b/packages/frontend/src/components/MkInstanceIcon.vue @@ -0,0 +1,53 @@ + + + + + + + diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index 44ea8d1623..c2fb9b5e94 100755 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -55,10 +55,10 @@ SPDX-License-Identifier: AGPL-3.0-only
- -
- - + +
+ +

@@ -312,6 +312,7 @@ const hardMuted = ref(props.withHardMute && checkMute(appearNote.value, $i?.hard const translation = ref(null); const translating = ref(false); const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.value.user.instance); +const showInstanceIcon = ref(defaultStore.state.instanceIcon); const canRenote = computed(() => ['public', 'home'].includes(appearNote.value.visibility) || (appearNote.value.visibility === 'followers' && appearNote.value.userId === $i?.id)); const renoteCollapsed = ref( defaultStore.state.collapseRenotes && isRenote && ( diff --git a/packages/frontend/src/components/global/MkAvatar.vue b/packages/frontend/src/components/global/MkAvatar.vue index de62fe12a9..cd343fdba1 100755 --- a/packages/frontend/src/components/global/MkAvatar.vue +++ b/packages/frontend/src/components/global/MkAvatar.vue @@ -35,6 +35,7 @@ SPDX-License-Identifier: AGPL-3.0-only }" alt="" > + @@ -49,6 +50,7 @@ import { extractAvgColorFromBlurhash } from '@/scripts/extract-avg-color-from-bl import { acct, userPage } from '@/filters/user.js'; import MkUserOnlineIndicator from '@/components/MkUserOnlineIndicator.vue'; import { defaultStore } from '@/store.js'; +import MkInstanceIcon from '@/components/MkInstanceIcon.vue'; const animation = ref(defaultStore.state.animation); const squareAvatars = ref(defaultStore.state.squareAvatars); @@ -62,6 +64,7 @@ const props = withDefaults(defineProps<{ indicator?: boolean; decorations?: Omit[]; forceShowDecoration?: boolean; + showInstance?: boolean; }>(), { target: null, link: false, @@ -69,6 +72,7 @@ const props = withDefaults(defineProps<{ indicator: false, decorations: undefined, forceShowDecoration: false, + showInstance: false, }); const emit = defineEmits<{ @@ -330,4 +334,43 @@ watch(() => props.user.avatarBlurhash, () => { width: 200%; pointer-events: none; } + +.decorationBlink { + animation: blink 1s infinite; +} + +@keyframes blink { + 0%, 100% { + filter: brightness(2); + } + 50% { + filter: brightness(1); + } +} + +.instanceicon { + height: 25px; + z-index: 2; + position: absolute; + left: 0; + bottom: 0; +} + +@container (max-width: 580px) { + .instanceicon { + height: 21px; + } +} + +@container (max-width: 450px) { + .instanceicon { + height: 19px; + } +} + +@container (max-width: 300px) { + .instanceicon { + height: 17px; + } +} diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index 6fb9b4b336..1dffdb92b6 100755 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -110,10 +110,7 @@ SPDX-License-Identifier: AGPL-3.0-only - - {{ i18n.ts.instanceIcon }} - {{ i18n.ts.originalFeature }} - + {{ i18n.ts.instanceIcon }} @@ -418,6 +415,7 @@ const showFixedPostFormInChannel = computed(defaultStore.makeGetterSetter('showF const numberOfPageCache = computed(defaultStore.makeGetterSetter('numberOfPageCache')); const numberOfReplies = computed(defaultStore.makeGetterSetter('numberOfReplies')); const instanceTicker = computed(defaultStore.makeGetterSetter('instanceTicker')); +const instanceIcon = computed(defaultStore.makeGetterSetter('instanceIcon')); const enableInfiniteScroll = computed(defaultStore.makeGetterSetter('enableInfiniteScroll')); const useReactionPickerForContextMenu = computed(defaultStore.makeGetterSetter('useReactionPickerForContextMenu')); const squareAvatars = computed(defaultStore.makeGetterSetter('squareAvatars')); diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index 618cc98421..eb1e96e19c 100755 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -344,6 +344,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: 'remote' as 'none' | 'remote' | 'always', }, + instanceIcon: { + where: 'device', + default: false, + }, emojiPickerScale: { where: 'device', default: 1,