0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-26 21:23:02 +00:00
VueTube/NUXT/pages/index.vue

66 lines
2.1 KiB
Vue
Raw Normal View History

2022-01-24 22:56:57 +00:00
<template>
<center class="container">
<v-img src="/icon.svg" width="10em" style="margin-bottom: 1em" />
<v-progress-circular size="50" indeterminate color="primary" />
</center>
2022-01-24 22:56:57 +00:00
</template>
2022-03-16 00:31:03 +00:00
2022-03-19 23:17:26 +00:00
<style scoped>
.container {
padding-top: 3em;
display: block;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -80%);
}
</style>
2022-03-16 00:31:03 +00:00
<script>
2022-03-21 13:21:18 +00:00
import { SplashScreen } from "@capacitor/splash-screen";
2022-03-19 23:17:26 +00:00
2022-03-16 00:31:03 +00:00
export default {
layout: "empty",
async mounted() {
//--- Hide Splash Screen ---//
2022-03-21 13:21:18 +00:00
await SplashScreen.hide();
//-------------------------------//
2022-03-19 23:17:26 +00:00
//--- Theme Loader Moved From '~/layouts/default.vue' (because this only needs to be run once) -Front ---//
setTimeout(() => {
//Set timeout is required to make it load properly... dont ask me why -Front
const darkTheme = localStorage.getItem("darkTheme");
if (darkTheme == "true") {
this.$vuetify.theme.dark = darkTheme;
//this.$vuetube.statusBar.setDark(); //Not needed unless setLight() is used below -Front
this.$vuetube.statusBar.setBackground(
this.$vuetify.theme.themes.dark.accent
);
2022-03-19 23:17:26 +00:00
const isOled = localStorage.getItem("isOled");
2022-03-19 23:17:26 +00:00
if (isOled == "true") {
(this.$vuetify.theme.themes.dark.accent = "#000"),
2022-03-22 00:52:45 +00:00
(this.$vuetify.theme.themes.dark.accent = "#000"),
(this.$vuetify.theme.themes.dark.background = "#000");
2022-03-19 23:17:26 +00:00
} else {
(this.$vuetify.theme.themes.dark.accent = "#222"),
2022-03-22 00:52:45 +00:00
(this.$vuetify.theme.themes.dark.accent = "#222"),
(this.$vuetify.theme.themes.dark.background = "#333");
2022-03-19 23:17:26 +00:00
}
} else {
//this.$vuetube.statusBar.setLight() //Looks weird -Front
this.$vuetube.statusBar.setBackground(
this.$vuetify.theme.themes.light.accent
);
}
}, 0);
//-----------------------------------------------------------------------------------------------------------//
2022-03-19 23:17:26 +00:00
await this.$youtube.getAPI();
this.$router.push(`/${localStorage.getItem("startPage") || "home"}`);
},
};
</script>