feat(frontend): ページのタブバーを下部に表示できるように
This commit is contained in:
parent
2f13f923a8
commit
bb56b3b4f1
|
@ -25,6 +25,7 @@
|
||||||
- `g` キーを連打する
|
- `g` キーを連打する
|
||||||
- URLに`?safemode=true`を付ける
|
- URLに`?safemode=true`を付ける
|
||||||
- PWAのショートカットで Safemode を選択して起動する
|
- PWAのショートカットで Safemode を選択して起動する
|
||||||
|
- Feat: ページのタブバーを下部に表示できるように
|
||||||
- Enhance: コントロールパネルを検索できるように
|
- Enhance: コントロールパネルを検索できるように
|
||||||
- Enhance: トルコ語 (tr-TR) に対応
|
- Enhance: トルコ語 (tr-TR) に対応
|
||||||
- Fix: 一部の設定検索結果が存在しないパスになる問題を修正
|
- Fix: 一部の設定検索結果が存在しないパスになる問題を修正
|
||||||
|
|
|
@ -5871,6 +5871,10 @@ export interface Locale extends ILocale {
|
||||||
* 利用できるリアクションを先頭に表示
|
* 利用できるリアクションを先頭に表示
|
||||||
*/
|
*/
|
||||||
"showAvailableReactionsFirstInNote": string;
|
"showAvailableReactionsFirstInNote": string;
|
||||||
|
/**
|
||||||
|
* ページのタブバーを下部に表示
|
||||||
|
*/
|
||||||
|
"showPageTabBarBottom": string;
|
||||||
"_chat": {
|
"_chat": {
|
||||||
/**
|
/**
|
||||||
* 送信者の名前を表示
|
* 送信者の名前を表示
|
||||||
|
|
|
@ -1469,6 +1469,7 @@ _settings:
|
||||||
contentsUpdateFrequency_description2: "リアルタイムモードがオンのときは、この設定に関わらずリアルタイムでコンテンツが更新されます。"
|
contentsUpdateFrequency_description2: "リアルタイムモードがオンのときは、この設定に関わらずリアルタイムでコンテンツが更新されます。"
|
||||||
showUrlPreview: "URLプレビューを表示する"
|
showUrlPreview: "URLプレビューを表示する"
|
||||||
showAvailableReactionsFirstInNote: "利用できるリアクションを先頭に表示"
|
showAvailableReactionsFirstInNote: "利用できるリアクションを先頭に表示"
|
||||||
|
showPageTabBarBottom: "ページのタブバーを下部に表示"
|
||||||
|
|
||||||
_chat:
|
_chat:
|
||||||
showSenderName: "送信者の名前を表示"
|
showSenderName: "送信者の名前を表示"
|
||||||
|
|
|
@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div :class="$style.tabs">
|
<div :class="[$style.tabs, { [$style.centered]: props.centered }]">
|
||||||
<div :class="$style.tabsInner">
|
<div :class="$style.tabsInner">
|
||||||
<button
|
<button
|
||||||
v-for="t in tabs" :ref="(el) => tabRefs[t.key] = (el as HTMLElement)" v-tooltip.noDelay="t.title"
|
v-for="t in tabs" :ref="(el) => tabRefs[t.key] = (el as HTMLElement)" v-tooltip.noDelay="t.title"
|
||||||
|
@ -30,7 +30,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
ref="tabHighlightEl"
|
ref="tabHighlightEl"
|
||||||
:class="[$style.tabHighlight, { [$style.animate]: prefer.s.animation }]"
|
:class="[$style.tabHighlight, { [$style.animate]: prefer.s.animation, [$style.tabHighlightUpper]: tabHighlightUpper }]"
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -59,6 +59,8 @@ import { prefer } from '@/preferences.js';
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
tabs?: Tab[];
|
tabs?: Tab[];
|
||||||
tab?: string;
|
tab?: string;
|
||||||
|
centered?: boolean;
|
||||||
|
tabHighlightUpper?: boolean;
|
||||||
}>(), {
|
}>(), {
|
||||||
tabs: () => ([] as Tab[]),
|
tabs: () => ([] as Tab[]),
|
||||||
});
|
});
|
||||||
|
@ -169,6 +171,16 @@ onUnmounted(() => {
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
|
|
||||||
|
&.centered {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@container (max-width: 450px) {
|
||||||
|
.tabs {
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabsInner {
|
.tabsInner {
|
||||||
|
@ -227,5 +239,10 @@ onUnmounted(() => {
|
||||||
&.animate {
|
&.animate {
|
||||||
transition: width 0.15s ease, left 0.15s ease;
|
transition: width 0.15s ease, left 0.15s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.tabHighlightUpper {
|
||||||
|
top: 0;
|
||||||
|
bottom: auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -6,14 +6,22 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<template>
|
<template>
|
||||||
<div ref="rootEl" :class="[$style.root, reversed ? '_pageScrollableReversed' : '_pageScrollable']">
|
<div ref="rootEl" :class="[$style.root, reversed ? '_pageScrollableReversed' : '_pageScrollable']">
|
||||||
<MkStickyContainer>
|
<MkStickyContainer>
|
||||||
<template #header><MkPageHeader v-model:tab="tab" v-bind="pageHeaderProps"/></template>
|
<template #header>
|
||||||
|
<MkPageHeader v-if="prefer.s.showPageTabBarBottom && (props.tabs?.length ?? 0) > 0" v-bind="pageHeaderPropsWithoutTabs"/>
|
||||||
|
<MkPageHeader v-else v-model:tab="tab" v-bind="pageHeaderProps"/>
|
||||||
|
</template>
|
||||||
<div :class="$style.body">
|
<div :class="$style.body">
|
||||||
<MkSwiper v-if="prefer.s.enableHorizontalSwipe && swipable && (props.tabs?.length ?? 1) > 1" v-model:tab="tab" :class="$style.swiper" :tabs="props.tabs">
|
<MkSwiper v-if="prefer.s.enableHorizontalSwipe && swipable && (props.tabs?.length ?? 1) > 1" v-model:tab="tab" :class="$style.swiper" :tabs="props.tabs">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</MkSwiper>
|
</MkSwiper>
|
||||||
<slot v-else></slot>
|
<slot v-else></slot>
|
||||||
</div>
|
</div>
|
||||||
<template #footer><slot name="footer"></slot></template>
|
<template #footer>
|
||||||
|
<slot name="footer"></slot>
|
||||||
|
<div v-if="prefer.s.showPageTabBarBottom && (props.tabs?.length ?? 0) > 0" :class="$style.footerTabs">
|
||||||
|
<MkTabs v-model:tab="tab" :tabs="props.tabs" :centered="true" :tabHighlightUpper="true"/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</MkStickyContainer>
|
</MkStickyContainer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -26,6 +34,7 @@ import { useScrollPositionKeeper } from '@/composables/use-scroll-position-keepe
|
||||||
import MkSwiper from '@/components/MkSwiper.vue';
|
import MkSwiper from '@/components/MkSwiper.vue';
|
||||||
import { useRouter } from '@/router.js';
|
import { useRouter } from '@/router.js';
|
||||||
import { prefer } from '@/preferences.js';
|
import { prefer } from '@/preferences.js';
|
||||||
|
import MkTabs from '@/components/MkTabs.vue';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<PageHeaderProps & {
|
const props = withDefaults(defineProps<PageHeaderProps & {
|
||||||
reversed?: boolean;
|
reversed?: boolean;
|
||||||
|
@ -40,6 +49,11 @@ const pageHeaderProps = computed(() => {
|
||||||
return rest;
|
return rest;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const pageHeaderPropsWithoutTabs = computed(() => {
|
||||||
|
const { reversed, tabs, ...rest } = props;
|
||||||
|
return rest;
|
||||||
|
});
|
||||||
|
|
||||||
const tab = defineModel<string>('tab');
|
const tab = defineModel<string>('tab');
|
||||||
const rootEl = useTemplateRef('rootEl');
|
const rootEl = useTemplateRef('rootEl');
|
||||||
|
|
||||||
|
@ -68,4 +82,11 @@ defineExpose({
|
||||||
.body, .swiper {
|
.body, .swiper {
|
||||||
min-height: calc(100cqh - (var(--MI-stickyTop, 0px) + var(--MI-stickyBottom, 0px)));
|
min-height: calc(100cqh - (var(--MI-stickyTop, 0px) + var(--MI-stickyBottom, 0px)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.footerTabs {
|
||||||
|
background: color(from var(--MI_THEME-pageHeaderBg) srgb r g b / 0.75);
|
||||||
|
-webkit-backdrop-filter: var(--MI-blur, blur(15px));
|
||||||
|
backdrop-filter: var(--MI-blur, blur(15px));
|
||||||
|
border-top: solid 0.5px var(--MI_THEME-divider);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -477,6 +477,14 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</MkPreferenceContainer>
|
</MkPreferenceContainer>
|
||||||
</SearchMarker>
|
</SearchMarker>
|
||||||
|
|
||||||
|
<SearchMarker :keywords="['tabs', 'tabbar', 'bottom', 'under']">
|
||||||
|
<MkPreferenceContainer k="showPageTabBarBottom">
|
||||||
|
<MkSwitch v-model="showPageTabBarBottom">
|
||||||
|
<template #label><SearchLabel>{{ i18n.ts._settings.showPageTabBarBottom }}</SearchLabel></template>
|
||||||
|
</MkSwitch>
|
||||||
|
</MkPreferenceContainer>
|
||||||
|
</SearchMarker>
|
||||||
|
|
||||||
<SearchMarker :keywords="['swipe', 'horizontal', 'tab']">
|
<SearchMarker :keywords="['swipe', 'horizontal', 'tab']">
|
||||||
<MkPreferenceContainer k="enableHorizontalSwipe">
|
<MkPreferenceContainer k="enableHorizontalSwipe">
|
||||||
<MkSwitch v-model="enableHorizontalSwipe">
|
<MkSwitch v-model="enableHorizontalSwipe">
|
||||||
|
@ -866,6 +874,7 @@ const animatedMfm = prefer.model('animatedMfm');
|
||||||
const disableShowingAnimatedImages = prefer.model('disableShowingAnimatedImages');
|
const disableShowingAnimatedImages = prefer.model('disableShowingAnimatedImages');
|
||||||
const keepScreenOn = prefer.model('keepScreenOn');
|
const keepScreenOn = prefer.model('keepScreenOn');
|
||||||
const enableHorizontalSwipe = prefer.model('enableHorizontalSwipe');
|
const enableHorizontalSwipe = prefer.model('enableHorizontalSwipe');
|
||||||
|
const showPageTabBarBottom = prefer.model('showPageTabBarBottom');
|
||||||
const enablePullToRefresh = prefer.model('enablePullToRefresh');
|
const enablePullToRefresh = prefer.model('enablePullToRefresh');
|
||||||
const useNativeUiForVideoAudioPlayer = prefer.model('useNativeUiForVideoAudioPlayer');
|
const useNativeUiForVideoAudioPlayer = prefer.model('useNativeUiForVideoAudioPlayer');
|
||||||
const contextMenu = prefer.model('contextMenu');
|
const contextMenu = prefer.model('contextMenu');
|
||||||
|
@ -925,6 +934,7 @@ watch([
|
||||||
useSystemFont,
|
useSystemFont,
|
||||||
makeEveryTextElementsSelectable,
|
makeEveryTextElementsSelectable,
|
||||||
enableHorizontalSwipe,
|
enableHorizontalSwipe,
|
||||||
|
showPageTabBarBottom,
|
||||||
enablePullToRefresh,
|
enablePullToRefresh,
|
||||||
reduceAnimation,
|
reduceAnimation,
|
||||||
showAvailableReactionsFirstInNote,
|
showAvailableReactionsFirstInNote,
|
||||||
|
|
|
@ -381,6 +381,9 @@ export const PREF_DEF = definePreferences({
|
||||||
showAvailableReactionsFirstInNote: {
|
showAvailableReactionsFirstInNote: {
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
showPageTabBarBottom: {
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
plugins: {
|
plugins: {
|
||||||
default: [] as Plugin[],
|
default: [] as Plugin[],
|
||||||
mergeStrategy: (a, b) => {
|
mergeStrategy: (a, b) => {
|
||||||
|
|
|
@ -86,7 +86,7 @@ watch(rootEl, () => {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background: var(--MI_THEME-navBg);
|
background: var(--MI_THEME-navBg);
|
||||||
color: var(--MI_THEME-navFg);
|
color: var(--MI_THEME-navFg);
|
||||||
box-shadow: 0px 0px 6px 6px #0000000f;
|
border-top: solid 0.5px var(--MI_THEME-divider);
|
||||||
}
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
|
|
Loading…
Reference in New Issue