2023-07-27 08:31:52 +03:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-10-17 14:12:00 +03:00
|
|
|
<template>
|
2023-07-07 14:18:06 +03:00
|
|
|
<div :class="showBottom ? $style.rootWithBottom : $style.root">
|
|
|
|
<div style="container-type: inline-size;">
|
|
|
|
<RouterView/>
|
|
|
|
</div>
|
2020-10-17 14:12:00 +03:00
|
|
|
|
2020-10-24 19:21:41 +03:00
|
|
|
<XCommon/>
|
2020-10-17 14:12:00 +03:00
|
|
|
</div>
|
2023-05-28 14:58:39 +03: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 14:12:00 +03:00
|
|
|
</template>
|
|
|
|
|
2022-06-20 11:38:49 +03:00
|
|
|
<script lang="ts" setup>
|
2023-12-07 07:42:09 +02:00
|
|
|
import { provide, ComputedRef, ref } from 'vue';
|
2020-10-24 19:21:41 +03:00
|
|
|
import XCommon from './_common_/common.vue';
|
2023-09-19 10:37:43 +03:00
|
|
|
import { PageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata.js';
|
|
|
|
import { instanceName, ui } from '@/config.js';
|
|
|
|
import { i18n } from '@/i18n.js';
|
2024-01-08 07:44:43 +02:00
|
|
|
import { mainRouter } from '@/global/router/main.js';
|
2020-10-17 14:12:00 +03:00
|
|
|
|
2023-12-07 07:42:09 +02:00
|
|
|
const pageMetadata = ref<null | ComputedRef<PageMetadata>>();
|
2020-10-17 14:12:00 +03:00
|
|
|
|
2023-05-28 14:58:39 +03:00
|
|
|
const showBottom = !(new URLSearchParams(location.search)).has('zen') && ui === 'deck';
|
|
|
|
|
2022-06-20 11:38:49 +03:00
|
|
|
provide('router', mainRouter);
|
|
|
|
provideMetadataReceiver((info) => {
|
2023-12-07 07:42:09 +02:00
|
|
|
pageMetadata.value = info;
|
|
|
|
if (pageMetadata.value.value) {
|
|
|
|
document.title = `${pageMetadata.value.value.title} | ${instanceName}`;
|
2020-10-17 14:12:00 +03:00
|
|
|
}
|
|
|
|
});
|
2022-06-20 11:38:49 +03:00
|
|
|
|
2023-05-28 14:58:39 +03:00
|
|
|
function goToMisskey() {
|
|
|
|
window.location.href = '/';
|
|
|
|
}
|
|
|
|
|
2022-06-20 11:38:49 +03:00
|
|
|
document.documentElement.style.overflowY = 'scroll';
|
2020-10-17 14:12:00 +03:00
|
|
|
</script>
|
|
|
|
|
2023-05-19 10:30:39 +03:00
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
2022-11-13 04:43:23 +02:00
|
|
|
min-height: 100dvh;
|
2020-10-17 14:12:00 +03:00
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
2023-05-28 14:58:39 +03: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 14:12:00 +03:00
|
|
|
</style>
|