2023-07-27 07:31:52 +02:00
|
|
|
<!--
|
2024-02-13 16:59:27 +01:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
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">
|
2024-06-21 14:28:16 +02:00
|
|
|
<button v-tooltip="i18n.ts.goToMisskey" :class="['_button', '_shadow', $style.button]" @click="goToMisskey"><i class="ti ti-home"></i></button>
|
2023-05-28 13:58:39 +02:00
|
|
|
</div>
|
2020-10-17 13:12:00 +02:00
|
|
|
</template>
|
|
|
|
|
2022-06-20 10:38:49 +02:00
|
|
|
<script lang="ts" setup>
|
2024-02-16 08:17:09 +01:00
|
|
|
import { computed, provide, ref } from 'vue';
|
2020-10-24 18:21:41 +02:00
|
|
|
import XCommon from './_common_/common.vue';
|
2024-02-16 08:17:09 +01:00
|
|
|
import { PageMetadata, provideMetadataReceiver, provideReactiveMetadata } from '@/scripts/page-metadata.js';
|
2023-09-19 09:37:43 +02:00
|
|
|
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
|
|
|
|
2024-02-16 08:17:09 +01:00
|
|
|
const isRoot = computed(() => mainRouter.currentRoute.value.name === 'index');
|
|
|
|
|
|
|
|
const pageMetadata = ref<null | PageMetadata>(null);
|
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);
|
2024-02-16 08:17:09 +01:00
|
|
|
provideMetadataReceiver((metadataGetter) => {
|
|
|
|
const info = metadataGetter();
|
2023-12-07 06:42:09 +01:00
|
|
|
pageMetadata.value = info;
|
2024-02-16 08:17:09 +01: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 13:12:00 +02:00
|
|
|
}
|
|
|
|
});
|
2024-02-16 08:17:09 +01:00
|
|
|
provideReactiveMetadata(pageMetadata);
|
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;
|
2023-10-31 19:44:34 +01:00
|
|
|
border-radius: var(--radius-full);
|
2023-05-28 13:58:39 +02:00
|
|
|
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>
|