feat(frontend): 画面に雪を降らせる機能を復活

This commit is contained in:
syuilo
2023-12-16 13:52:52 +09:00
parent 8c218397bc
commit 742da2f1e9
7 changed files with 501 additions and 4 deletions

View File

@@ -20,6 +20,7 @@ import { mainRouter } from '@/router.js';
import { initializeSw } from '@/scripts/initialize-sw.js';
import { deckStore } from '@/ui/deck/deck-store.js';
import { emojiPicker } from '@/scripts/emoji-picker.js';
import { SnowfallEffect } from '@/scripts/snowfall-effect.js';
export async function mainBoot() {
const { isClientUpdated } = await common(() => createApp(
@@ -75,6 +76,13 @@ export async function mainBoot() {
},
};
if (defaultStore.state.enableSeasonalScreenEffect) {
const month = new Date().getMonth() + 1;
if (month === 12 || month === 1) {
new SnowfallEffect().render();
}
}
if ($i) {
// only add post shortcuts if logged in
hotkeys['p|n'] = post;

View File

@@ -122,6 +122,7 @@ 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="enableSeasonalScreenEffect">{{ i18n.ts.seasonalScreenEffect }}</MkSwitch>
</div>
<div>
<MkRadios v-model="emojiStyle">
@@ -289,6 +290,7 @@ const notificationStackAxis = computed(defaultStore.makeGetterSetter('notificati
const keepScreenOn = computed(defaultStore.makeGetterSetter('keepScreenOn'));
const disableStreamingTimeline = computed(defaultStore.makeGetterSetter('disableStreamingTimeline'));
const useGroupedNotifications = computed(defaultStore.makeGetterSetter('useGroupedNotifications'));
const enableSeasonalScreenEffect = computed(defaultStore.makeGetterSetter('enableSeasonalScreenEffect'));
watch(lang, () => {
miLocalStorage.setItem('lang', lang.value as string);
@@ -328,6 +330,7 @@ watch([
highlightSensitiveMedia,
keepScreenOn,
disableStreamingTimeline,
enableSeasonalScreenEffect,
], async () => {
await reloadAsk();
});

File diff suppressed because one or more lines are too long

View File

@@ -412,6 +412,10 @@ export const defaultStore = markRaw(new Storage('base', {
code: false,
} as Record<string, boolean>,
},
enableSeasonalScreenEffect: {
where: 'device',
default: false,
},
sound_masterVolume: {
where: 'device',