Archived
2
0

fix client linter

This commit is contained in:
m1k1o 2021-02-13 12:05:59 +01:00
parent b8b43d69b0
commit c2e57cf51a
2 changed files with 35 additions and 27 deletions

View File

@ -2,13 +2,16 @@
<!--
<img :src="`https://ui-avatars.com/api/?name=${seed}&size=${size}`" />
-->
<div class="avatar" :style="{
width: size + 'px',
height: size + 'px',
lineHeight: size + 'px',
fontSize: (size/2) + 'px',
backgroundColor: Background(seed),
}">
<div
class="avatar"
:style="{
width: size + 'px',
height: size + 'px',
lineHeight: size + '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;
for(let i = 0; i < seed.length; i++) {
a += seed.charCodeAt(i) * 3;
b += seed.charCodeAt(i) * 5;
c += seed.charCodeAt(i) * 7;
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
}
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>

View File

@ -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"
@ -550,11 +552,11 @@
}
onMouseEnter(e: MouseEvent) {
if(this.hosting) {
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'),
})
}
@ -564,11 +566,11 @@
}
onMouseLeave(e: MouseEvent) {
if(this.hosting) {
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'),
})
}