diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-04-08 19:56:42 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-04-08 19:56:42 +0900 |
| commit | fab0cc51b3ca557b278b0d2414d436d6552d4f08 (patch) | |
| tree | 62619d8b92895663e1c9447d38f1281b89033efa /src/client/app/common/views/components | |
| parent | ユーザーリストでフォローボタンを表示するように (#4603) (diff) | |
| download | misskey-fab0cc51b3ca557b278b0d2414d436d6552d4f08.tar.gz misskey-fab0cc51b3ca557b278b0d2414d436d6552d4f08.tar.bz2 misskey-fab0cc51b3ca557b278b0d2414d436d6552d4f08.zip | |
Fix
Diffstat (limited to 'src/client/app/common/views/components')
5 files changed, 7 insertions, 14 deletions
diff --git a/src/client/app/common/views/components/avatar.vue b/src/client/app/common/views/components/avatar.vue index c074fb600f..04f3ed9f78 100644 --- a/src/client/app/common/views/components/avatar.vue +++ b/src/client/app/common/views/components/avatar.vue @@ -55,12 +55,7 @@ export default Vue.extend({ }, icon(): any { return { - backgroundColor: this.user.avatarColor ? this.lightmode - ? this.user.avatarColor - : this.user.avatarColor.startsWith('rgb(') - ? this.user.avatarColor - : null - : null, + backgroundColor: this.user.avatarColor, backgroundImage: this.lightmode ? null : `url(${this.url})`, borderRadius: this.$store.state.settings.circleIcons ? '100%' : null }; diff --git a/src/client/app/common/views/components/drive-file-thumbnail.vue b/src/client/app/common/views/components/drive-file-thumbnail.vue index faa727f3b6..c432de1721 100644 --- a/src/client/app/common/views/components/drive-file-thumbnail.vue +++ b/src/client/app/common/views/components/drive-file-thumbnail.vue @@ -111,9 +111,7 @@ export default Vue.extend({ : false; }, background(): string { - return this.file.properties.avgColor && this.file.properties.avgColor.length == 3 - ? `rgb(${this.file.properties.avgColor.join(',')})` - : 'transparent'; + return this.file.properties.avgColor || 'transparent'; } }, mounted() { @@ -122,10 +120,10 @@ export default Vue.extend({ }, methods: { onThumbnailLoaded() { - if (this.file.properties.avgColor && this.file.properties.avgColor.length == 3) { + if (this.file.properties.avgColor) { anime({ targets: this.$refs.thumbnail, - backgroundColor: `rgba(${this.file.properties.avgColor.join(',')}, 0)`, + backgroundColor: this.file.properties.avgColor.replace('255)', '0)'), duration: 100, easing: 'linear' }); diff --git a/src/client/app/common/views/components/media-image.vue b/src/client/app/common/views/components/media-image.vue index 3947ef5527..2559907512 100644 --- a/src/client/app/common/views/components/media-image.vue +++ b/src/client/app/common/views/components/media-image.vue @@ -52,7 +52,7 @@ export default Vue.extend({ } return { - 'background-color': this.image.properties.avgColor && this.image.properties.avgColor.length == 3 ? `rgb(${this.image.properties.avgColor.join(',')})` : 'transparent', + 'background-color': this.image.properties.avgColor || 'transparent', 'background-image': url }; } diff --git a/src/client/app/common/views/components/messaging-room.message.vue b/src/client/app/common/views/components/messaging-room.message.vue index ce76c402f3..256ea760b3 100644 --- a/src/client/app/common/views/components/messaging-room.message.vue +++ b/src/client/app/common/views/components/messaging-room.message.vue @@ -11,7 +11,7 @@ <div class="file" v-if="message.file"> <a :href="message.file.url" target="_blank" :title="message.file.name"> <img v-if="message.file.type.split('/')[0] == 'image'" :src="message.file.url" :alt="message.file.name" - :style="{ backgroundColor: message.file.properties.avgColor && message.file.properties.avgColor.length == 3 ? `rgb(${message.file.properties.avgColor.join(',')})` : 'transparent' }"/> + :style="{ backgroundColor: message.file.properties.avgColor || 'transparent' }"/> <p v-else>{{ message.file.name }}</p> </a> </div> diff --git a/src/client/app/common/views/components/settings/profile.vue b/src/client/app/common/views/components/settings/profile.vue index acfc1875a6..fd08f85816 100644 --- a/src/client/app/common/views/components/settings/profile.vue +++ b/src/client/app/common/views/components/settings/profile.vue @@ -165,7 +165,7 @@ export default Vue.extend({ bannerStyle(): any { if (this.$store.state.i.bannerUrl == null) return {}; return { - backgroundColor: this.$store.state.i.bannerColor ? this.$store.state.i.bannerColor : null, + backgroundColor: this.$store.state.i.bannerColor, backgroundImage: `url(${ this.$store.state.i.bannerUrl })` }; }, |