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