diff --git a/locales/index.d.ts b/locales/index.d.ts index 440f24ac84..cb03dee518 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -7446,6 +7446,14 @@ export interface Locale extends ILocale { * 常に表示 */ "always": string; + /** + * リモートユーザーに表示(アイコンのみ) + */ + "remoteIcon": string; + /** + * 常に表示(アイコンのみ) + */ + "alwaysIcon": string; }; "_serverDisconnectedBehavior": { /** diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 5d8e1a5e72..87f1db030d 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1944,6 +1944,8 @@ _instanceTicker: none: "表示しない" remote: "リモートユーザーに表示" always: "常に表示" + remoteIcon: "リモートユーザーに表示(アイコンのみ)" + alwaysIcon: "常に表示(アイコンのみ)" _serverDisconnectedBehavior: reload: "自動でリロード" diff --git a/packages/frontend/src/components/MkInstanceIcon.vue b/packages/frontend/src/components/MkInstanceIcon.vue new file mode 100644 index 0000000000..791f8ffa00 --- /dev/null +++ b/packages/frontend/src/components/MkInstanceIcon.vue @@ -0,0 +1,54 @@ + + + + + + + diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index cf0d0787b1..47468a2064 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -47,7 +47,7 @@ SPDX-License-Identifier: AGPL-3.0-only
- +
@@ -274,6 +274,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 = (defaultStore.state.instanceTicker === 'alwaysIcon') || (defaultStore.state.instanceTicker === 'remoteIcon' && appearNote.value.user.instance); 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 35c07bc80c..b4aba8fa7f 100644 --- a/packages/frontend/src/components/global/MkAvatar.vue +++ b/packages/frontend/src/components/global/MkAvatar.vue @@ -36,6 +36,7 @@ SPDX-License-Identifier: AGPL-3.0-only alt="" > + @@ -49,6 +50,7 @@ import { getStaticImageUrl } from '@/scripts/media-proxy.js'; 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 & { blink?: boolean; })[]; 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<{ @@ -343,4 +347,30 @@ watch(() => props.user.avatarBlurhash, () => { 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 1bfdfd0e76..617b6968f8 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -69,6 +69,8 @@ SPDX-License-Identifier: AGPL-3.0-only + + diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index 911a463636..6d241dbdbc 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -295,7 +295,7 @@ export const defaultStore = markRaw(new Storage('base', { }, instanceTicker: { where: 'device', - default: 'remote' as 'none' | 'remote' | 'always', + default: 'remote' as 'none' | 'remote' | 'always' | 'remoteIcon' | 'alwaysIcon', }, emojiPickerScale: { where: 'device',