2018-03-29 01:57:00 -05:00
|
|
|
<template>
|
2019-11-10 10:40:26 -06:00
|
|
|
<div id="app">
|
2018-04-01 21:43:23 -05:00
|
|
|
<vue-progress-bar></vue-progress-bar>
|
2018-03-30 14:31:09 -05:00
|
|
|
<app-navbar></app-navbar>
|
2019-11-10 10:40:26 -06:00
|
|
|
<section id="main" class="">
|
2018-03-30 14:31:09 -05:00
|
|
|
<div class="container">
|
2024-09-28 20:58:25 -05:00
|
|
|
<router-view v-slot="{ Component }">
|
|
|
|
<transition name="fade" mode="out-in">
|
|
|
|
<component v-if="!hasError" :is="Component" />
|
|
|
|
<div v-else>
|
|
|
|
<h1>Error!</h1>
|
|
|
|
<p>{{ error }}</p>
|
|
|
|
</div>
|
|
|
|
</transition>
|
|
|
|
</router-view>
|
2018-03-30 14:31:09 -05:00
|
|
|
</div>
|
|
|
|
</section>
|
2018-03-29 01:57:00 -05:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
2024-09-28 20:58:25 -05:00
|
|
|
import { mapState } from "pinia";
|
2018-09-13 14:51:41 -05:00
|
|
|
import TWEEN from '@tweenjs/tween.js';
|
2024-09-28 20:58:25 -05:00
|
|
|
import { useAppConfigStore } from "../stores/appConfig";
|
2018-03-30 14:31:09 -05:00
|
|
|
|
2018-03-29 01:57:00 -05:00
|
|
|
export default {
|
2018-04-01 21:43:23 -05:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
};
|
|
|
|
},
|
2024-09-28 20:58:25 -05:00
|
|
|
|
2018-03-30 14:31:09 -05:00
|
|
|
computed: {
|
2024-09-28 20:58:25 -05:00
|
|
|
...mapState(useAppConfigStore, {
|
|
|
|
hasError: store => store.error !== null,
|
|
|
|
error: store => store.error,
|
|
|
|
authChecked: store => store.authChecked,
|
|
|
|
initialLoad: store => store.initialLoad
|
2018-03-30 14:31:09 -05:00
|
|
|
})
|
|
|
|
},
|
2018-03-29 01:57:00 -05:00
|
|
|
|
2018-04-01 21:43:23 -05:00
|
|
|
watch: {
|
|
|
|
isLoading(val) {
|
|
|
|
if (val) {
|
2024-09-28 20:58:25 -05:00
|
|
|
// this.$Progress.start();
|
2018-04-01 21:43:23 -05:00
|
|
|
} else {
|
2024-09-28 20:58:25 -05:00
|
|
|
// this.$Progress.finish();
|
2018-04-01 21:43:23 -05:00
|
|
|
}
|
2019-11-10 10:40:26 -06:00
|
|
|
},
|
|
|
|
|
|
|
|
initialLoad(val) {
|
|
|
|
if (val) {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
document.body.classList.remove("loading");
|
|
|
|
});
|
|
|
|
}
|
2018-04-01 21:43:23 -05:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
created() {
|
2018-09-13 14:51:41 -05:00
|
|
|
// Setup global animation loop
|
|
|
|
function animate () {
|
|
|
|
TWEEN.update();
|
|
|
|
requestAnimationFrame(animate);
|
|
|
|
}
|
|
|
|
animate();
|
|
|
|
|
2018-03-30 17:08:09 -05:00
|
|
|
if (this.user === null && this.authChecked === false) {
|
2018-06-09 12:36:46 -05:00
|
|
|
this.checkAuthentication();
|
2018-03-30 17:08:09 -05:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2019-11-10 10:40:26 -06:00
|
|
|
mounted() {
|
|
|
|
if (this.initialLoad) {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
document.body.classList.remove("loading");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-03-30 14:31:09 -05:00
|
|
|
components: {
|
|
|
|
}
|
2018-03-29 01:57:00 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|