This commit is contained in:
syuilo 2019-02-15 15:35:52 +09:00
parent f8b3f66904
commit 937f7cbd60
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
28 changed files with 103 additions and 94 deletions

View file

@ -1,10 +1,10 @@
<template>
<div class="mkw-analog-clock">
<mk-widget-container :naked="props.style % 2 === 0" :show-header="false">
<ui-container :naked="props.style % 2 === 0" :show-header="false">
<div class="mkw-analog-clock--body">
<mk-analog-clock :dark="$store.state.device.darkmode" :smooth="props.style < 2"/>
</div>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -1,6 +1,6 @@
<template>
<div class="anltbovirfeutcigvwgmgxipejaeozxi">
<mk-widget-container :show-header="false" :naked="props.design == 1">
<ui-container :show-header="false" :naked="props.design == 1">
<div class="anltbovirfeutcigvwgmgxipejaeozxi-body"
:data-found="announcements && announcements.length != 0"
:data-melt="props.design == 1"
@ -23,7 +23,7 @@
</p>
<a v-if="announcements.length > 1" @click="next">{{ $t('next') }} &gt;&gt;</a>
</div>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -1,6 +1,6 @@
<template>
<div class="mkw-calendar" :data-special="special" :data-mobile="platform == 'mobile'">
<mk-widget-container :naked="props.design == 1" :show-header="false">
<ui-container :naked="props.design == 1" :show-header="false">
<div class="mkw-calendar--body">
<div class="calendar" :data-is-holiday="isHoliday">
<p class="month-and-year">
@ -31,7 +31,7 @@
</div>
</div>
</div>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -1,12 +1,12 @@
<template>
<div class="mkw-hashtags">
<mk-widget-container :show-header="!props.compact">
<ui-container :show-header="!props.compact">
<template slot="header"><fa icon="hashtag"/>{{ $t('title') }}</template>
<div class="mkw-hashtags--body" :data-mobile="platform == 'mobile'">
<mk-trends/>
</div>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -1,8 +1,8 @@
<template>
<div class="mkw-instance">
<mk-widget-container>
<ui-container>
<mk-instance/>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -1,13 +1,13 @@
<template>
<div class="mkw-memo">
<mk-widget-container :show-header="!props.compact">
<ui-container :show-header="!props.compact">
<template slot="header"><fa :icon="['far', 'sticky-note']"/>{{ $t('title') }}</template>
<div class="mkw-memo--body">
<textarea v-model="text" :placeholder="$t('placeholder')" @input="onChange"></textarea>
<button @click="saveMemo" :disabled="!changed">{{ $t('save') }}</button>
</div>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -1,10 +1,10 @@
<template>
<div class="mkw-nav">
<mk-widget-container>
<ui-container>
<div class="mkw-nav--body">
<mk-nav/>
</div>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -1,6 +1,6 @@
<template>
<div class="mkw-photo-stream" :class="$style.root" :data-melt="props.design == 2">
<mk-widget-container :show-header="props.design == 0" :naked="props.design == 2">
<ui-container :show-header="props.design == 0" :naked="props.design == 2">
<template slot="header"><fa icon="camera"/>{{ $t('title') }}</template>
<p :class="$style.fetching" v-if="fetching"><fa icon="spinner" pulse fixed-width/>{{ $t('@.loading') }}<mk-ellipsis/></p>
@ -13,7 +13,7 @@
></div>
</div>
<p :class="$style.empty" v-if="!fetching && images.length == 0">{{ $t('no-photos') }}</p>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -1,6 +1,6 @@
<template>
<div class="mkw-posts-monitor">
<mk-widget-container :show-header="props.design == 0" :naked="props.design == 2">
<ui-container :show-header="props.design == 0" :naked="props.design == 2">
<template slot="header"><fa icon="chart-line"/>{{ $t('title') }}</template>
<button slot="func" @click="toggle" :title="$t('toggle')"><fa icon="sort"/></button>
@ -64,7 +64,7 @@
<text x="1" y="5">Fedi</text>
</svg>
</div>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -1,6 +1,6 @@
<template>
<div class="mkw-rss">
<mk-widget-container :show-header="!props.compact">
<ui-container :show-header="!props.compact">
<template slot="header"><fa icon="rss-square"/>RSS</template>
<button slot="func" title="設定" @click="setting"><fa icon="cog"/></button>
@ -10,7 +10,7 @@
<a v-for="item in items" :href="item.link" target="_blank">{{ item.title }}</a>
</div>
</div>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -1,6 +1,6 @@
<template>
<div class="mkw-server">
<mk-widget-container :show-header="props.design == 0" :naked="props.design == 2">
<ui-container :show-header="props.design == 0" :naked="props.design == 2">
<template slot="header"><fa icon="server"/>{{ $t('title') }}</template>
<button slot="func" @click="toggle" :title="$t('toggle')"><fa icon="sort"/></button>
@ -13,7 +13,7 @@
<x-uptimes v-show="props.view == 4" :connection="connection"/>
<x-info v-show="props.view == 5" :connection="connection" :meta="meta"/>
</template>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -158,7 +158,10 @@ init(async (launch, os) => {
{ path: '/authorize-follow', component: MkFollow },
{ path: '/deck', redirect: '/' },
{ path: '*', component: MkNotFound }
]
],
scrollBehavior(to, from, savedPosition) {
return { x: 0, y: 0 };
}
});
// Launch the app

