nanka iroiro

This commit is contained in:
syuilo
2020-12-27 17:04:41 +09:00
parent 03667e1fe6
commit 3fc427b699
9 changed files with 110 additions and 158 deletions

View File

@@ -45,15 +45,17 @@ import { router } from '@/router';
import { applyTheme } from '@/scripts/theme';
import { isDeviceDarkmode } from '@/scripts/is-device-darkmode';
import { i18n } from '@/i18n';
import { stream, isMobile, dialog } from '@/os';
import { stream, isMobile, dialog, post } from '@/os';
import * as sound from '@/scripts/sound';
import { $i, refreshAccount, login, updateAccount, signout } from '@/account';
import { defaultStore, ColdDeviceStorage } from '@/store';
import { fetchInstance, instance } from '@/instance';
import { makeHotkey } from './scripts/hotkey';
import { search } from './scripts/search';
console.info(`Misskey v${version}`);
window.clearTimeout(window.mkBootTimer);
window.clearTimeout((window as any).mkBootTimer);
if (_DEV_) {
console.warn('Development mode!!!');
@@ -214,6 +216,16 @@ window.matchMedia('(prefers-color-scheme: dark)').addListener(mql => {
});
//#endregion
// shortcut
document.addEventListener('keydown', makeHotkey({
'd': () => {
defaultStore.set('darkMode', !defaultStore.state.darkMode);
},
'p|n': post,
's': search,
//TODO: 'h|/': help
}));
watch(defaultStore.reactiveState.useBlurEffectForModal, v => {
document.documentElement.style.setProperty('--modalBgFilter', v ? 'blur(4px)' : 'none');
}, { immediate: true });