2020-01-23 06:16:40 +13:00
|
|
|
<template>
|
2020-01-31 12:57:00 +13:00
|
|
|
<div id="neko" :class="[side ? 'expanded' : '']">
|
2020-01-29 14:27:35 +13:00
|
|
|
<template v-if="!$client.supported">
|
|
|
|
<neko-unsupported />
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
<main class="neko-main">
|
2021-04-04 08:25:11 +12:00
|
|
|
<div v-if="!hideControls" class="header-container">
|
2020-01-29 14:27:35 +13:00
|
|
|
<neko-header />
|
|
|
|
</div>
|
|
|
|
<div class="video-container">
|
2021-04-05 02:57:23 +12:00
|
|
|
<neko-video ref="video" :hideControls="hideControls" @control-attempt="controlAttempt" />
|
2020-01-29 14:27:35 +13:00
|
|
|
</div>
|
2021-04-04 08:25:11 +12:00
|
|
|
<div v-if="!hideControls" class="room-container">
|
2020-01-29 14:27:35 +13:00
|
|
|
<neko-members />
|
|
|
|
<div class="room-menu">
|
|
|
|
<div class="settings">
|
|
|
|
<neko-menu />
|
|
|
|
</div>
|
|
|
|
<div class="controls">
|
2021-04-05 02:57:23 +12:00
|
|
|
<neko-controls :shakeKbd="shakeKbd" />
|
2020-01-29 14:27:35 +13:00
|
|
|
</div>
|
|
|
|
<div class="emotes">
|
|
|
|
<neko-emotes />
|
|
|
|
</div>
|
2020-01-23 06:16:40 +13:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-01-29 14:27:35 +13:00
|
|
|
</main>
|
2021-04-04 08:25:11 +12:00
|
|
|
<neko-side v-if="!hideControls && side" />
|
2020-01-29 14:27:35 +13:00
|
|
|
<neko-connect v-if="!connected" />
|
|
|
|
<neko-about v-if="about" />
|
2021-04-04 08:25:11 +12:00
|
|
|
<notifications
|
|
|
|
v-if="!hideControls"
|
|
|
|
group="neko"
|
|
|
|
position="top left"
|
|
|
|
style="top: 50px; pointer-events: none"
|
|
|
|
:ignoreDuplicates="true"
|
|
|
|
/>
|
2020-01-29 14:27:35 +13:00
|
|
|
</template>
|
2020-01-23 06:16:40 +13:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
#neko {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
2020-01-31 12:57:00 +13:00
|
|
|
max-width: 100vw;
|
|
|
|
max-height: 100vh;
|
2020-01-23 06:16:40 +13:00
|
|
|
flex-direction: row;
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
.neko-main {
|
2020-01-31 12:57:00 +13:00
|
|
|
min-width: 360px;
|
2020-01-23 06:16:40 +13:00
|
|
|
max-width: 100%;
|
|
|
|
flex-grow: 1;
|
|
|
|
flex-direction: column;
|
|
|
|
display: flex;
|
|
|
|
overflow: auto;
|
|
|
|
|
|
|
|
.header-container {
|
|
|
|
background: $background-tertiary;
|
|
|
|
height: $menu-height;
|
|
|
|
flex-shrink: 0;
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
|
|
|
.video-container {
|
|
|
|
background: rgba($color: #000, $alpha: 0.4);
|
|
|
|
max-width: 100%;
|
|
|
|
flex-grow: 1;
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
|
|
|
.room-container {
|
|
|
|
background: $background-tertiary;
|
|
|
|
height: $controls-height;
|
|
|
|
max-width: 100%;
|
|
|
|
flex-shrink: 0;
|
|
|
|
flex-direction: column;
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
.room-menu {
|
|
|
|
max-width: 100%;
|
|
|
|
flex: 1;
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
.settings {
|
|
|
|
margin-left: 10px;
|
|
|
|
flex: 1;
|
|
|
|
justify-content: flex-start;
|
|
|
|
align-items: center;
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
|
|
|
.controls {
|
|
|
|
flex: 1;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
2020-01-24 04:23:26 +13:00
|
|
|
.emotes {
|
2020-01-23 06:16:40 +13:00
|
|
|
margin-right: 10px;
|
|
|
|
flex: 1;
|
|
|
|
justify-content: flex-end;
|
|
|
|
align-items: center;
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-01-31 12:57:00 +13:00
|
|
|
|
|
|
|
@media only screen and (max-width: 600px) {
|
2021-02-14 01:01:51 +13:00
|
|
|
#neko.expanded {
|
|
|
|
.neko-main {
|
|
|
|
transform: translateX(calc(-100% + 65px));
|
|
|
|
|
|
|
|
video {
|
|
|
|
display: none;
|
2020-01-31 12:57:00 +13:00
|
|
|
}
|
|
|
|
}
|
2021-02-14 01:01:51 +13:00
|
|
|
|
|
|
|
.neko-menu {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
left: 65px;
|
|
|
|
width: calc(100% - 65px);
|
|
|
|
}
|
2020-01-31 12:57:00 +13:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@media only screen and (max-width: 768px) {
|
2021-02-14 01:01:51 +13:00
|
|
|
#neko .neko-main .room-container {
|
|
|
|
display: none;
|
2020-01-31 12:57:00 +13:00
|
|
|
}
|
|
|
|
}
|
2020-01-23 06:16:40 +13:00
|
|
|
</style>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-04-04 08:25:11 +12:00
|
|
|
import { Vue, Component, Ref, Watch } from 'vue-property-decorator'
|
2020-01-23 06:16:40 +13:00
|
|
|
|
|
|
|
import Connect from '~/components/connect.vue'
|
|
|
|
import Video from '~/components/video.vue'
|
|
|
|
import Menu from '~/components/menu.vue'
|
|
|
|
import Side from '~/components/side.vue'
|
|
|
|
import Controls from '~/components/controls.vue'
|
|
|
|
import Members from '~/components/members.vue'
|
2020-01-24 04:23:26 +13:00
|
|
|
import Emotes from '~/components/emotes.vue'
|
2020-01-23 06:16:40 +13:00
|
|
|
import About from '~/components/about.vue'
|
2020-01-24 04:23:26 +13:00
|
|
|
import Header from '~/components/header.vue'
|
2020-01-29 14:27:35 +13:00
|
|
|
import Unsupported from '~/components/unsupported.vue'
|
2020-01-23 06:16:40 +13:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
name: 'neko',
|
|
|
|
components: {
|
|
|
|
'neko-connect': Connect,
|
|
|
|
'neko-video': Video,
|
|
|
|
'neko-menu': Menu,
|
|
|
|
'neko-side': Side,
|
|
|
|
'neko-controls': Controls,
|
|
|
|
'neko-members': Members,
|
2020-01-24 04:23:26 +13:00
|
|
|
'neko-emotes': Emotes,
|
2020-01-23 06:16:40 +13:00
|
|
|
'neko-about': About,
|
2020-01-24 04:23:26 +13:00
|
|
|
'neko-header': Header,
|
2020-01-29 14:27:35 +13:00
|
|
|
'neko-unsupported': Unsupported,
|
2020-01-23 06:16:40 +13:00
|
|
|
},
|
|
|
|
})
|
|
|
|
export default class extends Vue {
|
|
|
|
@Ref('video') video!: Video
|
|
|
|
|
2021-04-05 02:57:23 +12:00
|
|
|
shakeKbd = false
|
|
|
|
|
2021-04-04 08:25:11 +12:00
|
|
|
get hideControls() {
|
|
|
|
return !!new URL(location.href).searchParams.get('cast')
|
|
|
|
}
|
|
|
|
|
|
|
|
@Watch('hideControls', { immediate: true })
|
|
|
|
onHideControls() {
|
|
|
|
this.$accessor.video.setMuted(false)
|
|
|
|
this.$accessor.settings.setSound(false)
|
|
|
|
}
|
|
|
|
|
2021-04-05 02:57:23 +12:00
|
|
|
controlAttempt() {
|
|
|
|
if (this.shakeKbd || this.$accessor.remote.hosted) return
|
|
|
|
|
|
|
|
this.shakeKbd = true
|
|
|
|
setTimeout(() => (this.shakeKbd = false), 5000)
|
|
|
|
}
|
|
|
|
|
2020-01-23 06:16:40 +13:00
|
|
|
get about() {
|
|
|
|
return this.$accessor.client.about
|
|
|
|
}
|
|
|
|
|
|
|
|
get side() {
|
|
|
|
return this.$accessor.client.side
|
|
|
|
}
|
|
|
|
|
|
|
|
get connected() {
|
|
|
|
return this.$accessor.connected
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|