forked from mirror/misskey
Merge branch 'develop' of https://github.com/syuilo/misskey into develop
This commit is contained in:
commit
1a2de1a051
@ -40,7 +40,23 @@ export default Vue.extend({
|
|||||||
: this.user.avatarUrl;
|
: this.user.avatarUrl;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
'user.avatarBlurhash'() {
|
||||||
|
this.$el.style.color = this.getBlurhashAvgColor(this.user.avatarBlurhash);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$el.style.color = this.getBlurhashAvgColor(this.user.avatarBlurhash);
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getBlurhashAvgColor(s) {
|
||||||
|
return typeof s == 'string'
|
||||||
|
? '#' + [...s.slice(2, 6)]
|
||||||
|
.map(x => '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~'.indexOf(x))
|
||||||
|
.reduce((a, c) => a * 83 + c, 0)
|
||||||
|
.toString(16)
|
||||||
|
: undefined;
|
||||||
|
},
|
||||||
onClick(e) {
|
onClick(e) {
|
||||||
this.$emit('click', e);
|
this.$emit('click', e);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user