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/> <Nav/>
</header> </header>
<main> <main>
<div class="spacer"></div> <div :style="{height: offset + 'px'}"/>
<router-view name="main"/> <router-view name="main"/>
</main> </main>
<footer class="mt-auto"> <footer class="mt-auto">
@@ -16,9 +16,27 @@
import Nav from "@/components/Nav"; import Nav from "@/components/Nav";
import Footer from "@/components/Footer"; import Footer from "@/components/Footer";
import CookieConsentBtn from "@/components/CookieConsentBtn"; import CookieConsentBtn from "@/components/CookieConsentBtn";
import {onMounted, ref} from "vue";
export default { export default {
components: {Footer, Nav, CookieConsentBtn}, 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> </script>
@@ -28,10 +46,6 @@ export default {
src: local("Obitron"), url("assets/fonts/Orbitron-VariableFont_wght.ttf") format("truetype"); src: local("Obitron"), url("assets/fonts/Orbitron-VariableFont_wght.ttf") format("truetype");
} }
.spacer {
height: 70px;
}
#cookie-btn { #cookie-btn {
position: fixed; position: fixed;
bottom: 30px; bottom: 30px;

View File

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

View File

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

View File

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