Skip to content

Commit

Permalink
Fix: avatar/cat - average color
Browse files Browse the repository at this point in the history
  • Loading branch information
fs5m8 committed Jan 3, 2023
1 parent 518e5b2 commit cd97f08
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/client/app/common/views/components/avatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,21 @@ export default Vue.extend({
},
watch: {
'user.avatarBlurhash'() {
this.$el.style.color = this.getBlurhashAvgColor(this.user.avatarBlurhash);
const avgColor = this.getBlurhashAvgColor(this.user.avatarBlurhash);
if (avgColor === undefined){
this.$el.style.color = "var(--noteText)";
} else {
this.$el.style.color = avgColor;
}
}
},
mounted() {
this.$el.style.color = this.getBlurhashAvgColor(this.user.avatarBlurhash);
const avgColor = this.getBlurhashAvgColor(this.user.avatarBlurhash);
if (avgColor === undefined){
this.$el.style.color = "var(--noteText)";
} else {
this.$el.style.color = avgColor;
}
},
methods: {
getBlurhashAvgColor(s) {
Expand Down Expand Up @@ -100,7 +110,7 @@ export default Vue.extend({
&.cat::before,
&.cat::after
background #df548f
border solid 4px var(--noteText)
border solid 4px currentColor
box-sizing border-box
content ''
display inline-block
Expand Down

0 comments on commit cd97f08

Please sign in to comment.