View file

@ -1,6 +1,6 @@
<template>
<div class="mk-activity">
<mk-widget-container :show-header="design == 0" :naked="design == 2">
<ui-container :show-header="design == 0" :naked="design == 2">
<template slot="header"><fa icon="chart-bar"/>{{ $t('title') }}</template>
<button slot="func" :title="$t('toggle')" @click="toggle"><fa icon="sort"/></button>
@ -9,7 +9,7 @@
<x-calendar v-show="view == 0" :data="[].concat(activity)"/>
<x-chart v-show="view == 1" :data="[].concat(activity)"/>
</template>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -18,7 +18,7 @@ import activity from './activity.vue';
import friendsMaker from './friends-maker.vue';
import userCard from './user-card.vue';
import userListTimeline from './user-list-timeline.vue';
import widgetContainer from './widget-container.vue';
import uiContainer from './ui-container.vue';
Vue.component('mk-ui', ui);
Vue.component('mk-ui-notification', uiNotification);
@ -38,4 +38,4 @@ Vue.component('mk-activity', activity);
Vue.component('mk-friends-maker', friendsMaker);
Vue.component('mk-user-card', userCard);
Vue.component('mk-user-list-timeline', userListTimeline);
Vue.component('mk-widget-container', widgetContainer);
Vue.component('ui-container', uiContainer);

View file

@ -1,10 +1,16 @@
<template>
<div class="mk-widget-container" :class="{ naked }">
<div class="kedshtep" :class="{ naked }">
<header v-if="showHeader">
<div class="title"><slot name="header"></slot></div>
<slot name="func"></slot>
<button v-if="bodyTogglable" @click="() => showBody = !showBody">
<template v-if="showBody"><fa icon="angle-up"/></template>
<template v-else><fa icon="angle-down"/></template>
</button>
</header>
<div v-show="showBody">
<slot></slot>
</div>
</div>
</template>
@ -19,13 +25,22 @@ export default Vue.extend({
naked: {
type: Boolean,
default: false
}
},
bodyTogglable: {
type: Boolean,
default: false
},
},
data() {
return {
showBody: true
};
}
});
</script>
<style lang="stylus" scoped>
.mk-widget-container
.kedshtep
background var(--face)
box-shadow var(--shadow)
border-radius var(--round)

View file

