2018-02-15 03:33:34 -06:00
|
|
|
<template>
|
2018-04-07 12:30:37 -05:00
|
|
|
<div class="mk-note-card">
|
2018-04-09 04:52:29 -05:00
|
|
|
<a :href="note | notePage">
|
2018-02-15 03:33:34 -06:00
|
|
|
<header>
|
2019-02-04 15:22:39 -06:00
|
|
|
<img :src="avator" alt="avatar"/>
|
2018-12-06 01:09:33 -06:00
|
|
|
<h3><mk-user-name :user="note.user"/></h3>
|
2018-02-15 03:33:34 -06:00
|
|
|
</header>
|
|
|
|
<div>
|
|
|
|
{{ text }}
|
|
|
|
</div>
|
2018-04-07 12:30:37 -05:00
|
|
|
<mk-time :time="note.createdAt"/>
|
2018-02-15 03:33:34 -06:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2018-07-07 05:19:00 -05:00
|
|
|
import summary from '../../../../../misc/get-note-summary';
|
2019-02-04 15:22:39 -06:00
|
|
|
import { getStaticImageUrl } from '../../../common/scripts/get-static-image-url';
|
2018-02-15 03:33:34 -06:00
|
|
|
|
|
|
|
export default Vue.extend({
|
2018-04-07 12:30:37 -05:00
|
|
|
props: ['note'],
|
2018-02-15 03:33:34 -06:00
|
|
|
computed: {
|
|
|
|
text(): string {
|
2018-04-07 12:30:37 -05:00
|
|
|
return summary(this.note);
|
2019-02-04 15:22:39 -06:00
|
|
|
},
|
|
|
|
avator(): string {
|
|
|
|
return this.$store.state.device.disableShowingAnimatedImages
|
|
|
|
? getStaticImageUrl(this.note.user.avatarUrl)
|
|
|
|
: this.note.user.avatarUrl;
|
|
|
|
},
|
2018-02-15 03:33:34 -06:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
2018-09-27 22:20:22 -05:00
|
|
|
.mk-note-card
|
2018-02-15 03:33:34 -06:00
|
|
|
display inline-block
|
|
|
|
width 150px
|
|
|
|
//height 120px
|
|
|
|
font-size 12px
|
2018-09-26 06:28:13 -05:00
|
|
|
background var(--face)
|
2018-02-15 03:33:34 -06:00
|
|
|
border-radius 4px
|
2018-09-27 22:20:22 -05:00
|
|
|
box-shadow 0 2px 8px rgba(0, 0, 0, 0.2)
|
2018-02-15 03:33:34 -06:00
|
|
|
|
|
|
|
> a
|
|
|
|
display block
|
2018-09-27 22:20:22 -05:00
|
|
|
color var(--noteText)
|
2018-02-15 03:33:34 -06:00
|
|
|
|
|
|
|
&:hover
|
|
|
|
text-decoration none
|
|
|
|
|
|
|
|
> header
|
|
|
|
> img
|
|
|
|
position absolute
|
|
|
|
top 8px
|
|
|
|
left 8px
|
|
|
|
width 28px
|
|
|
|
height 28px
|
|
|
|
border-radius 6px
|
|
|
|
|
|
|
|
> h3
|
|
|
|
display inline-block
|
|
|
|
overflow hidden
|
|
|
|
width calc(100% - 45px)
|
|
|
|
margin 8px 0 0 42px
|
|
|
|
line-height 28px
|
|
|
|
white-space nowrap
|
|
|
|
text-overflow ellipsis
|
|
|
|
font-size 12px
|
|
|
|
|
|
|
|
> div
|
|
|
|
padding 2px 8px 8px 8px
|
|
|
|
height 60px
|
|
|
|
overflow hidden
|
|
|
|
white-space normal
|
|
|
|
|
|
|
|
&:after
|
|
|
|
content ""
|
|
|
|
display block
|
|
|
|
position absolute
|
|
|
|
top 40px
|
|
|
|
left 0
|
|
|
|
width 100%
|
|
|
|
height 20px
|
2018-09-27 22:20:22 -05:00
|
|
|
background linear-gradient(to bottom, transparent 0%, var(--face) 100%)
|
2018-02-15 03:33:34 -06:00
|
|
|
|
2018-02-16 12:01:00 -06:00
|
|
|
> .mk-time
|
2018-02-15 03:33:34 -06:00
|
|
|
display inline-block
|
|
|
|
padding 8px
|
2019-02-06 02:51:33 -06:00
|
|
|
color var(--text)
|
2018-02-15 03:33:34 -06:00
|
|
|
|
|
|
|
</style>
|