2018-02-15 08:50:19 +00:00
|
|
|
<template>
|
2018-02-23 17:46:09 +00:00
|
|
|
<mk-ui>
|
2018-04-26 05:01:41 +00:00
|
|
|
<span slot="header" @click="showNav = true">
|
|
|
|
<span>
|
2018-05-25 11:44:06 +00:00
|
|
|
<span v-if="src == 'home'">%fa:home%%i18n:@home%</span>
|
|
|
|
<span v-if="src == 'local'">%fa:R comments%%i18n:@local%</span>
|
|
|
|
<span v-if="src == 'global'">%fa:globe%%i18n:@global%</span>
|
2018-04-26 05:38:37 +00:00
|
|
|
<span v-if="src.startsWith('list')">%fa:list%{{ list.title }}</span>
|
2018-04-26 05:01:41 +00:00
|
|
|
</span>
|
2018-02-23 17:46:09 +00:00
|
|
|
<span style="margin-left:8px">
|
2018-04-26 05:01:41 +00:00
|
|
|
<template v-if="!showNav">%fa:angle-down%</template>
|
2018-02-23 17:46:09 +00:00
|
|
|
<template v-else>%fa:angle-up%</template>
|
|
|
|
</span>
|
|
|
|
</span>
|
2018-04-26 05:01:41 +00:00
|
|
|
|
2018-02-23 17:46:09 +00:00
|
|
|
<template slot="func">
|
2018-04-26 05:01:41 +00:00
|
|
|
<button @click="fn">%fa:pencil-alt%</button>
|
2018-02-23 17:46:09 +00:00
|
|
|
</template>
|
2018-04-26 05:01:41 +00:00
|
|
|
|
2018-05-23 20:28:46 +00:00
|
|
|
<main :data-darkmode="$store.state.device.darkmode">
|
2018-04-26 05:01:41 +00:00
|
|
|
<div class="nav" v-if="showNav">
|
|
|
|
<div class="bg" @click="showNav = false"></div>
|
|
|
|
<div class="body">
|
2018-04-26 05:38:37 +00:00
|
|
|
<div>
|
2018-05-25 11:44:06 +00:00
|
|
|
<span :data-active="src == 'home'" @click="src = 'home'">%fa:home% %i18n:@home%</span>
|
|
|
|
<span :data-active="src == 'local'" @click="src = 'local'">%fa:R comments% %i18n:@local%</span>
|
|
|
|
<span :data-active="src == 'global'" @click="src = 'global'">%fa:globe% %i18n:@global%</span>
|
2018-04-26 05:38:37 +00:00
|
|
|
<template v-if="lists">
|
|
|
|
<span v-for="l in lists" :data-active="src == 'list:' + l.id" @click="src = 'list:' + l.id; list = l" :key="l.id">%fa:list% {{ l.title }}</span>
|
|
|
|
</template>
|
|
|
|
</div>
|
2018-04-26 05:01:41 +00:00
|
|
|
</div>
|
2018-02-23 17:46:09 +00:00
|
|
|
</div>
|
2018-04-26 05:01:41 +00:00
|
|
|
|
|
|
|
<div class="tl">
|
|
|
|
<x-tl v-if="src == 'home'" ref="tl" key="home" src="home" @loaded="onLoaded"/>
|
|
|
|
<x-tl v-if="src == 'local'" ref="tl" key="local" src="local"/>
|
|
|
|
<x-tl v-if="src == 'global'" ref="tl" key="global" src="global"/>
|
2018-04-26 09:24:14 +00:00
|
|
|
<mk-user-list-timeline v-if="src.startsWith('list:')" ref="tl" :key="list.id" :list="list"/>
|
2018-02-23 17:46:09 +00:00
|
|
|
</div>
|
|
|
|
</main>
|
2018-02-15 08:50:19 +00:00
|
|
|
</mk-ui>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
import Progress from '../../../common/scripts/loading';
|
2018-04-26 05:01:41 +00:00
|
|
|
import XTl from './home.timeline.vue';
|
2018-02-15 08:50:19 +00:00
|
|
|
|
|
|
|
export default Vue.extend({
|
2018-02-23 17:46:09 +00:00
|
|
|
components: {
|
2018-04-26 05:01:41 +00:00
|
|
|
XTl
|
2018-02-23 17:46:09 +00:00
|
|
|
},
|
2018-04-26 05:01:41 +00:00
|
|
|
|
2018-02-15 08:50:19 +00:00
|
|
|
data() {
|
|
|
|
return {
|
2018-04-26 05:01:41 +00:00
|
|
|
src: 'home',
|
|
|
|
list: null,
|
2018-04-26 05:38:37 +00:00
|
|
|
lists: null,
|
2018-04-26 05:01:41 +00:00
|
|
|
showNav: false
|
2018-02-15 08:50:19 +00:00
|
|
|
};
|
|
|
|
},
|
2018-02-23 18:03:26 +00:00
|
|
|
|
2018-04-26 05:38:37 +00:00
|
|
|
watch: {
|
|
|
|
src() {
|
|
|
|
this.showNav = false;
|
|
|
|
},
|
|
|
|
|
|
|
|
showNav(v) {
|
|
|
|
if (v && this.lists === null) {
|
|
|
|
(this as any).api('users/lists/list').then(lists => {
|
|
|
|
this.lists = lists;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-05-06 05:35:28 +00:00
|
|
|
created() {
|
|
|
|
if ((this as any).os.i.followingCount == 0) {
|
|
|
|
this.src = 'local';
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-02-15 08:50:19 +00:00
|
|
|
mounted() {
|
|
|
|
document.title = 'Misskey';
|
|
|
|
|
|
|
|
Progress.start();
|
|
|
|
},
|
2018-04-26 05:01:41 +00:00
|
|
|
|
2018-02-15 08:50:19 +00:00
|
|
|
methods: {
|
|
|
|
fn() {
|
2018-02-21 18:11:24 +00:00
|
|
|
(this as any).apis.post();
|
2018-02-15 08:50:19 +00:00
|
|
|
},
|
2018-04-26 05:01:41 +00:00
|
|
|
|
2018-02-23 17:46:09 +00:00
|
|
|
onLoaded() {
|
2018-02-15 08:50:19 +00:00
|
|
|
Progress.done();
|
|
|
|
},
|
2018-02-23 17:46:09 +00:00
|
|
|
|
|
|
|
warp() {
|
|
|
|
|
2018-02-15 08:50:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
2018-02-23 17:46:09 +00:00
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
2018-04-26 05:38:37 +00:00
|
|
|
@import '~const.styl'
|
|
|
|
|
2018-04-28 01:59:37 +00:00
|
|
|
root(isDark)
|
2018-04-26 05:01:41 +00:00
|
|
|
> .nav
|
|
|
|
> .bg
|
|
|
|
position fixed
|
|
|
|
z-index 10000
|
|
|
|
top 0
|
|
|
|
left 0
|
|
|
|
width 100%
|
|
|
|
height 100%
|
|
|
|
background rgba(#000, 0.5)
|
|
|
|
|
|
|
|
> .body
|
|
|
|
position fixed
|
|
|
|
z-index 10001
|
2018-04-26 05:38:37 +00:00
|
|
|
top 56px
|
2018-04-26 05:01:41 +00:00
|
|
|
left 0
|
2018-04-26 05:38:37 +00:00
|
|
|
right 0
|
|
|
|
width 300px
|
|
|
|
margin 0 auto
|
2018-04-28 01:59:37 +00:00
|
|
|
background isDark ? #272f3a : #fff
|
2018-04-26 05:01:41 +00:00
|
|
|
border-radius 8px
|
2018-04-28 23:51:17 +00:00
|
|
|
box-shadow 0 0 16px rgba(#000, 0.1)
|
2018-04-26 05:38:37 +00:00
|
|
|
|
|
|
|
$balloon-size = 16px
|
|
|
|
|
|
|
|
&:after
|
|
|
|
content ""
|
|
|
|
display block
|
|
|
|
position absolute
|
|
|
|
top -($balloon-size * 2) + 1.5px
|
|
|
|
left s('calc(50% - %s)', $balloon-size)
|
|
|
|
border-top solid $balloon-size transparent
|
|
|
|
border-left solid $balloon-size transparent
|
|
|
|
border-right solid $balloon-size transparent
|
2018-04-28 01:59:37 +00:00
|
|
|
border-bottom solid $balloon-size isDark ? #272f3a : #fff
|
2018-04-26 05:38:37 +00:00
|
|
|
|
|
|
|
> div
|
|
|
|
padding 8px 0
|
|
|
|
|
|
|
|
> *
|
|
|
|
display block
|
|
|
|
padding 8px 16px
|
2018-04-28 01:59:37 +00:00
|
|
|
color isDark ? #cdd0d8 : #666
|
2018-04-26 05:38:37 +00:00
|
|
|
|
|
|
|
&[data-active]
|
|
|
|
color $theme-color-foreground
|
|
|
|
background $theme-color
|
|
|
|
|
|
|
|
&:not([data-active]):hover
|
2018-04-28 01:59:37 +00:00
|
|
|
background isDark ? #353e4a : #eee
|
2018-02-23 17:46:09 +00:00
|
|
|
|
|
|
|
> .tl
|
2018-04-27 12:06:28 +00:00
|
|
|
max-width 680px
|
2018-02-23 17:46:09 +00:00
|
|
|
margin 0 auto
|
2018-04-26 05:01:41 +00:00
|
|
|
padding 8px
|
2018-02-23 17:46:09 +00:00
|
|
|
|
2018-02-23 18:30:13 +00:00
|
|
|
@media (min-width 500px)
|
2018-04-26 05:01:41 +00:00
|
|
|
padding 16px
|
2018-02-23 17:46:09 +00:00
|
|
|
|
2018-04-27 12:06:28 +00:00
|
|
|
@media (min-width 600px)
|
|
|
|
padding 32px
|
|
|
|
|
2018-04-28 01:59:37 +00:00
|
|
|
main[data-darkmode]
|
|
|
|
root(true)
|
|
|
|
|
|
|
|
main:not([data-darkmode])
|
|
|
|
root(false)
|
|
|
|
|
2018-02-23 17:46:09 +00:00
|
|
|
</style>
|