@ -1,20 +1,27 @@
<template>
<div class="dzsuvbsrrrwobdxifudxuefculdfiaxd">
<p class="title"><fa icon="camera"/>{{ $t('title') }}</p>
<ui-container :body-togglable="true">
<span slot="header"><fa icon="camera"/> {{ $t('title') }}</span>
<div class="dzsuvbsrrrwobdxifudxuefculdfiaxd">
<p class="initializing" v-if="fetching"><fa icon="spinner" pulse fixed-width/>{{ $t('loading') }}<mk-ellipsis/></p>
<div class="stream" v-if="!fetching && images.length > 0">
<div v-for="(image, i) in images" :key="i" class="img"
:style="`background-image: url(${thumbnail(image)})`"
></div>
<router-link v-for="image in images" class="img"
:style="`background-image: url(${image.thumbnailUrl})`"
:key="`${image.id}:${image._note.id}`"
:to="image._note | notePage"
:title="`${image.name}\n${(new Date(image.createdAt)).toLocaleString()}`"
></router-link>
</div>
<p class="empty" v-if="!fetching && images.length == 0">{{ $t('no-photos') }}</p>
</div>
</div>
</ui-container>
</template>
<script lang="ts">
import Vue from 'vue';
import i18n from '../../../../i18n';
import { getStaticImageUrl } from '../../../../common/scripts/get-static-image-url';
import { concat } from '../../../../../../prelude/array';
export default Vue.extend({
i18n: i18n('desktop/views/pages/user/user.photos.vue'),
@ -41,9 +48,11 @@ export default Vue.extend({
}).then(notes => {
for (const note of notes) {
for (const file of note.files) {
if (this.images.length < 9) this.images.push(file);
file._note = note;
}
}
const files = concat(notes.map((n: any): any[] => n.files));
this.images = files.filter(f => image.includes(f.type)).slice(0, 9);
this.fetching = false;
});
},
@ -59,39 +68,19 @@ export default Vue.extend({
<style lang="stylus" scoped>
.dzsuvbsrrrwobdxifudxuefculdfiaxd
background var(--face)
box-shadow var(--shadow)
border-radius var(--round)
overflow hidden
> .title
z-index 1
margin 0
padding 0 16px
line-height 42px
font-size 0.9em
font-weight bold
background var(--faceHeader)
color var(--faceHeaderText)
box-shadow 0 1px rgba(#000, 0.07)
> i
margin-right 4px
> .stream
display flex
justify-content center
flex-wrap wrap
padding 8px
display grid
grid-template-columns 1fr 1fr 1fr
gap 8px
padding 16px
background var(--face)
> .img
flex 1 1 33%
width 33%
> *
height 120px
background-position center center
background-size cover
background-clip content-box
border solid 2px transparent
border-radius 4px
> .initializing
> .empty

View file

@ -4,14 +4,14 @@
<div class="is-remote" v-if="user.host != null"><fa icon="exclamation-triangle"/> {{ $t('@.is-remote-user') }}<a :href="user.url || user.uri" target="_blank">{{ $t('@.view-on-remote') }}</a></div>
<div class="main">
<x-header :user="user"/>
<x-integrations :user="user"/>
<x-integrations :user="user" v-if="user.twitter || user.github || user.discord"/>
<mk-note-detail v-for="n in user.pinnedNotes" :key="n.id" :note="n" :compact="true"/>
<!--<mk-calendar @chosen="warp" :start="new Date(user.createdAt)"/>-->
<div class="activity">
<mk-widget-container :show-header="true" :naked="false">
<ui-container :body-togglable="true">
<template slot="header"><fa icon="chart-bar"/>{{ $t('activity') }}</template>
<x-activity :user="user" :limit="35" style="padding: 16px;"/>
</mk-widget-container>
</ui-container>
</div>
<x-photos :user="user"/>
<x-friends :user="user"/>

View file

@ -1,11 +1,11 @@
<template>
<div class="mkw-messaging">
<mk-widget-container :show-header="props.design == 0">
<ui-container :show-header="props.design == 0">
<template slot="header"><fa icon="comments"/>{{ $t('title') }}</template>
<button slot="func" @click="add"><fa icon="plus"/></button>
<x-messaging ref="index" compact @navigate="navigate"/>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -1,11 +1,11 @@
<template>
<div class="mkw-notifications">
<mk-widget-container :show-header="!props.compact">
<ui-container :show-header="!props.compact">
<template slot="header"><fa :icon="['far', 'bell']"/>{{ $t('title') }}</template>
<!-- <button slot="func" :title="$t('title')" @click="settings"><fa icon="cog"/></button> -->
<mk-notifications :class="$style.notifications"/>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -1,6 +1,6 @@
<template>
<div class="mkw-polls">
<mk-widget-container :show-header="!props.compact">
<ui-container :show-header="!props.compact">
<template slot="header"><fa icon="chart-pie"/>{{ $t('title') }}</template>
<button slot="func" :title="$t('title')" @click="fetch">
<fa v-if="!fetching && more" icon="arrow-right"/>
@ -16,7 +16,7 @@
<p class="empty" v-if="!fetching && poll == null">{{ $t('nothing') }}</p>
<p class="fetching" v-if="fetching"><fa icon="spinner" pulse fixed-width/>{{ $t('@.loading') }}<mk-ellipsis/></p>
</div>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -1,6 +1,6 @@
<template>
<div>
<mk-widget-container :show-header="props.design == 0">
<ui-container :show-header="props.design == 0">
<template slot="header"><fa icon="pencil-alt"/>{{ $t('title') }}</template>
<div class="lhcuptdmcdkfwmipgazeawoiuxpzaclc-body"
@ -37,7 +37,7 @@
<button @click="post" :disabled="posting" class="post">{{ $t('note') }}</button>
</footer>
</div>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -1,6 +1,6 @@
<template>
<div class="egwyvoaaryotefqhqtmiyawwefemjfsd">
<mk-widget-container :show-header="false" :naked="props.design == 2">
<ui-container :show-header="false" :naked="props.design == 2">
<div class="egwyvoaaryotefqhqtmiyawwefemjfsd-body"
:data-compact="props.design == 1 || props.design == 2"
:data-melt="props.design == 2"
@ -18,7 +18,7 @@
<router-link class="name" :to="$store.state.i | userPage"><mk-user-name :user="$store.state.i"/></router-link>
<p class="username">@{{ $store.state.i | acct }}</p>
</div>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -1,6 +1,6 @@
<template>
<div class="mkw-trends">
<mk-widget-container :show-header="!props.compact">
<ui-container :show-header="!props.compact">
<template slot="header"><fa icon="fire"/>{{ $t('title') }}</template>
<button slot="func" :title="$t('title')" @click="fetch"><fa icon="sync"/></button>
@ -12,7 +12,7 @@
</div>
<p class="empty" v-else>{{ $t('nothing') }}</p>
</div>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -1,6 +1,6 @@
<template>
<div class="mkw-users">
<mk-widget-container :show-header="!props.compact">
<ui-container :show-header="!props.compact">
<template slot="header"><fa icon="users"/>{{ $t('title') }}</template>
<button slot="func" :title="$t('title')" @click="refresh">
<fa v-if="!fetching && more" icon="arrow-right"/>
@ -20,7 +20,7 @@
</template>
<p class="empty" v-else>{{ $t('no-one') }}</p>
</div>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -17,7 +17,7 @@ import usersList from './users-list.vue';
import userPreview from './user-preview.vue';
import userTimeline from './user-timeline.vue';
import userListTimeline from './user-list-timeline.vue';
import widgetContainer from './widget-container.vue';
import uiContainer from './ui-container.vue';
import postForm from './post-form.vue';
Vue.component('mk-ui', ui);
@ -37,5 +37,5 @@ Vue.component('mk-users-list', usersList);
Vue.component('mk-user-preview', userPreview);
Vue.component('mk-user-timeline', userTimeline);
Vue.component('mk-user-list-timeline', userListTimeline);
Vue.component('mk-widget-container', widgetContainer);
Vue.component('ui-container', uiContainer);
Vue.component('mk-post-form', postForm);

View file

@ -1,10 +1,12 @@
<template>
<div class="mk-widget-container" :class="{ naked, hideHeader: !showHeader }">
<div class="ukygtjoj" :class="{ naked, hideHeader: !showHeader }">
<header v-if="showHeader">
<div class="title"><slot name="header"></slot></div>
<slot name="func"></slot>
</header>
<div v-show="showBody">
<slot></slot>
</div>
</div>
</template>
@ -25,7 +27,7 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.mk-widget-container
.ukygtjoj
background var(--face)
border-radius 8px
box-shadow 0 4px 16px rgba(#000, 0.1)

View file

@ -1,11 +1,11 @@
<template>
<div class="mkw-activity">
<mk-widget-container :show-header="!props.compact">
<ui-container :show-header="!props.compact">
<template slot="header"><fa icon="chart-bar"/>{{ $t('activity') }}</template>
<div :class="$style.body">
<x-activity :user="$store.state.i"/>
</div>
</mk-widget-container>
</ui-container>
</div>
</template>

View file

@ -1,6 +1,6 @@
<template>
<div class="mkw-profile">
<mk-widget-container>
<ui-container>
<div :class="$style.banner"
:style="$store.state.i.bannerUrl ? `background-image: url(${$store.state.i.bannerUrl})` : ''"
></div>
@ -11,7 +11,7 @@
<router-link :class="$style.name" :to="$store.state.i | userPage">
<mk-user-name :user="$store.state.i"/>
</router-link>
</mk-widget-container>
</ui-container>
</div>
</template>