fixed background on player (#42)
All checks were successful
CSGOWTF/csgowtf/pipeline/head This commit looks good

Co-authored-by: vikingowl <cw.nachtigall@gmail.com>
Reviewed-on: https://git.harting.dev/CSGOWTF/csgowtf/pulls/42
Co-authored-by: vikingowl <vikingowl@git.harting.dev>
Co-committed-by: vikingowl <vikingowl@git.harting.dev>
This commit is contained in:
vikingowl
2022-01-31 03:05:29 +01:00
parent f2a8e483c4
commit 1c178404ab
2 changed files with 19 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "csgowtf", "name": "csgowtf",
"version": "1.0.0", "version": "1.0.1",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",

View File

@@ -1,7 +1,7 @@
<template> <template>
<img alt="" class="bg-img" src=""> <img alt="" class="bg-img" src="">
<div class="wrapper"> <div class="wrapper" :style="{minHeight: pHeight + 'px'}">
<div class="container-lg"> <div class="container-lg">
<div v-if="store.state.playerDetails.name"> <div v-if="store.state.playerDetails.name">
<div class="card mb-3 bg-transparent border-0"> <div class="card mb-3 bg-transparent border-0">
@@ -148,7 +148,7 @@
</template> </template>
<script> <script>
import {onBeforeMount, onBeforeUnmount, onMounted, reactive, watch} from "vue"; import {onBeforeMount, onBeforeUnmount, onMounted, reactive, ref, watch} from "vue";
import {useStore} from "vuex"; import {useStore} from "vuex";
import { import {
constructAvatarUrl, constructAvatarUrl,
@@ -180,7 +180,7 @@ export default {
setup(props) { setup(props) {
// Variables // Variables
const store = useStore() const store = useStore()
const pHeight = ref(0)
const displayCounter = 3 const displayCounter = 3
const data = reactive({ const data = reactive({
@@ -201,6 +201,16 @@ export default {
playerMeta: {}, playerMeta: {},
}) })
const getWindowHeight = () => {
const navHeight = document.getElementsByTagName('nav')[0].clientHeight
const footerHeight = document.getElementsByTagName('footer')[0].clientHeight
// 70 = nav-height | 108.5 = footer-height
return window.innerHeight - navHeight - footerHeight
}
pHeight.value = getWindowHeight()
onBeforeMount(() => { onBeforeMount(() => {
if (Object.entries(store.state.playerDetails).length === 0) { if (Object.entries(store.state.playerDetails).length === 0) {
GetPlayer() GetPlayer()
@@ -352,9 +362,14 @@ export default {
}) })
}) })
window.onresize = () => {
pHeight.value = getWindowHeight()
}
return { return {
data, data,
store, store,
pHeight,
props, props,
TrackPlayer, TrackPlayer,
RefreshData, RefreshData,