逆張りモードの実装

This commit is contained in:
mattyatea 2023-10-12 17:34:30 +09:00
parent 592c6e60a9
commit 40469aa0ce
9 changed files with 81 additions and 26 deletions

3
locales/index.d.ts vendored
View File

@ -14,6 +14,8 @@ export interface Locale {
"forgotPassword": string; "forgotPassword": string;
"fetchingAsApObject": string; "fetchingAsApObject": string;
"ok": string; "ok": string;
"hanntenn": string;
"hanntennInfo": string;
"ruby": string; "ruby": string;
"gotIt": string; "gotIt": string;
"cancel": string; "cancel": string;
@ -1972,6 +1974,7 @@ export interface Locale {
"memo": string; "memo": string;
"notifications": string; "notifications": string;
"gamingMode": string; "gamingMode": string;
"gyakubariMode": string;
"timeline": string; "timeline": string;
"calendar": string; "calendar": string;
"trends": string; "trends": string;

View File

@ -11,6 +11,8 @@ password: "パスワード"
forgotPassword: "パスワードを忘れた" forgotPassword: "パスワードを忘れた"
fetchingAsApObject: "連合に照会中" fetchingAsApObject: "連合に照会中"
ok: "OK" ok: "OK"
hanntenn: "アイコンとバナーを反転させる"
hanntennInfo: "ダークだったらライトのアイコンに、ライトだったらダークのアイコンに。"
ruby: "ルビ" ruby: "ルビ"
gotIt: "わかった" gotIt: "わかった"
cancel: "キャンセル" cancel: "キャンセル"
@ -1889,6 +1891,7 @@ _widgets:
memo: "付箋" memo: "付箋"
notifications: "通知" notifications: "通知"
gamingMode: "ゲーミングモード" gamingMode: "ゲーミングモード"
gyakubariMode: "反転モード"
timeline: "タイムライン" timeline: "タイムライン"
calendar: "カレンダー" calendar: "カレンダー"
trends: "トレンド" trends: "トレンド"

View File

@ -1,6 +1,6 @@
{ {
"name": "misskey", "name": "misskey",
"version": "2023.10.1-prismisskey.1", "version": "2023.10.1-prismisskey.2",
"codename": "nasubi", "codename": "nasubi",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -134,13 +134,13 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch v-model="useSystemFont">{{ i18n.ts.useSystemFont }}</MkSwitch> <MkSwitch v-model="useSystemFont">{{ i18n.ts.useSystemFont }}</MkSwitch>
<MkSwitch v-model="disableDrawer">{{ i18n.ts.disableDrawer }}</MkSwitch> <MkSwitch v-model="disableDrawer">{{ i18n.ts.disableDrawer }}</MkSwitch>
<MkSwitch v-model="forceShowAds">{{ i18n.ts.forceShowAds }}</MkSwitch> <MkSwitch v-model="forceShowAds">{{ i18n.ts.forceShowAds }}</MkSwitch>
<MkSwitch v-model="enableDataSaverMode">{{ i18n.ts.dataSaver }}</MkSwitch>
<MkSwitch :disabled="enableUltimateDataSaverMode || enableCellularWithUltimateDataSaver" v-model="enableDataSaverMode">{{ i18n.ts.dataSaver }}</MkSwitch> <MkSwitch :disabled="enableUltimateDataSaverMode || enableCellularWithUltimateDataSaver" v-model="enableDataSaverMode">{{ i18n.ts.dataSaver }}</MkSwitch>
<MkSwitch :disabled="enableUltimateDataSaverMode || enableCellularWithUltimateDataSaver" v-model="enableCellularWithDataSaver">{{ i18n.ts.cellularWithDataSaver }}</MkSwitch> <MkSwitch :disabled="enableUltimateDataSaverMode || enableCellularWithUltimateDataSaver" v-model="enableCellularWithDataSaver">{{ i18n.ts.cellularWithDataSaver }}</MkSwitch>
<MkSwitch v-model="enableUltimateDataSaverMode">{{ i18n.ts.UltimateDataSaver }}</MkSwitch> <MkSwitch v-model="enableUltimateDataSaverMode">{{ i18n.ts.UltimateDataSaver }}</MkSwitch>
<MkSwitch v-model="enableCellularWithUltimateDataSaver">{{ i18n.ts.cellularWithUltimateDataSaver }}</MkSwitch> <MkSwitch v-model="enableCellularWithUltimateDataSaver">{{ i18n.ts.cellularWithUltimateDataSaver }}</MkSwitch>
<MkSwitch v-model="enableGamingMode">{{ i18n.ts.gamingMode }} <template #caption>{{ i18n.ts.gamingModeInfo }} </template></MkSwitch> <MkSwitch v-model="enableGamingMode">{{ i18n.ts.gamingMode }} <template #caption>{{ i18n.ts.gamingModeInfo }} </template></MkSwitch>
<MkSwitch v-model="enableonlyAndWithSave">{{ i18n.ts.onlyAndWithSave}}<template #caption>{{ i18n.ts.onlyAndWithSaveInfo }} </template></MkSwitch> <MkSwitch v-model="enableonlyAndWithSave">{{ i18n.ts.onlyAndWithSave}}<template #caption>{{ i18n.ts.onlyAndWithSaveInfo }} </template></MkSwitch>
<MkSwitch v-model="enablehanntenn">{{ i18n.ts.hanntenn }}<template #caption>{{ i18n.ts.hanntennInfo }} </template></MkSwitch>
</div> </div>
<div> <div>
<MkRadios v-model="emojiStyle"> <MkRadios v-model="emojiStyle">
@ -285,6 +285,7 @@ const notificationStackAxis = computed(defaultStore.makeGetterSetter('notificati
const keepScreenOn = computed(defaultStore.makeGetterSetter('keepScreenOn')); const keepScreenOn = computed(defaultStore.makeGetterSetter('keepScreenOn'));
const enableGamingMode = computed(defaultStore.makeGetterSetter('gamingMode')); const enableGamingMode = computed(defaultStore.makeGetterSetter('gamingMode'));
const enableonlyAndWithSave = computed(defaultStore.makeGetterSetter('onlyAndWithSave')); const enableonlyAndWithSave = computed(defaultStore.makeGetterSetter('onlyAndWithSave'));
const enablehanntenn = computed(defaultStore.makeGetterSetter('enablehanntenn'));
const showMediaTimeline = computed(defaultStore.makeGetterSetter('showMediaTimeline')); const showMediaTimeline = computed(defaultStore.makeGetterSetter('showMediaTimeline'));
const showVisibilityColor = computed(defaultStore.makeGetterSetter('showVisibilityColor')) const showVisibilityColor = computed(defaultStore.makeGetterSetter('showVisibilityColor'))
const FeaturedOrNote = computed(defaultStore.makeGetterSetter('FeaturedOrNote')) const FeaturedOrNote = computed(defaultStore.makeGetterSetter('FeaturedOrNote'))

View File

@ -304,6 +304,10 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'device', where: 'device',
default: [] as string[], default: [] as string[],
}, },
enablehanntenn:{
where:'device',
default: false
},
recentlyUsedUsers: { recentlyUsedUsers: {
where: 'device', where: 'device',
default: [] as string[], default: [] as string[],

View File

@ -94,6 +94,7 @@ import {$i, openAccountMenu as openAccountMenu_} from '@/account';
import {bannerDark, bannerLight, defaultStore, iconDark, iconLight} from '@/store'; import {bannerDark, bannerLight, defaultStore, iconDark, iconLight} from '@/store';
import {i18n} from '@/i18n'; import {i18n} from '@/i18n';
import {instance} from '@/instance'; import {instance} from '@/instance';
function hexToRgb(hex) { function hexToRgb(hex) {
// 16 "#" // 16 "#"
hex = hex.replace(/^#/, ''); hex = hex.replace(/^#/, '');
@ -105,6 +106,7 @@ function hexToRgb(hex) {
return `${r},${g},${b}`; return `${r},${g},${b}`;
} }
document.documentElement.style.setProperty('--homeColor', hexToRgb(defaultStore.state.homeColor)); document.documentElement.style.setProperty('--homeColor', hexToRgb(defaultStore.state.homeColor));
document.documentElement.style.setProperty("--followerColor",hexToRgb(defaultStore.state.followerColor)); document.documentElement.style.setProperty("--followerColor",hexToRgb(defaultStore.state.followerColor));
document.documentElement.style.setProperty("--specifiedColor",hexToRgb(defaultStore.state.specifiedColor)) document.documentElement.style.setProperty("--specifiedColor",hexToRgb(defaultStore.state.specifiedColor))
@ -118,6 +120,7 @@ let gaming = ref('');
const gamingMode = computed(defaultStore.makeGetterSetter('gamingMode')); const gamingMode = computed(defaultStore.makeGetterSetter('gamingMode'));
const darkMode = computed(defaultStore.makeGetterSetter('darkMode')); const darkMode = computed(defaultStore.makeGetterSetter('darkMode'));
let gamingType = computed(defaultStore.state.gamingType);
if (darkMode.value) { if (darkMode.value) {
bannerUrl.value = bannerDark; bannerUrl.value = bannerDark;
@ -137,7 +140,6 @@ watch(darkMode, () => {
} }
}) })
// gaming.value
if (darkMode.value && gamingMode.value == true) { if (darkMode.value && gamingMode.value == true) {
gaming.value = 'dark'; gaming.value = 'dark';
} else if (!darkMode.value && gamingMode.value == true) { } else if (!darkMode.value && gamingMode.value == true) {
@ -167,6 +169,7 @@ watch(gamingMode, () => {
} }
}) })
const menu = computed(() => defaultStore.state.menu); const menu = computed(() => defaultStore.state.menu);
const otherMenuItemIndicated = computed(() => { const otherMenuItemIndicated = computed(() => {
for (const def in navbarItemDef) { for (const def in navbarItemDef) {

View File

@ -10,10 +10,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { Interpreter, Parser } from '@syuilo/aiscript'; import { useWidgetPropsManager, WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget';
import { useWidgetPropsManager, Widget, WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget';
import { GetFormResultType } from '@/scripts/form.js'; import { GetFormResultType } from '@/scripts/form.js';
import MkButton from '@/components/MkButton.vue';
import {i18n} from "@/i18n.js"; import {i18n} from "@/i18n.js";
import MkSwitch from "@/components/MkSwitch.vue"; import MkSwitch from "@/components/MkSwitch.vue";
import {computed} from "vue"; import {computed} from "vue";

View File

@ -0,0 +1,41 @@
<!--
SPDX-FileCopyrightText: syuilo and other misskey contributors
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<div>
<MkSwitch v-model="enablehanntenn">{{ i18n.ts.hanntenn }} <template #caption>{{ i18n.ts.hanntennInfo }} </template></MkSwitch>
</div>
</template>
<script lang="ts" setup>
import { useWidgetPropsManager, WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget';
import { GetFormResultType } from '@/scripts/form.js';
import {i18n} from "@/i18n.js";
import MkSwitch from "@/components/MkSwitch.vue";
import {computed} from "vue";
import {defaultStore} from "@/store.js";
const enablehanntenn = computed(defaultStore.makeGetterSetter('enablehanntenn'));
const name = 'gyakubariMode';
const widgetPropsDef = {
};
type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
const props = defineProps<WidgetComponentProps<WidgetProps>>();
const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const { widgetProps, configure } = useWidgetPropsManager(name,
widgetPropsDef,
props,
emit,
);
defineExpose<WidgetComponentExpose>({
name,
configure,
id: props.widget ? props.widget.id : null,
});
</script>

View File

@ -11,6 +11,7 @@ export default function(app: App) {
app.component('WidgetMemo', defineAsyncComponent(() => import('./WidgetMemo.vue'))); app.component('WidgetMemo', defineAsyncComponent(() => import('./WidgetMemo.vue')));
app.component('WidgetNotifications', defineAsyncComponent(() => import('./WidgetNotifications.vue'))); app.component('WidgetNotifications', defineAsyncComponent(() => import('./WidgetNotifications.vue')));
app.component('WidgetGamingMode', defineAsyncComponent(() => import('./WidgetGamingMode.vue'))); app.component('WidgetGamingMode', defineAsyncComponent(() => import('./WidgetGamingMode.vue')));
app.component('WidgetGyakubariMode', defineAsyncComponent(() => import('./WidgetGyakubariMode.vue')));
app.component('WidgetTimeline', defineAsyncComponent(() => import('./WidgetTimeline.vue'))); app.component('WidgetTimeline', defineAsyncComponent(() => import('./WidgetTimeline.vue')));
app.component('WidgetCalendar', defineAsyncComponent(() => import('./WidgetCalendar.vue'))); app.component('WidgetCalendar', defineAsyncComponent(() => import('./WidgetCalendar.vue')));
app.component('WidgetRss', defineAsyncComponent(() => import('./WidgetRss.vue'))); app.component('WidgetRss', defineAsyncComponent(() => import('./WidgetRss.vue')));
@ -42,6 +43,7 @@ export const widgets = [
'memo', 'memo',
'notifications', 'notifications',
'gamingMode', 'gamingMode',
'gyakubariMode',
'timeline', 'timeline',
'calendar', 'calendar',
'rss', 'rss',