mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-26 22:23:07 +02:00
fix(frontend): Zen UIで、デッキ設定で直接/以外を表示したときデッキに戻るボタンを表示 (#10909)
* fix(frontend): デッキ設定で直接/以外を表示したときのZen UIでデッキに戻るボタン * fix style * ?zenが指定されていた場合はボタンを表示しない
This commit is contained in:
parent
fb54c58a66
commit
a80003cde5
1 changed files with 42 additions and 2 deletions
|
@ -1,9 +1,17 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="$style.root" style="container-type: inline-size;">
|
<div :class="showBottom ? $style.rootWithBottom : $style.root" style="container-type: inline-size;">
|
||||||
<RouterView/>
|
<RouterView/>
|
||||||
|
|
||||||
<XCommon/>
|
<XCommon/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
デッキ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>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
@ -11,10 +19,13 @@ import { provide, ComputedRef } from 'vue';
|
||||||
import XCommon from './_common_/common.vue';
|
import XCommon from './_common_/common.vue';
|
||||||
import { mainRouter } from '@/router';
|
import { mainRouter } from '@/router';
|
||||||
import { PageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata';
|
import { PageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata';
|
||||||
import { instanceName } from '@/config';
|
import { instanceName, ui } from '@/config';
|
||||||
|
import { i18n } from '@/i18n';
|
||||||
|
|
||||||
let pageMetadata = $ref<null | ComputedRef<PageMetadata>>();
|
let pageMetadata = $ref<null | ComputedRef<PageMetadata>>();
|
||||||
|
|
||||||
|
const showBottom = !(new URLSearchParams(location.search)).has('zen') && ui === 'deck';
|
||||||
|
|
||||||
provide('router', mainRouter);
|
provide('router', mainRouter);
|
||||||
provideMetadataReceiver((info) => {
|
provideMetadataReceiver((info) => {
|
||||||
pageMetadata = info;
|
pageMetadata = info;
|
||||||
|
@ -23,6 +34,10 @@ provideMetadataReceiver((info) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function goToMisskey() {
|
||||||
|
window.location.href = '/';
|
||||||
|
}
|
||||||
|
|
||||||
document.documentElement.style.overflowY = 'scroll';
|
document.documentElement.style.overflowY = 'scroll';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -31,4 +46,29 @@ document.documentElement.style.overflowY = 'scroll';
|
||||||
min-height: 100dvh;
|
min-height: 100dvh;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.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));
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in a new issue