fix client linter
This commit is contained in:
parent
b8b43d69b0
commit
c2e57cf51a
@ -2,13 +2,16 @@
|
||||
<!--
|
||||
<img :src="`https://ui-avatars.com/api/?name=${seed}&size=${size}`" />
|
||||
-->
|
||||
<div class="avatar" :style="{
|
||||
<div
|
||||
class="avatar"
|
||||
:style="{
|
||||
width: size + 'px',
|
||||
height: size + 'px',
|
||||
lineHeight: size + 'px',
|
||||
fontSize: (size/2) + 'px',
|
||||
fontSize: size / 2 + 'px',
|
||||
backgroundColor: Background(seed),
|
||||
}">
|
||||
}"
|
||||
>
|
||||
{{ seed.substring(0, 2).toUpperCase() }}
|
||||
</div>
|
||||
</template>
|
||||
@ -32,21 +35,24 @@
|
||||
name: 'neko-avatar',
|
||||
})
|
||||
export default class extends Vue {
|
||||
@Prop(String) readonly seed: string | undefined;
|
||||
@Prop(Number) readonly size: number | undefined;
|
||||
@Prop(String) readonly seed: string | undefined
|
||||
@Prop(Number) readonly size: number | undefined
|
||||
|
||||
Background(seed: string) {
|
||||
let a = 0, b = 0, c = 0;
|
||||
let a = 0,
|
||||
b = 0,
|
||||
c = 0
|
||||
|
||||
for (let i = 0; i < seed.length; i++) {
|
||||
a += seed.charCodeAt(i) * 3;
|
||||
b += seed.charCodeAt(i) * 5;
|
||||
c += seed.charCodeAt(i) * 7;
|
||||
a += seed.charCodeAt(i) * 3
|
||||
b += seed.charCodeAt(i) * 5
|
||||
c += seed.charCodeAt(i) * 7
|
||||
}
|
||||
|
||||
let x = Math.floor(128 + (a % 128));
|
||||
let y = Math.floor(128 + (b % 128));
|
||||
let z = Math.floor(128 + (c % 128));
|
||||
return "rgb(" + x + "," + y + "," + z + ")";
|
||||
let x = Math.floor(128 + (a % 128))
|
||||
let y = Math.floor(128 + (b % 128))
|
||||
let z = Math.floor(128 + (c % 128))
|
||||
return 'rgb(' + x + ',' + y + ',' + z + ')'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -37,7 +37,9 @@
|
||||
</li>
|
||||
</ul>
|
||||
<ul v-if="!fullscreen" class="video-menu bottom">
|
||||
<li v-if="hosting && (!clipboard_read_available || !clipboard_write_available)"><i @click.stop.prevent="onClipboard" class="fas fa-clipboard"></i></li>
|
||||
<li v-if="hosting && (!clipboard_read_available || !clipboard_write_available)">
|
||||
<i @click.stop.prevent="onClipboard" class="fas fa-clipboard"></i>
|
||||
</li>
|
||||
<li>
|
||||
<i
|
||||
@click.stop.prevent="requestPictureInPicture"
|
||||
@ -552,9 +554,9 @@
|
||||
onMouseEnter(e: MouseEvent) {
|
||||
if (this.hosting) {
|
||||
this.$accessor.remote.syncKeyboardModifierState({
|
||||
capsLock: e.getModifierState("CapsLock"),
|
||||
numLock: e.getModifierState("NumLock"),
|
||||
scrollLock: e.getModifierState("ScrollLock"),
|
||||
capsLock: e.getModifierState('CapsLock'),
|
||||
numLock: e.getModifierState('NumLock'),
|
||||
scrollLock: e.getModifierState('ScrollLock'),
|
||||
})
|
||||
}
|
||||
|
||||
@ -566,9 +568,9 @@
|
||||
onMouseLeave(e: MouseEvent) {
|
||||
if (this.hosting) {
|
||||
this.$accessor.remote.setKeyboardModifierState({
|
||||
capsLock: e.getModifierState("CapsLock"),
|
||||
numLock: e.getModifierState("NumLock"),
|
||||
scrollLock: e.getModifierState("ScrollLock"),
|
||||
capsLock: e.getModifierState('CapsLock'),
|
||||
numLock: e.getModifierState('NumLock'),
|
||||
scrollLock: e.getModifierState('ScrollLock'),
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user