some minor updates

This commit is contained in:
2022-01-31 01:24:54 +01:00
parent fc10d9de09
commit 6df2b53708
4 changed files with 173 additions and 153 deletions

View File

@@ -3,7 +3,7 @@
<Nav/>
</header>
<main>
<div class="spacer"></div>
<div :style="{height: offset + 'px'}"/>
<router-view name="main"/>
</main>
<footer class="mt-auto">
@@ -16,9 +16,27 @@
import Nav from "@/components/Nav";
import Footer from "@/components/Footer";
import CookieConsentBtn from "@/components/CookieConsentBtn";
import {onMounted, ref} from "vue";
export default {
components: {Footer, Nav, CookieConsentBtn},
setup() {
const offset = ref(0)
const setOffset = () => {
return document.getElementsByTagName('nav')[0].clientHeight
}
window.onresize = () => {
offset.value = setOffset()
}
onMounted(() => {
offset.value = setOffset()
})
return {offset}
}
}
</script>
@@ -28,10 +46,6 @@ export default {
src: local("Obitron"), url("assets/fonts/Orbitron-VariableFont_wght.ttf") format("truetype");
}
.spacer {
height: 70px;
}
#cookie-btn {
position: fixed;
bottom: 30px;

View File

@@ -261,15 +261,10 @@ export default {
}
@media (max-width: 1200px) {
.economy {
justify-content: flex-start;
align-items: flex-start;
h3 {
margin-left: 2rem;
}
}
}
@media (max-width: 800px) and (min-width: 1199px) {
#economy-graph {

View File

@@ -2,14 +2,13 @@ import axios from "axios";
import {errorHandling} from "@/utils/Utils";
const API_URL = process.env.VUE_APP_API_URL
const TIMEOUT = 10_000
// const TIMEOUT = 10_000
export const GetMatches = async () => {
try {
const res = await axios({
method: 'get',
url: `${API_URL}/matches`,
timeout: TIMEOUT
})
if (res.status === 200)
@@ -24,7 +23,6 @@ export const GetUser = async (id) => {
const res = await axios({
method: 'get',
url: `${API_URL}/player/${id}`,
timeout: TIMEOUT
})
if (res.status === 200)
@@ -62,7 +60,6 @@ export const TrackMe = async (id64, authcode, sharecode = '') => {
method: 'post',
url: `${API_URL}/player/${id64}/track`,
data: `authcode=${authcode}&sharecode=${sharecode}`,
timeout: TIMEOUT
})
if (res.status === 202) {
@@ -88,7 +85,6 @@ export const GetPlayerValue = async (match_id) => {
const res = await axios({
method: 'get',
url: `${API_URL}/match/${match_id}/rounds`,
timeout: TIMEOUT
})
if (res.status === 200) {
@@ -104,7 +100,6 @@ export const GetMatchDetails = async (match_id) => {
const res = await axios({
method: 'get',
url: `${API_URL}/match/${match_id}`,
timeout: TIMEOUT
})
if (res.status === 200) {
@@ -120,7 +115,6 @@ export const LoadMoreMatches = async (player_id, date) => {
const res = await axios({
method: 'get',
url: `${API_URL}/player/${player_id}/next/${date}`,
timeout: TIMEOUT
})
if (res.status === 200) {
@@ -136,7 +130,6 @@ export const GetPlayerMeta = async (player_id, limit = 4) => {
const res = await axios({
method: 'get',
url: `${API_URL}/player/${player_id}/meta/${limit}`,
timeout: TIMEOUT
})
if (res.status === 200) {
@@ -152,7 +145,6 @@ export const GetWeaponDmg = async (match_id) => {
const res = await axios({
method: 'get',
url: `${API_URL}/match/${match_id}/weapons`,
timeout: TIMEOUT
})
if (res.status === 200) {
@@ -168,7 +160,6 @@ export const LoadMoreMatchesExplore = async (date) => {
const res = await axios({
method: 'get',
url: `${API_URL}/matches/next/${date}`,
timeout: TIMEOUT
})
if (res.status === 200) {

View File

@@ -1,4 +1,5 @@
<template>
<div class="overlay" :style="{minHeight: pHeight + 'px'}">
<img alt="" class="bg-img" src="">
<div class="match-wrapper">
@@ -137,10 +138,11 @@
<div id="scoreWrapper" class="scoreboard">
<router-view v-if="data.score.length === 2 && data.stats" name="score"/>
</div>
</div>
</template>
<script>
import {onBeforeMount, onBeforeUnmount, onMounted, reactive, watch} from "vue";
import {onBeforeMount, onBeforeUnmount, onMounted, reactive, ref, watch} from "vue";
import {
closeNav,
CreatePlayersArray,
@@ -165,6 +167,7 @@ export default {
setup(props) {
const store = useStore()
const route = useRoute()
const pHeight = ref(0)
const matchIdPattern = /^\d{19}$/
@@ -178,6 +181,16 @@ export default {
team2Avg: 0
})
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()
// Functions
const GetMatch = async () => {
if (matchIdPattern.test(props.match_id)) {
@@ -315,12 +328,16 @@ export default {
scoreWrapper.style.minHeight = height + 'px'
})
window.onresize = () => {
pHeight.value = getWindowHeight()
}
document.addEventListener('click', () => {
closeNav('matchNav')
})
return {
data, DisplayRank, FormatFullDate, FormatDuration, FixMapName, route, checkWin, handleDownloadMenu, getTeamAvgRank
data, DisplayRank, FormatFullDate, FormatDuration, FixMapName, route, pHeight, checkWin, handleDownloadMenu, getTeamAvgRank
}
}
}
@@ -339,10 +356,10 @@ export default {
.head {
height: 230px;
background: linear-gradient(90deg,
rgba(0, 0, 0, 0.7) 0%,
rgba(0, 0, 0, 0.95) 30%,
rgba(0, 0, 0, 0.95) 70%,
rgba(0, 0, 0, .7) 100%
rgba(0, 0, 0, 0.3) 0%,
rgba(0, 0, 0, 0.55) 30%,
rgba(0, 0, 0, 0.55) 70%,
rgba(0, 0, 0, .3) 100%
);
.map-score {
@@ -488,8 +505,10 @@ export default {
display: flex;
justify-content: center;
flex-wrap: wrap;
}
z-index: 1;
.overlay {
z-index: 2;
width: 100%;
max-width: 100vw;
background: linear-gradient(90deg,
@@ -524,6 +543,7 @@ export default {
height: 25px !important;
}
}
.team-2 {
left: -1.3rem !important;
}