2023-07-27 05:31:52 +00:00
|
|
|
<!--
|
2024-02-13 15:59:27 +00:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 05:31:52 +00:00
|
|
|
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>
|
2024-02-16 07:17:09 +00:00
|
|
|
import { computed, provide, ref } from 'vue';
|
2020-10-24 16:21:41 +00:00
|
|
|
import XCommon from './_common_/common.vue';
|
2024-02-16 07:17:09 +00:00
|
|
|
import { PageMetadata, provideMetadataReceiver, provideReactiveMetadata } from '@/scripts/page-metadata.js';
|
2023-09-19 07:37:43 +00:00
|
|
|
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
|
|
|
|
2024-02-16 07:17:09 +00:00
|
|
|
const isRoot = computed(() => mainRouter.currentRoute.value.name === 'index');
|
|
|
|
|
|
|
|
const pageMetadata = ref<null | PageMetadata>(null);
|
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);
|
2024-02-16 07:17:09 +00:00
|
|
|
provideMetadataReceiver((metadataGetter) => {
|
|
|
|
const info = metadataGetter();
|
2023-12-07 05:42:09 +00:00
|
|
|
pageMetadata.value = info;
|
2024-02-16 07:17:09 +00:00
|
|
|
if (pageMetadata.value) {
|
|
|
|
if (isRoot.value && pageMetadata.value.title === instanceName) {
|
|
|
|
document.title = pageMetadata.value.title;
|
|
|
|
} else {
|
|
|
|
document.title = `${pageMetadata.value.title} | ${instanceName}`;
|
|
|
|
}
|
2020-10-17 11:12:00 +00:00
|
|
|
}
|
|
|
|
});
|
2024-02-16 07:17:09 +00:00
|
|
|
provideReactiveMetadata(pageMetadata);
|
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>
|