feat: データセーバー強化
This commit is contained in:
parent
c8d0c99d61
commit
f2ab7a5626
|
@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div :class="$style.root" :style="bg">
|
<div :class="$style.root" :style="bg">
|
||||||
<img v-if="faviconUrl" :class="$style.icon" :src="faviconUrl"/>
|
<img v-if="faviconUrl && !defaultStore.state.enableDataSaverMode" :class="$style.icon" :src="faviconUrl"/>
|
||||||
<div :class="$style.name">{{ instance.name }}</div>
|
<div :class="$style.name">{{ instance.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -15,6 +15,7 @@ import { } from 'vue';
|
||||||
import { instanceName } from '@/config';
|
import { instanceName } from '@/config';
|
||||||
import { instance as Instance } from '@/instance';
|
import { instance as Instance } from '@/instance';
|
||||||
import { getProxiedImageUrlNullable } from '@/scripts/media-proxy';
|
import { getProxiedImageUrlNullable } from '@/scripts/media-proxy';
|
||||||
|
import {defaultStore} from "@/store";
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
instance?: {
|
instance?: {
|
||||||
|
|
|
@ -4,108 +4,122 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div :class="$style.root">
|
<div :class="$style.root">
|
||||||
<XSidebar v-if="!isMobile" :class="$style.sidebar"/>
|
<XSidebar v-if="!isMobile" :class="$style.sidebar"/>
|
||||||
|
|
||||||
<MkStickyContainer ref="contents" :class="$style.contents" style="container-type: inline-size;" @contextmenu.stop="onContextmenu">
|
<MkStickyContainer ref="contents" :class="$style.contents" style="container-type: inline-size;"
|
||||||
<template #header>
|
@contextmenu.stop="onContextmenu">
|
||||||
<div>
|
<template #header>
|
||||||
<XAnnouncements v-if="$i" :class="$style.announcements"/>
|
<div>
|
||||||
<XStatusBars :class="$style.statusbars"/>
|
<XAnnouncements v-if="$i" :class="$style.announcements"/>
|
||||||
</div>
|
<XStatusBars :class="$style.statusbars"/>
|
||||||
</template>
|
</div>
|
||||||
<RouterView/>
|
</template>
|
||||||
<div :class="$style.spacer"></div>
|
<RouterView/>
|
||||||
</MkStickyContainer>
|
<div :class="$style.spacer"></div>
|
||||||
|
</MkStickyContainer>
|
||||||
|
|
||||||
<div v-if="isDesktop" :class="$style.widgets">
|
<div v-if="isDesktop" :class="$style.widgets">
|
||||||
<XWidgets/>
|
<XWidgets/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button v-if="!isDesktop && !isMobile" :class="$style.widgetButton" class="_button" @click="widgetsShowing = true"><i class="ti ti-apps"></i></button>
|
<button v-if="!isDesktop && !isMobile" :class="$style.widgetButton" class="_button" @click="widgetsShowing = true">
|
||||||
|
<i class="ti ti-apps"></i></button>
|
||||||
|
|
||||||
<div v-if="isMobile" ref="navFooter" :class="$style.nav">
|
<div v-if="isMobile" ref="navFooter" :class="$style.nav">
|
||||||
<button :class="$style.navButton" class="_button" @click="drawerMenuShowing = true"><i :class="$style.navButtonIcon" class="ti ti-menu-2"></i><span v-if="menuIndicated" :class="$style.navButtonIndicator"><i class="_indicatorCircle"></i></span></button>
|
<button :class="$style.navButton" class="_button" @click="drawerMenuShowing = true"><i
|
||||||
<button :class="$style.navButton" class="_button" @click="mainRouter.currentRoute.value.name === 'index' ? top() : mainRouter.push('/')"><i :class="$style.navButtonIcon" class="ti ti-home"></i></button>
|
:class="$style.navButtonIcon" class="ti ti-menu-2"></i><span v-if="menuIndicated"
|
||||||
<button :class="$style.navButton" class="_button" @click="mainRouter.push('/my/notifications')"><i :class="$style.navButtonIcon" class="ti ti-bell"></i><span v-if="$i?.hasUnreadNotification" :class="$style.navButtonIndicator"><i class="_indicatorCircle"></i></span></button>
|
:class="$style.navButtonIndicator"><i
|
||||||
<button :class="$style.navButton" class="_button" @click="widgetsShowing = true"><i :class="$style.navButtonIcon" class="ti ti-apps"></i></button>
|
class="_indicatorCircle"></i></span></button>
|
||||||
<button :class="$style.postButton" class="_button" @click="os.post()"><i :class="$style.navButtonIcon" class="ti ti-pencil"></i></button>
|
<button :class="$style.navButton" class="_button"
|
||||||
</div>
|
@click="mainRouter.currentRoute.value.name === 'index' ? top() : mainRouter.push('/')"><i
|
||||||
|
:class="$style.navButtonIcon" class="ti ti-home"></i></button>
|
||||||
|
<button :class="$style.navButton" class="_button" @click="mainRouter.push('/my/notifications')"><i
|
||||||
|
:class="$style.navButtonIcon" class="ti ti-bell"></i><span v-if="$i?.hasUnreadNotification"
|
||||||
|
:class="$style.navButtonIndicator"><i
|
||||||
|
class="_indicatorCircle"></i></span></button>
|
||||||
|
<button :class="$style.navButton" class="_button" @click="widgetsShowing = true"><i :class="$style.navButtonIcon"
|
||||||
|
class="ti ti-apps"></i>
|
||||||
|
</button>
|
||||||
|
<button :class="$style.postButton" class="_button" @click="os.post()"><i :class="$style.navButtonIcon"
|
||||||
|
class="ti ti-pencil"></i></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<Transition
|
<Transition
|
||||||
:enterActiveClass="defaultStore.state.animation ? $style.transition_menuDrawerBg_enterActive : ''"
|
:enterActiveClass="defaultStore.state.animation ? $style.transition_menuDrawerBg_enterActive : ''"
|
||||||
:leaveActiveClass="defaultStore.state.animation ? $style.transition_menuDrawerBg_leaveActive : ''"
|
:leaveActiveClass="defaultStore.state.animation ? $style.transition_menuDrawerBg_leaveActive : ''"
|
||||||
:enterFromClass="defaultStore.state.animation ? $style.transition_menuDrawerBg_enterFrom : ''"
|
:enterFromClass="defaultStore.state.animation ? $style.transition_menuDrawerBg_enterFrom : ''"
|
||||||
:leaveToClass="defaultStore.state.animation ? $style.transition_menuDrawerBg_leaveTo : ''"
|
:leaveToClass="defaultStore.state.animation ? $style.transition_menuDrawerBg_leaveTo : ''"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="drawerMenuShowing"
|
v-if="drawerMenuShowing"
|
||||||
:class="$style.menuDrawerBg"
|
:class="$style.menuDrawerBg"
|
||||||
class="_modalBg"
|
class="_modalBg"
|
||||||
@click="drawerMenuShowing = false"
|
@click="drawerMenuShowing = false"
|
||||||
@touchstart.passive="drawerMenuShowing = false"
|
@touchstart.passive="drawerMenuShowing = false"
|
||||||
></div>
|
></div>
|
||||||
</Transition>
|
</Transition>
|
||||||
|
|
||||||
<Transition
|
<Transition
|
||||||
:enterActiveClass="defaultStore.state.animation ? $style.transition_menuDrawer_enterActive : ''"
|
:enterActiveClass="defaultStore.state.animation ? $style.transition_menuDrawer_enterActive : ''"
|
||||||
:leaveActiveClass="defaultStore.state.animation ? $style.transition_menuDrawer_leaveActive : ''"
|
:leaveActiveClass="defaultStore.state.animation ? $style.transition_menuDrawer_leaveActive : ''"
|
||||||
:enterFromClass="defaultStore.state.animation ? $style.transition_menuDrawer_enterFrom : ''"
|
:enterFromClass="defaultStore.state.animation ? $style.transition_menuDrawer_enterFrom : ''"
|
||||||
:leaveToClass="defaultStore.state.animation ? $style.transition_menuDrawer_leaveTo : ''"
|
:leaveToClass="defaultStore.state.animation ? $style.transition_menuDrawer_leaveTo : ''"
|
||||||
>
|
>
|
||||||
<div v-if="drawerMenuShowing" :class="$style.menuDrawer">
|
<div v-if="drawerMenuShowing" :class="$style.menuDrawer">
|
||||||
<XDrawerMenu/>
|
<XDrawerMenu/>
|
||||||
</div>
|
</div>
|
||||||
</Transition>
|
</Transition>
|
||||||
|
|
||||||
<Transition
|
<Transition
|
||||||
:enterActiveClass="defaultStore.state.animation ? $style.transition_widgetsDrawerBg_enterActive : ''"
|
:enterActiveClass="defaultStore.state.animation ? $style.transition_widgetsDrawerBg_enterActive : ''"
|
||||||
:leaveActiveClass="defaultStore.state.animation ? $style.transition_widgetsDrawerBg_leaveActive : ''"
|
:leaveActiveClass="defaultStore.state.animation ? $style.transition_widgetsDrawerBg_leaveActive : ''"
|
||||||
:enterFromClass="defaultStore.state.animation ? $style.transition_widgetsDrawerBg_enterFrom : ''"
|
:enterFromClass="defaultStore.state.animation ? $style.transition_widgetsDrawerBg_enterFrom : ''"
|
||||||
:leaveToClass="defaultStore.state.animation ? $style.transition_widgetsDrawerBg_leaveTo : ''"
|
:leaveToClass="defaultStore.state.animation ? $style.transition_widgetsDrawerBg_leaveTo : ''"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="widgetsShowing"
|
v-if="widgetsShowing"
|
||||||
:class="$style.widgetsDrawerBg"
|
:class="$style.widgetsDrawerBg"
|
||||||
class="_modalBg"
|
class="_modalBg"
|
||||||
@click="widgetsShowing = false"
|
@click="widgetsShowing = false"
|
||||||
@touchstart.passive="widgetsShowing = false"
|
@touchstart.passive="widgetsShowing = false"
|
||||||
></div>
|
></div>
|
||||||
</Transition>
|
</Transition>
|
||||||
|
|
||||||
<Transition
|
<Transition
|
||||||
:enterActiveClass="defaultStore.state.animation ? $style.transition_widgetsDrawer_enterActive : ''"
|
:enterActiveClass="defaultStore.state.animation ? $style.transition_widgetsDrawer_enterActive : ''"
|
||||||
:leaveActiveClass="defaultStore.state.animation ? $style.transition_widgetsDrawer_leaveActive : ''"
|
:leaveActiveClass="defaultStore.state.animation ? $style.transition_widgetsDrawer_leaveActive : ''"
|
||||||
:enterFromClass="defaultStore.state.animation ? $style.transition_widgetsDrawer_enterFrom : ''"
|
:enterFromClass="defaultStore.state.animation ? $style.transition_widgetsDrawer_enterFrom : ''"
|
||||||
:leaveToClass="defaultStore.state.animation ? $style.transition_widgetsDrawer_leaveTo : ''"
|
:leaveToClass="defaultStore.state.animation ? $style.transition_widgetsDrawer_leaveTo : ''"
|
||||||
>
|
>
|
||||||
<div v-if="widgetsShowing" :class="$style.widgetsDrawer">
|
<div v-if="widgetsShowing" :class="$style.widgetsDrawer">
|
||||||
<button class="_button" :class="$style.widgetsCloseButton" @click="widgetsShowing = false"><i class="ti ti-x"></i></button>
|
<button class="_button" :class="$style.widgetsCloseButton" @click="widgetsShowing = false"><i
|
||||||
<XWidgets/>
|
class="ti ti-x"></i></button>
|
||||||
</div>
|
<XWidgets/>
|
||||||
</Transition>
|
</div>
|
||||||
|
</Transition>
|
||||||
|
|
||||||
<XCommon/>
|
<XCommon/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { defineAsyncComponent, provide, onMounted, computed, ref, ComputedRef, watch, shallowRef, Ref } from 'vue';
|
import {defineAsyncComponent, provide, onMounted, computed, ref, ComputedRef, watch, shallowRef, Ref} from 'vue';
|
||||||
import XCommon from './_common_/common.vue';
|
import XCommon from './_common_/common.vue';
|
||||||
import type MkStickyContainer from '@/components/global/MkStickyContainer.vue';
|
import type MkStickyContainer from '@/components/global/MkStickyContainer.vue';
|
||||||
import { instanceName } from '@/config';
|
import {instanceName} from '@/config';
|
||||||
import XDrawerMenu from '@/ui/_common_/navbar-for-mobile.vue';
|
import XDrawerMenu from '@/ui/_common_/navbar-for-mobile.vue';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import { defaultStore } from '@/store';
|
import {defaultStore} from '@/store';
|
||||||
import { navbarItemDef } from '@/navbar';
|
import {navbarItemDef} from '@/navbar';
|
||||||
import { i18n } from '@/i18n';
|
import {i18n} from '@/i18n';
|
||||||
import { $i } from '@/account';
|
import {$i} from '@/account';
|
||||||
import { mainRouter } from '@/router';
|
import {mainRouter} from '@/router';
|
||||||
import { PageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata';
|
import {PageMetadata, provideMetadataReceiver} from '@/scripts/page-metadata';
|
||||||
import { deviceKind } from '@/scripts/device-kind';
|
import {deviceKind} from '@/scripts/device-kind';
|
||||||
import { miLocalStorage } from '@/local-storage';
|
import {miLocalStorage} from '@/local-storage';
|
||||||
import { CURRENT_STICKY_BOTTOM } from '@/const';
|
import {CURRENT_STICKY_BOTTOM} from '@/const';
|
||||||
import { useScrollPositionManager } from '@/nirax';
|
import {useScrollPositionManager} from '@/nirax';
|
||||||
|
|
||||||
const XWidgets = defineAsyncComponent(() => import('./universal.widgets.vue'));
|
const XWidgets = defineAsyncComponent(() => import('./universal.widgets.vue'));
|
||||||
const XSidebar = defineAsyncComponent(() => import('@/ui/_common_/navbar.vue'));
|
const XSidebar = defineAsyncComponent(() => import('@/ui/_common_/navbar.vue'));
|
||||||
|
@ -122,10 +136,8 @@ onMounted(() => {
|
||||||
defaultStore.state.enableCellularWithDataSaver
|
defaultStore.state.enableCellularWithDataSaver
|
||||||
) {
|
) {
|
||||||
defaultStore.state.enableDataSaverMode = true;
|
defaultStore.state.enableDataSaverMode = true;
|
||||||
} else if (
|
|
||||||
window.navigator.connection.type !== "cellular" &&
|
} else if (window.navigator.connection.type !== "cellular" && window.navigator.connection.type !== "undefined" && defaultStore.state.enableDataSaverMode && defaultStore.state.enableCellularWithDataSaver) {
|
||||||
defaultStore.state.enableDataSaverMode &&
|
|
||||||
!defaultStore.state.enableCellularWithDataSaver) {
|
|
||||||
defaultStore.state.enableDataSaverMode = false;
|
defaultStore.state.enableDataSaverMode = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -133,7 +145,7 @@ onMounted(() => {
|
||||||
const isDesktop = ref(window.innerWidth >= DESKTOP_THRESHOLD);
|
const isDesktop = ref(window.innerWidth >= DESKTOP_THRESHOLD);
|
||||||
const isMobile = ref(deviceKind === 'smartphone' || window.innerWidth <= MOBILE_THRESHOLD);
|
const isMobile = ref(deviceKind === 'smartphone' || window.innerWidth <= MOBILE_THRESHOLD);
|
||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
isMobile.value = deviceKind === 'smartphone' || window.innerWidth <= MOBILE_THRESHOLD;
|
isMobile.value = deviceKind === 'smartphone' || window.innerWidth <= MOBILE_THRESHOLD;
|
||||||
});
|
});
|
||||||
|
|
||||||
let pageMetadata = $ref<null | ComputedRef<PageMetadata>>();
|
let pageMetadata = $ref<null | ComputedRef<PageMetadata>>();
|
||||||
|
@ -143,103 +155,103 @@ const contents = shallowRef<InstanceType<typeof MkStickyContainer>>();
|
||||||
|
|
||||||
provide('router', mainRouter);
|
provide('router', mainRouter);
|
||||||
provideMetadataReceiver((info) => {
|
provideMetadataReceiver((info) => {
|
||||||
pageMetadata = info;
|
pageMetadata = info;
|
||||||
if (pageMetadata.value) {
|
if (pageMetadata.value) {
|
||||||
document.title = `${pageMetadata.value.title} | ${instanceName}`;
|
document.title = `${pageMetadata.value.title} | ${instanceName}`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const menuIndicated = computed(() => {
|
const menuIndicated = computed(() => {
|
||||||
for (const def in navbarItemDef) {
|
for (const def in navbarItemDef) {
|
||||||
if (def === 'notifications') continue; // 通知は下にボタンとして表示されてるから
|
if (def === 'notifications') continue; // 通知は下にボタンとして表示されてるから
|
||||||
if (navbarItemDef[def].indicated) return true;
|
if (navbarItemDef[def].indicated) return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
const drawerMenuShowing = ref(false);
|
const drawerMenuShowing = ref(false);
|
||||||
|
|
||||||
mainRouter.on('change', () => {
|
mainRouter.on('change', () => {
|
||||||
drawerMenuShowing.value = false;
|
drawerMenuShowing.value = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (window.innerWidth > 1024) {
|
if (window.innerWidth > 1024) {
|
||||||
const tempUI = miLocalStorage.getItem('ui_temp');
|
const tempUI = miLocalStorage.getItem('ui_temp');
|
||||||
if (tempUI) {
|
if (tempUI) {
|
||||||
miLocalStorage.setItem('ui', tempUI);
|
miLocalStorage.setItem('ui', tempUI);
|
||||||
miLocalStorage.removeItem('ui_temp');
|
miLocalStorage.removeItem('ui_temp');
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultStore.loaded.then(() => {
|
defaultStore.loaded.then(() => {
|
||||||
if (defaultStore.state.widgets.length === 0) {
|
if (defaultStore.state.widgets.length === 0) {
|
||||||
defaultStore.set('widgets', [{
|
defaultStore.set('widgets', [{
|
||||||
name: 'calendar',
|
name: 'calendar',
|
||||||
id: 'a', place: 'right', data: {},
|
id: 'a', place: 'right', data: {},
|
||||||
}, {
|
}, {
|
||||||
name: 'notifications',
|
name: 'notifications',
|
||||||
id: 'b', place: 'right', data: {},
|
id: 'b', place: 'right', data: {},
|
||||||
}, {
|
}, {
|
||||||
name: 'trends',
|
name: 'trends',
|
||||||
id: 'c', place: 'right', data: {},
|
id: 'c', place: 'right', data: {},
|
||||||
}]);
|
}]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (!isDesktop.value) {
|
if (!isDesktop.value) {
|
||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
if (window.innerWidth >= DESKTOP_THRESHOLD) isDesktop.value = true;
|
if (window.innerWidth >= DESKTOP_THRESHOLD) isDesktop.value = true;
|
||||||
}, { passive: true });
|
}, {passive: true});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const onContextmenu = (ev) => {
|
const onContextmenu = (ev) => {
|
||||||
const isLink = (el: HTMLElement) => {
|
const isLink = (el: HTMLElement) => {
|
||||||
if (el.tagName === 'A') return true;
|
if (el.tagName === 'A') return true;
|
||||||
if (el.parentElement) {
|
if (el.parentElement) {
|
||||||
return isLink(el.parentElement);
|
return isLink(el.parentElement);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (isLink(ev.target)) return;
|
if (isLink(ev.target)) return;
|
||||||
if (['INPUT', 'TEXTAREA', 'IMG', 'VIDEO', 'CANVAS'].includes(ev.target.tagName) || ev.target.attributes['contenteditable']) return;
|
if (['INPUT', 'TEXTAREA', 'IMG', 'VIDEO', 'CANVAS'].includes(ev.target.tagName) || ev.target.attributes['contenteditable']) return;
|
||||||
if (window.getSelection()?.toString() !== '') return;
|
if (window.getSelection()?.toString() !== '') return;
|
||||||
const path = mainRouter.getCurrentPath();
|
const path = mainRouter.getCurrentPath();
|
||||||
os.contextMenu([{
|
os.contextMenu([{
|
||||||
type: 'label',
|
type: 'label',
|
||||||
text: path,
|
text: path,
|
||||||
}, {
|
}, {
|
||||||
icon: 'ti ti-window-maximize',
|
icon: 'ti ti-window-maximize',
|
||||||
text: i18n.ts.openInWindow,
|
text: i18n.ts.openInWindow,
|
||||||
action: () => {
|
action: () => {
|
||||||
os.pageWindow(path);
|
os.pageWindow(path);
|
||||||
},
|
},
|
||||||
}], ev);
|
}], ev);
|
||||||
};
|
};
|
||||||
|
|
||||||
function top() {
|
function top() {
|
||||||
contents.value.rootEl.scrollTo({
|
contents.value.rootEl.scrollTo({
|
||||||
top: 0,
|
top: 0,
|
||||||
behavior: 'smooth',
|
behavior: 'smooth',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let navFooterHeight = $ref(0);
|
let navFooterHeight = $ref(0);
|
||||||
provide<Ref<number>>(CURRENT_STICKY_BOTTOM, $$(navFooterHeight));
|
provide<Ref<number>>(CURRENT_STICKY_BOTTOM, $$(navFooterHeight));
|
||||||
|
|
||||||
watch($$(navFooter), () => {
|
watch($$(navFooter), () => {
|
||||||
if (navFooter) {
|
if (navFooter) {
|
||||||
navFooterHeight = navFooter.offsetHeight;
|
navFooterHeight = navFooter.offsetHeight;
|
||||||
document.body.style.setProperty('--stickyBottom', `${navFooterHeight}px`);
|
document.body.style.setProperty('--stickyBottom', `${navFooterHeight}px`);
|
||||||
document.body.style.setProperty('--minBottomSpacing', 'var(--minBottomSpacingMobile)');
|
document.body.style.setProperty('--minBottomSpacing', 'var(--minBottomSpacingMobile)');
|
||||||
} else {
|
} else {
|
||||||
navFooterHeight = 0;
|
navFooterHeight = 0;
|
||||||
document.body.style.setProperty('--stickyBottom', '0px');
|
document.body.style.setProperty('--stickyBottom', '0px');
|
||||||
document.body.style.setProperty('--minBottomSpacing', '0px');
|
document.body.style.setProperty('--minBottomSpacing', '0px');
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
useScrollPositionManager(() => contents.value.rootEl, mainRouter);
|
useScrollPositionManager(() => contents.value.rootEl, mainRouter);
|
||||||
|
@ -248,22 +260,22 @@ useScrollPositionManager(() => contents.value.rootEl, mainRouter);
|
||||||
<style>
|
<style>
|
||||||
html,
|
html,
|
||||||
body {
|
body {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: clip;
|
overflow: clip;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
overscroll-behavior: none;
|
overscroll-behavior: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#misskey_app {
|
#misskey_app {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: clip;
|
overflow: clip;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@ -273,218 +285,222 @@ $widgets-hide-threshold: 1090px;
|
||||||
|
|
||||||
.transition_menuDrawerBg_enterActive,
|
.transition_menuDrawerBg_enterActive,
|
||||||
.transition_menuDrawerBg_leaveActive {
|
.transition_menuDrawerBg_leaveActive {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transition: opacity 300ms cubic-bezier(0.23, 1, 0.32, 1);
|
transition: opacity 300ms cubic-bezier(0.23, 1, 0.32, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.transition_menuDrawerBg_enterFrom,
|
.transition_menuDrawerBg_enterFrom,
|
||||||
.transition_menuDrawerBg_leaveTo {
|
.transition_menuDrawerBg_leaveTo {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.transition_menuDrawer_enterActive,
|
.transition_menuDrawer_enterActive,
|
||||||
.transition_menuDrawer_leaveActive {
|
.transition_menuDrawer_leaveActive {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1), opacity 300ms cubic-bezier(0.23, 1, 0.32, 1);
|
transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1), opacity 300ms cubic-bezier(0.23, 1, 0.32, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.transition_menuDrawer_enterFrom,
|
.transition_menuDrawer_enterFrom,
|
||||||
.transition_menuDrawer_leaveTo {
|
.transition_menuDrawer_leaveTo {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateX(-240px);
|
transform: translateX(-240px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.transition_widgetsDrawerBg_enterActive,
|
.transition_widgetsDrawerBg_enterActive,
|
||||||
.transition_widgetsDrawerBg_leaveActive {
|
.transition_widgetsDrawerBg_leaveActive {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transition: opacity 300ms cubic-bezier(0.23, 1, 0.32, 1);
|
transition: opacity 300ms cubic-bezier(0.23, 1, 0.32, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.transition_widgetsDrawerBg_enterFrom,
|
.transition_widgetsDrawerBg_enterFrom,
|
||||||
.transition_widgetsDrawerBg_leaveTo {
|
.transition_widgetsDrawerBg_leaveTo {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.transition_widgetsDrawer_enterActive,
|
.transition_widgetsDrawer_enterActive,
|
||||||
.transition_widgetsDrawer_leaveActive {
|
.transition_widgetsDrawer_leaveActive {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1), opacity 300ms cubic-bezier(0.23, 1, 0.32, 1);
|
transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1), opacity 300ms cubic-bezier(0.23, 1, 0.32, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.transition_widgetsDrawer_enterFrom,
|
.transition_widgetsDrawer_enterFrom,
|
||||||
.transition_widgetsDrawer_leaveTo {
|
.transition_widgetsDrawer_leaveTo {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateX(240px);
|
transform: translateX(240px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.root {
|
.root {
|
||||||
height: 100dvh;
|
height: 100dvh;
|
||||||
overflow: clip;
|
overflow: clip;
|
||||||
contain: strict;
|
contain: strict;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar {
|
.sidebar {
|
||||||
border-right: solid 0.5px var(--divider);
|
border-right: solid 0.5px var(--divider);
|
||||||
}
|
}
|
||||||
|
|
||||||
.contents {
|
.contents {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
overscroll-behavior: contain;
|
overscroll-behavior: contain;
|
||||||
background: var(--bg);
|
background: var(--bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.widgets {
|
.widgets {
|
||||||
width: 350px;
|
width: 350px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: var(--margin) var(--margin) calc(var(--margin) + env(safe-area-inset-bottom, 0px));
|
padding: var(--margin) var(--margin) calc(var(--margin) + env(safe-area-inset-bottom, 0px));
|
||||||
border-left: solid 0.5px var(--divider);
|
border-left: solid 0.5px var(--divider);
|
||||||
background: var(--bg);
|
background: var(--bg);
|
||||||
|
|
||||||
@media (max-width: $widgets-hide-threshold) {
|
@media (max-width: $widgets-hide-threshold) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.widgetButton {
|
.widgetButton {
|
||||||
display: block;
|
display: block;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
bottom: 32px;
|
bottom: 32px;
|
||||||
right: 32px;
|
right: 32px;
|
||||||
width: 64px;
|
width: 64px;
|
||||||
height: 64px;
|
height: 64px;
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);
|
box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
background: var(--panel);
|
background: var(--panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
.widgetsDrawerBg {
|
.widgetsDrawerBg {
|
||||||
z-index: 1001;
|
z-index: 1001;
|
||||||
}
|
}
|
||||||
|
|
||||||
.widgetsDrawer {
|
.widgetsDrawer {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: 1001;
|
z-index: 1001;
|
||||||
width: 310px;
|
width: 310px;
|
||||||
height: 100dvh;
|
height: 100dvh;
|
||||||
padding: var(--margin) var(--margin) calc(var(--margin) + env(safe-area-inset-bottom, 0px)) !important;
|
padding: var(--margin) var(--margin) calc(var(--margin) + env(safe-area-inset-bottom, 0px)) !important;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
overscroll-behavior: contain;
|
overscroll-behavior: contain;
|
||||||
background: var(--bg);
|
background: var(--bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.widgetsCloseButton {
|
.widgetsCloseButton {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
display: block;
|
display: block;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 370px) {
|
@media (min-width: 370px) {
|
||||||
.widgetsCloseButton {
|
.widgetsCloseButton {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav {
|
.nav {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
padding: 12px 12px max(12px, env(safe-area-inset-bottom, 0px)) 12px;
|
padding: 12px 12px max(12px, env(safe-area-inset-bottom, 0px)) 12px;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
|
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
|
||||||
grid-gap: 8px;
|
grid-gap: 8px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
-webkit-backdrop-filter: var(--blur, blur(24px));
|
-webkit-backdrop-filter: var(--blur, blur(24px));
|
||||||
backdrop-filter: var(--blur, blur(24px));
|
backdrop-filter: var(--blur, blur(24px));
|
||||||
background-color: var(--header);
|
background-color: var(--header);
|
||||||
border-top: solid 0.5px var(--divider);
|
border-top: solid 0.5px var(--divider);
|
||||||
}
|
}
|
||||||
|
|
||||||
.navButton {
|
.navButton {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 60px;
|
max-width: 60px;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
background: var(--panel);
|
background: var(--panel);
|
||||||
color: var(--fg);
|
color: var(--fg);
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: var(--panelHighlight);
|
background: var(--panelHighlight);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
background: var(--X2);
|
background: var(--X2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.postButton {
|
.postButton {
|
||||||
composes: navButton;
|
composes: navButton;
|
||||||
background: linear-gradient(90deg, var(--buttonGradateA), var(--buttonGradateB));
|
background: linear-gradient(90deg, var(--buttonGradateA), var(--buttonGradateB));
|
||||||
color: var(--fgOnAccent);
|
color: var(--fgOnAccent);
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: linear-gradient(90deg, var(--X8), var(--X8));
|
background: linear-gradient(90deg, var(--X8), var(--X8));
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
background: linear-gradient(90deg, var(--X8), var(--X8));
|
background: linear-gradient(90deg, var(--X8), var(--X8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.navButtonIcon {
|
.navButtonIcon {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navButtonIndicator {
|
.navButtonIndicator {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
color: var(--indicator);
|
color: var(--indicator);
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
animation: blink 1s infinite;
|
animation: blink 1s infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menuDrawerBg {
|
.menuDrawerBg {
|
||||||
z-index: 1001;
|
z-index: 1001;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menuDrawer {
|
.menuDrawer {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: 1001;
|
z-index: 1001;
|
||||||
height: 100dvh;
|
height: 100dvh;
|
||||||
width: 240px;
|
width: 240px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
contain: strict;
|
contain: strict;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
overscroll-behavior: contain;
|
overscroll-behavior: contain;
|
||||||
background: var(--navBg);
|
background: var(--navBg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.statusbars {
|
.statusbars {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spacer {
|
.spacer {
|
||||||
height: calc(var(--minBottomSpacing));
|
height: calc(var(--minBottomSpacing));
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue