2023-07-27 05:31:52 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-10-17 11:12:00 +00:00
|
|
|
<template>
|
2023-07-07 11:18:06 +00:00
|
|
|
<div :class="showBottom ? $style.rootWithBottom : $style.root">
|
|
|
|
<div style="container-type: inline-size;">
|
|
|
|
<RouterView/>
|
|
|
|
</div>
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2020-10-24 16:21:41 +00:00
|
|
|
<XCommon/>
|
2020-10-17 11:12:00 +00:00
|
|
|
</div>
|
2023-05-28 11:58:39 +00:00
|
|
|
|
|
|
|
<!--
|
|
|
|
デッキUIが設定されている場合はデッキUIに戻れるようにする (ただし?zenが明示された場合は表示しない)
|
|
|
|
See https://github.com/misskey-dev/misskey/issues/10905
|
|
|
|
-->
|
|
|
|
<div v-if="showBottom" :class="$style.bottom">
|
|
|
|
<button v-tooltip="i18n.ts.goToMisskey" :class="['_button', '_shadow', $style.button]" @click="goToMisskey"><i class="ti ti-home"></i></button>
|
|
|
|
</div>
|
2020-10-17 11:12:00 +00:00
|
|
|
</template>
|
|
|
|
|
2022-06-20 08:38:49 +00:00
|
|
|
<script lang="ts" setup>
|
2023-12-07 05:42:09 +00:00
|
|
|
import { provide, ComputedRef, ref } from 'vue';
|
2020-10-24 16:21:41 +00:00
|
|
|
import XCommon from './_common_/common.vue';
|
2023-09-19 07:37:43 +00:00
|
|
|
import { PageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata.js';
|
|
|
|
import { instanceName, ui } from '@/config.js';
|
|
|
|
import { i18n } from '@/i18n.js';
|
2024-01-30 12:07:34 +00:00
|
|
|
import { mainRouter } from '@/router/main.js';
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2023-12-07 05:42:09 +00:00
|
|
|
const pageMetadata = ref<null | ComputedRef<PageMetadata>>();
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2023-05-28 11:58:39 +00:00
|
|
|
const showBottom = !(new URLSearchParams(location.search)).has('zen') && ui === 'deck';
|
|
|
|
|
2022-06-20 08:38:49 +00:00
|
|
|
provide('router', mainRouter);
|
|
|
|
provideMetadataReceiver((info) => {
|
2023-12-07 05:42:09 +00:00
|
|
|
pageMetadata.value = info;
|
|
|
|
if (pageMetadata.value.value) {
|
|
|
|
document.title = `${pageMetadata.value.value.title} | ${instanceName}`;
|
2020-10-17 11:12:00 +00:00
|
|
|
}
|
|
|
|
});
|
2022-06-20 08:38:49 +00:00
|
|
|
|
2023-05-28 11:58:39 +00:00
|
|
|
function goToMisskey() {
|
|
|
|
window.location.href = '/';
|
|
|
|
}
|
|
|
|
|
2022-06-20 08:38:49 +00:00
|
|
|
document.documentElement.style.overflowY = 'scroll';
|
2020-10-17 11:12:00 +00:00
|
|
|
</script>
|
|
|
|
|
2023-05-19 07:30:39 +00:00
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
2022-11-13 02:43:23 +00:00
|
|
|
min-height: 100dvh;
|
2020-10-17 11:12:00 +00:00
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
2023-05-28 11:58:39 +00:00
|
|
|
|
|
|
|
.rootWithBottom {
|
|
|
|
min-height: calc(100dvh - (60px + (var(--margin) * 2) + env(safe-area-inset-bottom, 0px)));
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
|
|
|
|
|
|
|
.bottom {
|
|
|
|
height: calc(60px + (var(--margin) * 2) + env(safe-area-inset-bottom, 0px));
|
|
|
|
width: 100%;
|
|
|
|
margin-top: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.button {
|
|
|
|
position: fixed !important;
|
|
|
|
padding: 0;
|
|
|
|
aspect-ratio: 1;
|
|
|
|
width: 100%;
|
|
|
|
max-width: 60px;
|
|
|
|
margin: auto;
|
|
|
|
border-radius: 100%;
|
|
|
|
background: var(--panel);
|
|
|
|
color: var(--fg);
|
|
|
|
right: var(--margin);
|
|
|
|
bottom: calc(var(--margin) + env(safe-area-inset-bottom, 0px));
|
|
|
|
}
|
2020-10-17 11:12:00 +00:00
|
|
|
</style>
|