2.0.0
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
<div class="mk-media-list" :data-count="mediaList.length">
|
||||
<template v-for="media in mediaList">
|
||||
<mk-media-video :video="media" :key="media.id" v-if="media.type.startsWith('video')" :inline-playable="mediaList.length === 1"/>
|
||||
<mk-media-image :image="media" :key="media.id" v-else />
|
||||
<mk-media-image :image="media" :key="media.id" v-else :raw="raw"/>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
@ -11,7 +11,14 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['mediaList'],
|
||||
props: {
|
||||
mediaList: {
|
||||
required: true
|
||||
},
|
||||
raw: {
|
||||
default: false
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -23,7 +30,7 @@ export default Vue.extend({
|
||||
|
||||
@media (max-width 500px)
|
||||
height 192px
|
||||
|
||||
|
||||
&[data-count="1"]
|
||||
grid-template-rows 1fr
|
||||
&[data-count="2"]
|
||||
@ -40,7 +47,7 @@ export default Vue.extend({
|
||||
&[data-count="4"]
|
||||
grid-template-columns 1fr 1fr
|
||||
grid-template-rows 1fr 1fr
|
||||
|
||||
|
||||
:nth-child(1)
|
||||
grid-column 1 / 2
|
||||
grid-row 1 / 2
|
||||
@ -53,5 +60,5 @@ export default Vue.extend({
|
||||
:nth-child(4)
|
||||
grid-column 2 / 3
|
||||
grid-row 2 / 3
|
||||
|
||||
|
||||
</style>
|
||||
|
@ -31,7 +31,7 @@
|
||||
<section v-if="invitations.length > 0">
|
||||
<h2>対局の招待があります!:</h2>
|
||||
<div class="invitation" v-for="i in invitations" tabindex="-1" @click="accept(i)">
|
||||
<img :src="`${i.parent.avatarUrl}?thumbnail&size=32`" alt="">
|
||||
<mk-avatar class="avatar" :user="i.parent"/>
|
||||
<span class="name"><b>{{ i.parent.name }}</b></span>
|
||||
<span class="username">@{{ i.parent.username }}</span>
|
||||
<mk-time :time="i.createdAt"/>
|
||||
@ -40,8 +40,8 @@
|
||||
<section v-if="myGames.length > 0">
|
||||
<h2>自分の対局</h2>
|
||||
<a class="game" v-for="g in myGames" tabindex="-1" @click.prevent="go(g)" :href="`/othello/${g.id}`">
|
||||
<img :src="`${g.user1.avatarUrl}?thumbnail&size=32`" alt="">
|
||||
<img :src="`${g.user2.avatarUrl}?thumbnail&size=32`" alt="">
|
||||
<mk-avatar class="avatar" :user="g.user1.avatarUrl"/>
|
||||
<mk-avatar class="avatar" :user="g.user2.avatarUrl"/>
|
||||
<span><b>{{ g.user1.name }}</b> vs <b>{{ g.user2.name }}</b></span>
|
||||
<span class="state">{{ g.isEnded ? '終了' : '進行中' }}</span>
|
||||
</a>
|
||||
@ -49,8 +49,8 @@
|
||||
<section v-if="games.length > 0">
|
||||
<h2>みんなの対局</h2>
|
||||
<a class="game" v-for="g in games" tabindex="-1" @click.prevent="go(g)" :href="`/othello/${g.id}`">
|
||||
<img :src="`${g.user1.avatarUrl}?thumbnail&size=32`" alt="">
|
||||
<img :src="`${g.user2.avatarUrl}?thumbnail&size=32`" alt="">
|
||||
<mk-avatar class="avatar" :user="g.user1.avatarUrl"/>
|
||||
<mk-avatar class="avatar" :user="g.user2.avatarUrl"/>
|
||||
<span><b>{{ g.user1.name }}</b> vs <b>{{ g.user2.name }}</b></span>
|
||||
<span class="state">{{ g.isEnded ? '終了' : '進行中' }}</span>
|
||||
</a>
|
||||
@ -271,8 +271,7 @@ export default Vue.extend({
|
||||
&:active
|
||||
background #eee
|
||||
|
||||
> img
|
||||
vertical-align bottom
|
||||
> .avatar
|
||||
border-radius 100%
|
||||
|
||||
> span
|
||||
@ -301,8 +300,7 @@ export default Vue.extend({
|
||||
&:active
|
||||
background #eee
|
||||
|
||||
> img
|
||||
vertical-align bottom
|
||||
> .avatar
|
||||
border-radius 100%
|
||||
|
||||
> span
|
||||
|
@ -14,12 +14,20 @@ import Vue from 'vue';
|
||||
import MkMediaImageDialog from './media-image-dialog.vue';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['image'],
|
||||
props: {
|
||||
image: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
raw: {
|
||||
default: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
style(): any {
|
||||
return {
|
||||
'background-color': this.image.properties.avgColor ? `rgb(${this.image.properties.avgColor.join(',')})` : 'transparent',
|
||||
'background-image': `url(${this.image.url}?thumbnail&size=512)`
|
||||
'background-image': this.raw ? `url(${this.image.url})` : `url(${this.image.url}?thumbnail&size=512)`
|
||||
};
|
||||
}
|
||||
},
|
||||
|
@ -52,6 +52,7 @@ export default Vue.extend({
|
||||
width 100%
|
||||
height 100%
|
||||
border-radius 4px
|
||||
|
||||
.mk-media-video-thumbnail
|
||||
display flex
|
||||
justify-content center
|
||||
|
@ -39,7 +39,7 @@
|
||||
<mk-note-html v-if="p.text" :text="p.text" :i="os.i"/>
|
||||
</div>
|
||||
<div class="media" v-if="p.media.length > 0">
|
||||
<mk-media-list :media-list="p.media"/>
|
||||
<mk-media-list :media-list="p.media" :raw="true"/>
|
||||
</div>
|
||||
<mk-poll v-if="p.poll" :note="p"/>
|
||||
<mk-url-preview v-for="url in urls" :url="url" :key="url"/>
|
||||
|
@ -53,6 +53,7 @@ root(isDark)
|
||||
|
||||
> header
|
||||
display flex
|
||||
align-items baseline
|
||||
white-space nowrap
|
||||
|
||||
> .name
|
||||
|
@ -65,6 +65,7 @@ root(isDark)
|
||||
|
||||
> header
|
||||
display flex
|
||||
align-items baseline
|
||||
margin-bottom 2px
|
||||
white-space nowrap
|
||||
line-height 21px
|
||||
|
@ -400,7 +400,7 @@ root(isDark)
|
||||
|
||||
> header
|
||||
display flex
|
||||
align-items center
|
||||
align-items baseline
|
||||
margin-bottom 4px
|
||||
white-space nowrap
|
||||
|
||||
|
@ -6,12 +6,20 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['image'],
|
||||
props: {
|
||||
image: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
raw: {
|
||||
default: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
style(): any {
|
||||
return {
|
||||
'background-color': this.image.properties.avgColor ? `rgb(${this.image.properties.avgColor.join(',')})` : 'transparent',
|
||||
'background-image': `url(${this.image.url}?thumbnail&size=512)`
|
||||
'background-image': this.raw ? `url(${this.image.url})` : `url(${this.image.url}?thumbnail&size=512)`
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ root(isDark)
|
||||
|
||||
> header
|
||||
display flex
|
||||
align-items baseline
|
||||
margin-bottom 4px
|
||||
white-space nowrap
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
<router-link v-for="tag in p.tags" :key="tag" :to="`/search?q=#${tag}`">{{ tag }}</router-link>
|
||||
</div>
|
||||
<div class="media" v-if="p.media.length > 0">
|
||||
<mk-media-list :media-list="p.media"/>
|
||||
<mk-media-list :media-list="p.media" :raw="true"/>
|
||||
</div>
|
||||
<mk-poll v-if="p.poll" :note="p"/>
|
||||
<mk-url-preview v-for="url in urls" :url="url" :key="url"/>
|
||||
|
@ -49,6 +49,7 @@ root(isDark)
|
||||
|
||||
> header
|
||||
display flex
|
||||
align-items baseline
|
||||
margin-bottom 4px
|
||||
white-space nowrap
|
||||
|
||||
|
@ -69,6 +69,7 @@ root(isDark)
|
||||
|
||||
> header
|
||||
display flex
|
||||
align-items baseline
|
||||
margin-bottom 2px
|
||||
white-space nowrap
|
||||
|
||||
|
@ -333,7 +333,7 @@ root(isDark)
|
||||
|
||||
> header
|
||||
display flex
|
||||
align-items center
|
||||
align-items baseline
|
||||
white-space nowrap
|
||||
|
||||
@media (min-width 500px)
|
||||
|
@ -124,7 +124,7 @@ root(isDark)
|
||||
|
||||
> header
|
||||
display flex
|
||||
align-items center
|
||||
align-items baseline
|
||||
white-space nowrap
|
||||
|
||||
i, .mk-reaction-icon
|
||||
|
Reference in New Issue
Block a user