2018-03-16 13:33:36 -05:00
|
|
|
<template>
|
|
|
|
<div class="mk-welcome-timeline">
|
2018-04-07 12:30:37 -05:00
|
|
|
<div v-for="note in notes">
|
2018-04-29 03:17:15 -05:00
|
|
|
<mk-avatar class="avatar" :user="note.user" target="_blank"/>
|
2018-03-16 13:33:36 -05:00
|
|
|
<div class="body">
|
|
|
|
<header>
|
2018-04-09 04:52:29 -05:00
|
|
|
<router-link class="name" :to="note.user | userPage" v-user-preview="note.user.id">{{ note.user | userName }}</router-link>
|
|
|
|
<span class="username">@{{ note.user | acct }}</span>
|
2018-03-16 13:33:36 -05:00
|
|
|
<div class="info">
|
2018-04-09 05:18:15 -05:00
|
|
|
<router-link class="created-at" :to="note | notePage">
|
2018-04-07 12:30:37 -05:00
|
|
|
<mk-time :time="note.createdAt"/>
|
2018-03-16 13:33:36 -05:00
|
|
|
</router-link>
|
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
<div class="text">
|
2018-05-28 01:04:47 -05:00
|
|
|
<mk-note-html v-if="note.text" :text="note.text"/>
|
2018-03-16 13:33:36 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
fetching: true,
|
2018-04-07 12:30:37 -05:00
|
|
|
notes: []
|
2018-03-16 13:33:36 -05:00
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.fetch();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
fetch(cb?) {
|
|
|
|
this.fetching = true;
|
2018-04-07 12:30:37 -05:00
|
|
|
(this as any).api('notes', {
|
2018-05-23 01:25:15 -05:00
|
|
|
local: true,
|
2018-03-16 13:33:36 -05:00
|
|
|
reply: false,
|
2018-04-07 12:30:37 -05:00
|
|
|
renote: false,
|
2018-03-16 13:33:36 -05:00
|
|
|
media: false,
|
|
|
|
poll: false,
|
|
|
|
bot: false
|
2018-04-07 12:30:37 -05:00
|
|
|
}).then(notes => {
|
|
|
|
this.notes = notes;
|
2018-03-16 13:33:36 -05:00
|
|
|
this.fetching = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
2018-05-23 01:58:53 -05:00
|
|
|
root(isDark)
|
|
|
|
background isDark ? #282C37 : #fff
|
2018-03-16 13:33:36 -05:00
|
|
|
|
|
|
|
> div
|
|
|
|
padding 16px
|
|
|
|
overflow-wrap break-word
|
|
|
|
font-size .9em
|
2018-05-23 01:58:53 -05:00
|
|
|
color isDark ? #fff : #4C4C4C
|
|
|
|
border-bottom 1px solid isDark ? rgba(#000, 0.1) : rgba(#000, 0.05)
|
2018-03-16 13:33:36 -05:00
|
|
|
|
|
|
|
&:after
|
|
|
|
content ""
|
|
|
|
display block
|
|
|
|
clear both
|
|
|
|
|
2018-04-29 03:17:15 -05:00
|
|
|
> .avatar
|
2018-03-16 13:33:36 -05:00
|
|
|
display block
|
|
|
|
float left
|
|
|
|
position -webkit-sticky
|
|
|
|
position sticky
|
|
|
|
top 16px
|
2018-04-29 03:17:15 -05:00
|
|
|
width 42px
|
|
|
|
height 42px
|
|
|
|
border-radius 6px
|
2018-03-16 13:33:36 -05:00
|
|
|
|
|
|
|
> .body
|
|
|
|
float right
|
2018-03-17 03:47:46 -05:00
|
|
|
width calc(100% - 42px)
|
|
|
|
padding-left 12px
|
2018-03-16 13:33:36 -05:00
|
|
|
|
|
|
|
> header
|
|
|
|
display flex
|
|
|
|
align-items center
|
|
|
|
margin-bottom 4px
|
|
|
|
white-space nowrap
|
|
|
|
|
|
|
|
> .name
|
|
|
|
display block
|
|
|
|
margin 0 .5em 0 0
|
|
|
|
padding 0
|
|
|
|
overflow hidden
|
|
|
|
font-weight bold
|
|
|
|
text-overflow ellipsis
|
2018-05-23 01:58:53 -05:00
|
|
|
color isDark ? #fff : #627079
|
2018-03-16 13:33:36 -05:00
|
|
|
|
|
|
|
> .username
|
|
|
|
margin 0 .5em 0 0
|
2018-05-23 01:58:53 -05:00
|
|
|
color isDark ? #606984 : #ccc
|
2018-03-16 13:33:36 -05:00
|
|
|
|
|
|
|
> .info
|
|
|
|
margin-left auto
|
|
|
|
font-size 0.9em
|
|
|
|
|
|
|
|
> .created-at
|
2018-05-23 01:58:53 -05:00
|
|
|
color isDark ? #606984 : #c0c0c0
|
|
|
|
|
2018-06-14 23:08:56 -05:00
|
|
|
> .text
|
|
|
|
text-align left
|
|
|
|
|
2018-05-23 01:58:53 -05:00
|
|
|
.mk-welcome-timeline[data-darkmode]
|
|
|
|
root(true)
|
|
|
|
|
|
|
|
.mk-welcome-timeline:not([data-darkmode])
|
|
|
|
root(false)
|
2018-03-16 13:33:36 -05:00
|
|
|
|
|
|
|
</style>
|