wip
This commit is contained in:
parent
bb3e2c123a
commit
d892819a9e
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="fdidabkb" :class="{ slim: narrow, thin }" :style="{ background: bg }">
|
<div class="fdidabkb" :class="{ slim: narrow, thin }" :style="{ background: bg }" @click="onClick">
|
||||||
<template v-if="info">
|
<template v-if="info">
|
||||||
<div class="titleContainer" @click="showTabsPopup">
|
<div class="titleContainer" @click="showTabsPopup">
|
||||||
<i v-if="info.icon" class="icon" :class="info.icon"></i>
|
<i v-if="info.icon" class="icon" :class="info.icon"></i>
|
||||||
@ -35,9 +35,10 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
|
import * as tinycolor from 'tinycolor2';
|
||||||
import { popupMenu } from '@client/os';
|
import { popupMenu } from '@client/os';
|
||||||
import { url } from '@client/config';
|
import { url } from '@client/config';
|
||||||
import * as tinycolor from 'tinycolor2';
|
import { scrollToTop } from '@client/scripts/scroll';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
@ -77,7 +78,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
const rawBg = this.info.bg || 'var(--bg)';
|
const rawBg = this.info?.bg || 'var(--bg)';
|
||||||
const bg = tinycolor(rawBg.startsWith('var(') ? getComputedStyle(document.documentElement).getPropertyValue(rawBg.slice(4, -1)) : rawBg);
|
const bg = tinycolor(rawBg.startsWith('var(') ? getComputedStyle(document.documentElement).getPropertyValue(rawBg.slice(4, -1)) : rawBg);
|
||||||
bg.setAlpha(0.85);
|
bg.setAlpha(0.85);
|
||||||
this.bg = bg.toRgbString();
|
this.bg = bg.toRgbString();
|
||||||
@ -136,6 +137,10 @@ export default defineComponent({
|
|||||||
|
|
||||||
preventDrag(ev) {
|
preventDrag(ev) {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
|
},
|
||||||
|
|
||||||
|
onClick(ev) {
|
||||||
|
scrollToTop(this.$el, { behavior: 'smooth' });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -146,7 +151,7 @@ export default defineComponent({
|
|||||||
--height: 60px;
|
--height: 60px;
|
||||||
display: flex;
|
display: flex;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: var(--stickyTop, 0);
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
-webkit-backdrop-filter: var(--blur, blur(15px));
|
-webkit-backdrop-filter: var(--blur, blur(15px));
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
<button class="_button" @click="$refs.modal.close()"><i class="fas fa-times"></i></button>
|
<button class="_button" @click="$refs.modal.close()"><i class="fas fa-times"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="body _flat_">
|
<div class="body _flat_">
|
||||||
<MkHeader v-if="!pageInfo?.hide" :info="pageInfo"/>
|
|
||||||
<keep-alive>
|
<keep-alive>
|
||||||
<component :is="component" v-bind="props" :ref="changePage"/>
|
<component :is="component" v-bind="props" :ref="changePage"/>
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
|
@ -9,14 +9,14 @@
|
|||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<template v-if="pageInfo">
|
<template v-if="pageInfo">
|
||||||
{{ pageInfo.title }}
|
<i v-if="pageInfo.icon" class="icon" :class="pageInfo.icon" style="margin-right: 0.5em;"></i>
|
||||||
|
<span>{{ pageInfo.title }}</span>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<template #headerLeft>
|
<template #headerLeft>
|
||||||
<button v-if="history.length > 0" class="_button" @click="back()"><i class="fas fa-arrow-left"></i></button>
|
<button v-if="history.length > 0" class="_button" @click="back()"><i class="fas fa-arrow-left"></i></button>
|
||||||
</template>
|
</template>
|
||||||
<div class="yrolvcoq _flat_">
|
<div class="yrolvcoq _flat_">
|
||||||
<MkHeader :info="pageInfo"/>
|
|
||||||
<component :is="component" v-bind="props" :ref="changePage"/>
|
<component :is="component" v-bind="props" :ref="changePage"/>
|
||||||
</div>
|
</div>
|
||||||
</XWindow>
|
</XWindow>
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<MkHeader :info="header"/>
|
||||||
<div class="_section">
|
<div class="_section">
|
||||||
<MkPagination :pagination="pagination" #default="{items}" class="ruryvtyk _content">
|
<MkPagination :pagination="pagination" #default="{items}" class="ruryvtyk _content">
|
||||||
<section class="_card announcement _gap" v-for="(announcement, i) in items" :key="announcement.id">
|
<section class="_card announcement _gap" v-for="(announcement, i) in items" :key="announcement.id">
|
||||||
@ -13,6 +15,7 @@
|
|||||||
</section>
|
</section>
|
||||||
</MkPagination>
|
</MkPagination>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -35,6 +38,11 @@ export default defineComponent({
|
|||||||
icon: 'fas fa-broadcast-tower',
|
icon: 'fas fa-broadcast-tower',
|
||||||
bg: 'var(--bg)',
|
bg: 'var(--bg)',
|
||||||
},
|
},
|
||||||
|
header: {
|
||||||
|
title: this.$ts.announcements,
|
||||||
|
icon: 'fas fa-broadcast-tower',
|
||||||
|
bg: 'var(--bg)',
|
||||||
|
},
|
||||||
pagination: {
|
pagination: {
|
||||||
endpoint: 'announcements',
|
endpoint: 'announcements',
|
||||||
limit: 10,
|
limit: 10,
|
||||||
|
@ -89,7 +89,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
top() {
|
top() {
|
||||||
scroll(this.$el, 0);
|
scroll(this.$el, { top: 0 });
|
||||||
},
|
},
|
||||||
|
|
||||||
async timetravel() {
|
async timetravel() {
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<MkHeader :info="header"/>
|
||||||
<div :class="$style.root">
|
<div :class="$style.root">
|
||||||
<XCategory v-if="tab === 'category'"/>
|
<XCategory v-if="tab === 'category'"/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -22,6 +25,11 @@ export default defineComponent({
|
|||||||
icon: 'fas fa-laugh',
|
icon: 'fas fa-laugh',
|
||||||
bg: 'var(--bg)',
|
bg: 'var(--bg)',
|
||||||
})),
|
})),
|
||||||
|
header: computed(() => ({
|
||||||
|
title: this.$ts.customEmojis,
|
||||||
|
icon: 'fas fa-laugh',
|
||||||
|
bg: 'var(--bg)',
|
||||||
|
})),
|
||||||
tab: 'category',
|
tab: 'category',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<MkHeader :info="header"/>
|
||||||
<div class="jmelgwjh">
|
<div class="jmelgwjh">
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<XNotes class="notes" :pagination="pagination" :detail="true" :prop="'note'" @before="before()" @after="after()"/>
|
<XNotes class="notes" :pagination="pagination" :detail="true" :prop="'note'" @before="before()" @after="after()"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -25,6 +28,11 @@ export default defineComponent({
|
|||||||
icon: 'fas fa-star',
|
icon: 'fas fa-star',
|
||||||
bg: 'var(--bg)',
|
bg: 'var(--bg)',
|
||||||
},
|
},
|
||||||
|
header: {
|
||||||
|
title: this.$ts.favorites,
|
||||||
|
icon: 'fas fa-star',
|
||||||
|
bg: 'var(--bg)',
|
||||||
|
},
|
||||||
pagination: {
|
pagination: {
|
||||||
endpoint: 'i/favorites',
|
endpoint: 'i/favorites',
|
||||||
limit: 10,
|
limit: 10,
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<MkHeader :info="header"/>
|
||||||
<div class="_section">
|
<div class="_section">
|
||||||
<XNotes class="_content" ref="notes" :pagination="pagination" @before="before" @after="after"/>
|
<XNotes class="_content" ref="notes" :pagination="pagination" @before="before" @after="after"/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -19,12 +22,18 @@ export default defineComponent({
|
|||||||
return {
|
return {
|
||||||
[symbols.PAGE_INFO]: {
|
[symbols.PAGE_INFO]: {
|
||||||
title: this.$ts.featured,
|
title: this.$ts.featured,
|
||||||
icon: 'fas fa-fire-alt'
|
icon: 'fas fa-fire-alt',
|
||||||
|
bg: 'var(--bg)',
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
title: this.$ts.featured,
|
||||||
|
icon: 'fas fa-fire-alt',
|
||||||
|
bg: 'var(--bg)',
|
||||||
},
|
},
|
||||||
pagination: {
|
pagination: {
|
||||||
endpoint: 'notes/featured',
|
endpoint: 'notes/featured',
|
||||||
limit: 10,
|
limit: 10,
|
||||||
offsetMode: true
|
offsetMode: true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<MkHeader :info="header"/>
|
||||||
<div class="taeiyria">
|
<div class="taeiyria">
|
||||||
<div class="query">
|
<div class="query">
|
||||||
<MkInput v-model="host" :debounce="true" class="">
|
<MkInput v-model="host" :debounce="true" class="">
|
||||||
@ -91,6 +93,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</MkPagination>
|
</MkPagination>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -119,6 +122,11 @@ export default defineComponent({
|
|||||||
icon: 'fas fa-globe',
|
icon: 'fas fa-globe',
|
||||||
bg: 'var(--bg)',
|
bg: 'var(--bg)',
|
||||||
},
|
},
|
||||||
|
header: {
|
||||||
|
title: this.$ts.federation,
|
||||||
|
icon: 'fas fa-globe',
|
||||||
|
bg: 'var(--bg)',
|
||||||
|
},
|
||||||
host: '',
|
host: '',
|
||||||
state: 'federating',
|
state: 'federating',
|
||||||
sort: '+pubSub',
|
sort: '+pubSub',
|
||||||
|
@ -127,7 +127,7 @@ export default defineComponent({
|
|||||||
pageProps.value = {};
|
pageProps.value = {};
|
||||||
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
scroll(el.value, 0);
|
scroll(el.value, { top: 0 });
|
||||||
});
|
});
|
||||||
}, { immediate: true });
|
}, { immediate: true });
|
||||||
|
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<MkHeader :info="header"/>
|
||||||
<div class="_section">
|
<div class="_section">
|
||||||
<XNotes class="_content" :pagination="pagination" @before="before()" @after="after()"/>
|
<XNotes class="_content" :pagination="pagination" @before="before()" @after="after()"/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -19,7 +22,13 @@ export default defineComponent({
|
|||||||
return {
|
return {
|
||||||
[symbols.PAGE_INFO]: {
|
[symbols.PAGE_INFO]: {
|
||||||
title: this.$ts.mentions,
|
title: this.$ts.mentions,
|
||||||
icon: 'fas fa-at'
|
icon: 'fas fa-at',
|
||||||
|
bg: 'var(--bg)',
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
title: this.$ts.mentions,
|
||||||
|
icon: 'fas fa-at',
|
||||||
|
bg: 'var(--bg)',
|
||||||
},
|
},
|
||||||
pagination: {
|
pagination: {
|
||||||
endpoint: 'notes/mentions',
|
endpoint: 'notes/mentions',
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<MkHeader :info="header"/>
|
||||||
<div>
|
<div>
|
||||||
<XNotes :pagination="pagination" @before="before()" @after="after()"/>
|
<XNotes :pagination="pagination" @before="before()" @after="after()"/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -19,7 +22,13 @@ export default defineComponent({
|
|||||||
return {
|
return {
|
||||||
[symbols.PAGE_INFO]: {
|
[symbols.PAGE_INFO]: {
|
||||||
title: this.$ts.directNotes,
|
title: this.$ts.directNotes,
|
||||||
icon: 'fas fa-envelope'
|
icon: 'fas fa-envelope',
|
||||||
|
bg: 'var(--bg)',
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
title: this.$ts.directNotes,
|
||||||
|
icon: 'fas fa-envelope',
|
||||||
|
bg: 'var(--bg)',
|
||||||
},
|
},
|
||||||
pagination: {
|
pagination: {
|
||||||
endpoint: 'notes/mentions',
|
endpoint: 'notes/mentions',
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<MkHeader :info="header"/>
|
||||||
|
|
||||||
<div class="yweeujhr _root" v-size="{ max: [400] }">
|
<div class="yweeujhr _root" v-size="{ max: [400] }">
|
||||||
<MkButton @click="start" primary class="start"><i class="fas fa-plus"></i> {{ $ts.startMessaging }}</MkButton>
|
<MkButton @click="start" primary class="start"><i class="fas fa-plus"></i> {{ $ts.startMessaging }}</MkButton>
|
||||||
|
|
||||||
@ -34,6 +37,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<MkLoading v-if="fetching"/>
|
<MkLoading v-if="fetching"/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -56,6 +60,11 @@ export default defineComponent({
|
|||||||
icon: 'fas fa-comments',
|
icon: 'fas fa-comments',
|
||||||
bg: 'var(--bg)',
|
bg: 'var(--bg)',
|
||||||
},
|
},
|
||||||
|
header: {
|
||||||
|
title: this.$ts.messaging,
|
||||||
|
icon: 'fas fa-comments',
|
||||||
|
bg: 'var(--bg)',
|
||||||
|
},
|
||||||
fetching: true,
|
fetching: true,
|
||||||
moreFetching: false,
|
moreFetching: false,
|
||||||
messages: [],
|
messages: [],
|
||||||
|
@ -284,7 +284,7 @@ const Component = defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
scrollToBottom() {
|
scrollToBottom() {
|
||||||
scroll(this.$el, this.$el.offsetHeight);
|
scroll(this.$el, { top: this.$el.offsetHeight });
|
||||||
},
|
},
|
||||||
|
|
||||||
onIndicatorClick() {
|
onIndicatorClick() {
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<MkHeader :info="header"/>
|
||||||
<div class="qkcjvfiv">
|
<div class="qkcjvfiv">
|
||||||
<MkButton @click="create" primary class="add"><i class="fas fa-plus"></i> {{ $ts.createList }}</MkButton>
|
<MkButton @click="create" primary class="add"><i class="fas fa-plus"></i> {{ $ts.createList }}</MkButton>
|
||||||
|
|
||||||
@ -9,6 +11,7 @@
|
|||||||
</MkA>
|
</MkA>
|
||||||
</MkPagination>
|
</MkPagination>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -31,6 +34,12 @@ export default defineComponent({
|
|||||||
[symbols.PAGE_INFO]: {
|
[symbols.PAGE_INFO]: {
|
||||||
title: this.$ts.manageLists,
|
title: this.$ts.manageLists,
|
||||||
icon: 'fas fa-list-ul',
|
icon: 'fas fa-list-ul',
|
||||||
|
bg: 'var(--bg)',
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
title: this.$ts.manageLists,
|
||||||
|
icon: 'fas fa-list-ul',
|
||||||
|
bg: 'var(--bg)',
|
||||||
action: {
|
action: {
|
||||||
icon: 'fas fa-plus',
|
icon: 'fas fa-plus',
|
||||||
handler: this.create
|
handler: this.create
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<MkHeader v-if="header" :info="header"/>
|
||||||
<div class="mk-list-page">
|
<div class="mk-list-page">
|
||||||
<transition name="zoom" mode="out-in">
|
<transition name="zoom" mode="out-in">
|
||||||
<div v-if="list" class="_section">
|
<div v-if="list" class="_section">
|
||||||
@ -30,6 +32,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -50,6 +53,10 @@ export default defineComponent({
|
|||||||
title: this.list.name,
|
title: this.list.name,
|
||||||
icon: 'fas fa-list-ul',
|
icon: 'fas fa-list-ul',
|
||||||
} : null),
|
} : null),
|
||||||
|
header: computed(() => this.list ? {
|
||||||
|
title: this.list.name,
|
||||||
|
icon: 'fas fa-list-ul',
|
||||||
|
} : null),
|
||||||
list: null,
|
list: null,
|
||||||
users: [],
|
users: [],
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<MkHeader :info="header"/>
|
||||||
|
|
||||||
|
<!-- TODO: MkHeaderに統合 -->
|
||||||
<MkTab v-model="tab" v-if="$i">
|
<MkTab v-model="tab" v-if="$i">
|
||||||
<option value="featured"><i class="fas fa-fire-alt"></i> {{ $ts._pages.featured }}</option>
|
<option value="featured"><i class="fas fa-fire-alt"></i> {{ $ts._pages.featured }}</option>
|
||||||
<option value="my"><i class="fas fa-edit"></i> {{ $ts._pages.my }}</option>
|
<option value="my"><i class="fas fa-edit"></i> {{ $ts._pages.my }}</option>
|
||||||
@ -46,11 +49,17 @@ export default defineComponent({
|
|||||||
[symbols.PAGE_INFO]: {
|
[symbols.PAGE_INFO]: {
|
||||||
title: this.$ts.pages,
|
title: this.$ts.pages,
|
||||||
icon: 'fas fa-sticky-note',
|
icon: 'fas fa-sticky-note',
|
||||||
|
bg: 'var(--bg)',
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
title: this.$ts.pages,
|
||||||
|
icon: 'fas fa-sticky-note',
|
||||||
|
bg: 'var(--bg)',
|
||||||
actions: [{
|
actions: [{
|
||||||
icon: 'fas fa-plus',
|
icon: 'fas fa-plus',
|
||||||
text: this.$ts.create,
|
text: this.$ts.create,
|
||||||
handler: this.create
|
handler: this.create,
|
||||||
}]
|
}],
|
||||||
},
|
},
|
||||||
tab: 'featured',
|
tab: 'featured',
|
||||||
featuredPagesPagination: {
|
featuredPagesPagination: {
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<MkHeader :info="header"/>
|
||||||
<div class="_section">
|
<div class="_section">
|
||||||
<div class="_content">
|
<div class="_content">
|
||||||
<XNotes ref="notes" :pagination="pagination" @before="before" @after="after"/>
|
<XNotes ref="notes" :pagination="pagination" @before="before" @after="after"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -21,7 +24,11 @@ export default defineComponent({
|
|||||||
return {
|
return {
|
||||||
[symbols.PAGE_INFO]: {
|
[symbols.PAGE_INFO]: {
|
||||||
title: computed(() => this.$t('searchWith', { q: this.$route.query.q })),
|
title: computed(() => this.$t('searchWith', { q: this.$route.query.q })),
|
||||||
icon: 'fas fa-search'
|
icon: 'fas fa-search',
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
title: computed(() => this.$t('searchWith', { q: this.$route.query.q })),
|
||||||
|
icon: 'fas fa-search',
|
||||||
},
|
},
|
||||||
pagination: {
|
pagination: {
|
||||||
endpoint: 'notes/search',
|
endpoint: 'notes/search',
|
||||||
|
@ -143,7 +143,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
scroll(el.value, 0);
|
scroll(el.value, { top: 0 });
|
||||||
});
|
});
|
||||||
}, { immediate: true });
|
}, { immediate: true });
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
top() {
|
top() {
|
||||||
scroll(this.$el, 0);
|
scroll(this.$el, { top: 0 });
|
||||||
},
|
},
|
||||||
|
|
||||||
async chooseList(ev) {
|
async chooseList(ev) {
|
||||||
|
@ -89,7 +89,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
top() {
|
top() {
|
||||||
scroll(this.$el, 0);
|
scroll(this.$el, { top: 0 });
|
||||||
},
|
},
|
||||||
|
|
||||||
settings() {
|
settings() {
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<MkHeader :info="header"/>
|
||||||
<transition name="fade" mode="out-in">
|
<transition name="fade" mode="out-in">
|
||||||
<div class="ftskorzw wide" v-if="user && narrow === false">
|
<div class="ftskorzw wide" v-if="user && narrow === false">
|
||||||
<MkRemoteCaution v-if="user.host != null" :href="user.url"/>
|
<MkRemoteCaution v-if="user.host != null" :href="user.url"/>
|
||||||
@ -187,6 +189,7 @@
|
|||||||
<MkError v-else-if="error" @retry="fetch()"/>
|
<MkError v-else-if="error" @retry="fetch()"/>
|
||||||
<MkLoading v-else/>
|
<MkLoading v-else/>
|
||||||
</transition>
|
</transition>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -242,6 +245,15 @@ export default defineComponent({
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
[symbols.PAGE_INFO]: computed(() => this.user ? {
|
[symbols.PAGE_INFO]: computed(() => this.user ? {
|
||||||
|
icon: 'fas fa-user',
|
||||||
|
title: this.user.name ? `${this.user.name} (@${this.user.username})` : `@${this.user.username}`,
|
||||||
|
path: `/@${this.user.username}`,
|
||||||
|
share: {
|
||||||
|
title: this.user.name,
|
||||||
|
},
|
||||||
|
bg: 'var(--bg)',
|
||||||
|
} : null),
|
||||||
|
header: computed(() => this.user ? {
|
||||||
title: this.user.name ? `${this.user.name} (@${this.user.username})` : `@${this.user.username}`,
|
title: this.user.name ? `${this.user.name} (@${this.user.username})` : `@${this.user.username}`,
|
||||||
subtitle: `@${getAcct(this.user)}`,
|
subtitle: `@${getAcct(this.user)}`,
|
||||||
userName: this.user,
|
userName: this.user,
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
type ScrollBehavior = 'auto' | 'smooth' | 'instant';
|
||||||
|
|
||||||
export function getScrollContainer(el: Element | null): Element | null {
|
export function getScrollContainer(el: Element | null): Element | null {
|
||||||
if (el == null || el.tagName === 'BODY') return null;
|
if (el == null || el.tagName === 'BODY') return null;
|
||||||
const overflow = window.getComputedStyle(el).getPropertyValue('overflow');
|
const overflow = window.getComputedStyle(el).getPropertyValue('overflow');
|
||||||
@ -45,21 +47,25 @@ export function onScrollBottom(el: Element, cb) {
|
|||||||
container.addEventListener('scroll', onScroll, { passive: true });
|
container.addEventListener('scroll', onScroll, { passive: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
export function scroll(el: Element, top: number) {
|
export function scroll(el: Element, options: {
|
||||||
|
top?: number;
|
||||||
|
left?: number;
|
||||||
|
behavior?: ScrollBehavior;
|
||||||
|
}) {
|
||||||
const container = getScrollContainer(el);
|
const container = getScrollContainer(el);
|
||||||
if (container == null) {
|
if (container == null) {
|
||||||
window.scroll({ top: top, behavior: 'instant' });
|
window.scroll(options);
|
||||||
} else {
|
} else {
|
||||||
container.scrollTop = top;
|
container.scroll(options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function scrollToTop(el: Element) {
|
export function scrollToTop(el: Element, options: { behavior?: ScrollBehavior; } = {}) {
|
||||||
scroll(el, 0);
|
scroll(el, { top: 0, ...options });
|
||||||
}
|
}
|
||||||
|
|
||||||
export function scrollToBottom(el: Element) {
|
export function scrollToBottom(el: Element, options: { behavior?: ScrollBehavior; } = {}) {
|
||||||
scroll(el, 99999); // TODO: ちゃんと計算する
|
scroll(el, { top: 99999, ...options }); // TODO: ちゃんと計算する
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isBottom(el: Element, asobi = 0) {
|
export function isBottom(el: Element, asobi = 0) {
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<MkHeader :info="pageInfo"/>
|
|
||||||
<router-view v-slot="{ Component }" class="_flat_">
|
<router-view v-slot="{ Component }" class="_flat_">
|
||||||
<transition>
|
<transition>
|
||||||
<keep-alive :include="['timeline']">
|
<keep-alive :include="['timeline']">
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="mk-app" :class="{ wallpaper, isMobile }" :style="`--headerHeight:` + headerHeight + 'px'">
|
<div class="mk-app" :class="{ wallpaper, isMobile }" :style="`--globalHeaderHeight:${globalHeaderHeight}px`">
|
||||||
<XHeaderMenu v-if="showMenuOnTop"/>
|
<XHeaderMenu v-if="showMenuOnTop" v-get-size="(w, h) => globalHeaderHeight = h"/>
|
||||||
|
|
||||||
<div class="columns" :class="{ fullView, withGlobalHeader: showMenuOnTop }">
|
<div class="columns" :class="{ fullView, withGlobalHeader: showMenuOnTop }">
|
||||||
<template v-if="!isMobile">
|
<template v-if="!isMobile">
|
||||||
@ -13,9 +13,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<main class="main" @contextmenu.stop="onContextmenu" :style="{ background: pageInfo?.bg }">
|
<main class="main" @contextmenu.stop="onContextmenu" :style="{ background: pageInfo?.bg }">
|
||||||
<header class="header" @click="onHeaderClick">
|
|
||||||
<MkHeader :info="pageInfo" v-get-size="(w, h) => headerHeight = h" :thin="true"/>
|
|
||||||
</header>
|
|
||||||
<div class="content" :class="{ _flat_: !fullView }">
|
<div class="content" :class="{ _flat_: !fullView }">
|
||||||
<router-view v-slot="{ Component }">
|
<router-view v-slot="{ Component }">
|
||||||
<transition :name="$store.state.animation ? 'page' : ''" mode="out-in" @enter="onTransition">
|
<transition :name="$store.state.animation ? 'page' : ''" mode="out-in" @enter="onTransition">
|
||||||
@ -86,8 +83,8 @@ export default defineComponent({
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pageInfo: null,
|
pageInfo: null,
|
||||||
headerHeight: 0,
|
|
||||||
menuDef: menuDef,
|
menuDef: menuDef,
|
||||||
|
globalHeaderHeight: 0,
|
||||||
isMobile: window.innerWidth <= MOBILE_THRESHOLD,
|
isMobile: window.innerWidth <= MOBILE_THRESHOLD,
|
||||||
isDesktop: window.innerWidth >= DESKTOP_THRESHOLD,
|
isDesktop: window.innerWidth >= DESKTOP_THRESHOLD,
|
||||||
widgetsShowing: false,
|
widgetsShowing: false,
|
||||||
@ -192,10 +189,6 @@ export default defineComponent({
|
|||||||
if (window._scroll) window._scroll();
|
if (window._scroll) window._scroll();
|
||||||
},
|
},
|
||||||
|
|
||||||
onHeaderClick() {
|
|
||||||
window.scroll({ top: 0, behavior: 'smooth' });
|
|
||||||
},
|
|
||||||
|
|
||||||
onContextmenu(e) {
|
onContextmenu(e) {
|
||||||
const isLink = (el: HTMLElement) => {
|
const isLink = (el: HTMLElement) => {
|
||||||
if (el.tagName === 'A') return true;
|
if (el.tagName === 'A') return true;
|
||||||
@ -280,10 +273,6 @@ export default defineComponent({
|
|||||||
border: none;
|
border: none;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
|
|
||||||
> .header {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -323,29 +312,6 @@ export default defineComponent({
|
|||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
overflow: clip;
|
overflow: clip;
|
||||||
--margin: 12px;
|
--margin: 12px;
|
||||||
|
|
||||||
> .header {
|
|
||||||
position: sticky;
|
|
||||||
z-index: 1000;
|
|
||||||
top: var(--globalHeaderHeight, 0px);
|
|
||||||
-webkit-backdrop-filter: var(--blur, blur(32px));
|
|
||||||
backdrop-filter: var(--blur, blur(32px));
|
|
||||||
background-color: var(--header);
|
|
||||||
border-bottom: solid 0.5px var(--divider);
|
|
||||||
}
|
|
||||||
|
|
||||||
> .content {
|
|
||||||
--stickyTop: calc(var(--globalHeaderHeight, 0px) + var(--headerHeight));
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 850px) {
|
|
||||||
padding-top: var(--headerHeight);
|
|
||||||
|
|
||||||
> .header {
|
|
||||||
position: fixed;
|
|
||||||
width: calc(100% - #{$nav-icon-only-width});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
> .widgets {
|
> .widgets {
|
||||||
@ -367,12 +333,11 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.withGlobalHeader {
|
&.withGlobalHeader {
|
||||||
--globalHeaderHeight: 60px; // TODO: 60pxと決め打ちしているのを直す
|
|
||||||
|
|
||||||
> .main {
|
> .main {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
border: solid 1px var(--divider);
|
border: solid 1px var(--divider);
|
||||||
border-radius: var(--radius);
|
border-radius: var(--radius);
|
||||||
|
--stickyTop: var(--globalHeaderHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
> .widgets {
|
> .widgets {
|
||||||
|
@ -252,18 +252,6 @@ export default defineComponent({
|
|||||||
min-width: 0;
|
min-width: 0;
|
||||||
background: var(--panel);
|
background: var(--panel);
|
||||||
|
|
||||||
> .header {
|
|
||||||
position: fixed;
|
|
||||||
z-index: 1000;
|
|
||||||
top: 0;
|
|
||||||
//background-color: var(--panel);
|
|
||||||
-webkit-backdrop-filter: var(--blur, blur(32px));
|
|
||||||
backdrop-filter: var(--blur, blur(32px));
|
|
||||||
background-color: var(--header);
|
|
||||||
border-bottom: solid 0.5px var(--divider);
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
> main {
|
> main {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user