なんかもう色々変えた
This commit is contained in:
parent
984c8b73cc
commit
62b70f85f0
11 changed files with 43 additions and 7 deletions
|
|
@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
|
||||
<template>
|
||||
<div :class="$style.root" :style="bg">
|
||||
<img v-if="faviconUrl && !defaultStore.state.enableDataSaverMode" :class="$style.icon" :src="faviconUrl"/>
|
||||
<img v-if="faviconUrl && !defaultStore.state.enableUltimateDataSaverMode" :class="$style.icon" :src="faviconUrl"/>
|
||||
<div :class="$style.name">{{ instance.name }}</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
|
||||
<template>
|
||||
<component :is="link ? MkA : 'span'" v-user-preview="preview ? user.id : undefined" v-bind="bound" class="_noSelect" :class="[$style.root, { [$style.animation]: animation, [$style.cat]: user.isCat, [$style.square]: squareAvatars }]" :style="{ color }" :title="acct(user)" @click="onClick">
|
||||
<MkImgWithBlurhash :class="$style.inner" :src="defaultStore.state.enableDataSaverMode ? undefined : url" :hash="user?.avatarBlurhash" :cover="true" :onlyAvgColor="true"/>
|
||||
<MkImgWithBlurhash :class="$style.inner" :src="defaultStore.state.enableUltimateDataSaverMode ? undefined : url" :hash="user?.avatarBlurhash" :cover="true" :onlyAvgColor="true"/>
|
||||
<MkUserOnlineIndicator v-if="indicator" :class="$style.indicator" :user="user"/>
|
||||
<div v-if="user.isCat" :class="[$style.ears]">
|
||||
<div :class="$style.earLeft">
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ const rawUrl = computed(() => {
|
|||
const url = computed(() => {
|
||||
if (rawUrl.value == null) return null;
|
||||
const useOriginalSize = props.useOriginalSize;
|
||||
const enableDataSaverMode = defaultStore.state.enableDataSaverMode;
|
||||
const enableDataSaverMode = defaultStore.state.enableUltimateDataSaverMode;
|
||||
let datasaver_result ;
|
||||
if (enableDataSaverMode) {
|
||||
datasaver_result = useOriginalSize ? undefined : 'datasaver';
|
||||
|
|
|
|||
|
|
@ -113,8 +113,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkSwitch v-model="useSystemFont">{{ i18n.ts.useSystemFont }}</MkSwitch>
|
||||
<MkSwitch v-model="disableDrawer">{{ i18n.ts.disableDrawer }}</MkSwitch>
|
||||
<MkSwitch v-model="forceShowAds">{{ i18n.ts.forceShowAds }}</MkSwitch>
|
||||
<MkSwitch v-model="enableDataSaverMode">{{ i18n.ts.dataSaver }}</MkSwitch>
|
||||
<MkSwitch v-model="enableCellularWithDataSaver">{{ i18n.ts.cellularWithDataSaver }}</MkSwitch>
|
||||
<MkSwitch :disabled="enableUltimateDataSaverMode || enableCellularWithUltimateDataSaver" v-model="enableDataSaverMode">{{ i18n.ts.dataSaver }}</MkSwitch>
|
||||
<MkSwitch :disabled="enableUltimateDataSaverMode || enableCellularWithUltimateDataSaver" v-model="enableCellularWithDataSaver">{{ i18n.ts.cellularWithDataSaver }}</MkSwitch>
|
||||
<MkSwitch v-model="enableUltimateDataSaverMode">{{ i18n.ts.UltimateDataSaver }}</MkSwitch>
|
||||
<MkSwitch v-model="enableCellularWithUltimateDataSaver">{{ i18n.ts.cellularWithUltimateDataSaver }}</MkSwitch>
|
||||
</div>
|
||||
<div>
|
||||
<MkRadios v-model="emojiStyle">
|
||||
|
|
@ -230,6 +232,8 @@ const forceShowAds = computed(defaultStore.makeGetterSetter('forceShowAds'));
|
|||
const loadRawImages = computed(defaultStore.makeGetterSetter('loadRawImages'));
|
||||
const enableDataSaverMode = computed(defaultStore.makeGetterSetter('enableDataSaverMode')) ;
|
||||
const enableCellularWithDataSaver = computed(defaultStore.makeGetterSetter('enableCellularWithDataSaver'));
|
||||
const enableUltimateDataSaverMode = computed(defaultStore.makeGetterSetter('enableUltimateDataSaverMode'))
|
||||
const enableCellularWithUltimateDataSaver = computed(defaultStore.makeGetterSetter('enableCellularWithUltimateDataSaver'));
|
||||
const imageNewTab = computed(defaultStore.makeGetterSetter('imageNewTab'));
|
||||
const nsfw = computed(defaultStore.makeGetterSetter('nsfw'));
|
||||
const showFixedPostForm = computed(defaultStore.makeGetterSetter('showFixedPostForm'));
|
||||
|
|
@ -244,6 +248,8 @@ const notificationPosition = computed(defaultStore.makeGetterSetter('notificatio
|
|||
const notificationStackAxis = computed(defaultStore.makeGetterSetter('notificationStackAxis'));
|
||||
const showTimelineReplies = computed(defaultStore.makeGetterSetter('showTimelineReplies'));
|
||||
|
||||
|
||||
|
||||
watch(lang, () => {
|
||||
miLocalStorage.setItem('lang', lang.value as string);
|
||||
miLocalStorage.removeItem('locale');
|
||||
|
|
|
|||
|
|
@ -204,10 +204,18 @@ export const defaultStore = markRaw(new Storage('base', {
|
|||
where: 'device',
|
||||
default: false,
|
||||
},
|
||||
enableUltimateDataSaverMode: {
|
||||
where: 'device',
|
||||
default: false,
|
||||
},
|
||||
enableCellularWithDataSaver: {
|
||||
where: 'device',
|
||||
default: false,
|
||||
},
|
||||
enableCellularWithUltimateDataSaver: {
|
||||
where: 'device',
|
||||
default: false,
|
||||
},
|
||||
disableShowingAnimatedImages: {
|
||||
where: 'device',
|
||||
default: window.matchMedia('(prefers-reduced-motion)').matches,
|
||||
|
|
|
|||
|
|
@ -130,6 +130,18 @@ const DESKTOP_THRESHOLD = 1100;
|
|||
const MOBILE_THRESHOLD = 500;
|
||||
|
||||
onMounted(() => {
|
||||
if (
|
||||
window.navigator.connection.type === "cellular" &&
|
||||
!defaultStore.state.enableUltimateDataSaverMode &&
|
||||
defaultStore.state.enableCellularWithUltimateDataSaver
|
||||
) {
|
||||
defaultStore.state.enableDataSaverMode = true;
|
||||
defaultStore.state.enableUltimateDataSaverMode = true;
|
||||
} else if (window.navigator.connection.type !== "cellular" && window.navigator.connection.type !== "undefined" && defaultStore.state.enableDataSaverMode && defaultStore.state.enableCellularWithDataSaver) {
|
||||
defaultStore.state.enableDataSaverMode = false;
|
||||
defaultStore.state.enableUltimateDataSaverMode = true;
|
||||
}
|
||||
|
||||
if (
|
||||
window.navigator.connection.type === "cellular" &&
|
||||
!defaultStore.state.enableDataSaverMode &&
|
||||
|
|
@ -140,6 +152,9 @@ onMounted(() => {
|
|||
} else if (window.navigator.connection.type !== "cellular" && window.navigator.connection.type !== "undefined" && defaultStore.state.enableDataSaverMode && defaultStore.state.enableCellularWithDataSaver) {
|
||||
defaultStore.state.enableDataSaverMode = false;
|
||||
}
|
||||
if (defaultStore.state.enableUltimateDataSaverMode) {
|
||||
defaultStore.state.enableDataSaverMode = true;
|
||||
}
|
||||
});
|
||||
// デスクトップでウィンドウを狭くしたときモバイルUIが表示されて欲しいことはあるので deviceKind === 'desktop' の判定は行わない
|
||||
const isDesktop = ref(window.innerWidth >= DESKTOP_THRESHOLD);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export function getConfig(): UserConfig {
|
|||
},
|
||||
|
||||
plugins: [
|
||||
compression(),
|
||||
compression({ algorithm: 'brotliCompress'}),
|
||||
pluginVue({
|
||||
reactivityTransform: true,
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue