1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-23 11:08:31 +09:00
cherrypick/src/client/app/desktop/views/components/user-card.vue

86 lines
1.7 KiB
Vue
Raw Normal View History

2018-02-15 13:24:46 +09:00
<template>
<div class="zvdbznxvfixtmujpsigoccczftvpiwqh">
<div class="banner" :style="bannerStyle"></div>
<mk-avatar class="avatar" :user="user" :disable-preview="true"/>
2018-11-13 16:19:46 +09:00
<mk-follow-button :user="user" class="follow" mini/>
<div class="body">
<router-link :to="user | userPage" class="name">
2018-12-06 11:18:13 +09:00
<mk-user-name :user="user"/>
</router-link>
2019-01-05 19:59:10 +09:00
<span class="username">@{{ user | acct }} <fa v-if="user.isLocked == true" class="locked" icon="lock" fixed-width/></span>
<div class="description">
<mfm v-if="user.description" :text="user.description" :author="user" :i="$store.state.i" :custom-emojis="user.emojis"/>
2018-02-15 13:24:46 +09:00
</div>
</div>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
2018-03-27 16:51:12 +09:00
2018-02-15 13:24:46 +09:00
export default Vue.extend({
props: ['user'],
computed: {
bannerStyle(): any {
if (this.user.bannerUrl == null) return {};
return {
backgroundColor: this.user.bannerColor && this.user.bannerColor.length == 3 ? `rgb(${ this.user.bannerColor.join(',') })` : null,
backgroundImage: `url(${ this.user.bannerUrl })`
};
}
},
2018-02-15 13:24:46 +09:00
});
</script>
<style lang="stylus" scoped>
.zvdbznxvfixtmujpsigoccczftvpiwqh
$bg = var(--face)
height 280px
overflow hidden
2018-11-09 21:46:35 +09:00
font-size 13px
text-align center
background $bg
box-shadow 0 2px 4px rgba(0, 0, 0, 0.1)
color var(--faceText)
2018-02-15 13:24:46 +09:00
> .banner
height 90px
background-color #f9f4f4
background-position center
background-size cover
2018-02-15 13:24:46 +09:00
2018-04-29 17:17:15 +09:00
> .avatar
2018-02-15 13:24:46 +09:00
display block
margin -40px auto 0 auto
width 80px
height 80px
border-radius 100%
border solid 4px $bg
2018-02-15 13:24:46 +09:00
2018-11-08 11:20:50 +09:00
> .follow
position absolute
top 16px
right 16px
> .body
padding 0px 24px
2018-02-15 13:24:46 +09:00
> .name
font-size 120%
font-weight bold
2018-02-15 13:24:46 +09:00
> .username
display block
opacity 0.7
2018-02-15 13:24:46 +09:00
2019-01-05 19:59:10 +09:00
> .locked
opacity 0.8
> .description
margin 8px 0 16px 0
2018-02-15 13:24:46 +09:00
</style>