Files
STARTLINER/src/components/App.vue
2025-03-06 20:38:18 +00:00

126 lines
3.9 KiB
Vue

<script setup lang="ts">
import { computed, onMounted, ref } from 'vue';
import Button from 'primevue/button';
import Tab from 'primevue/tab';
import TabList from 'primevue/tablist';
import TabPanel from 'primevue/tabpanel';
import TabPanels from 'primevue/tabpanels';
import Tabs from 'primevue/tabs';
import ModList from './ModList.vue';
import ModStore from './ModStore.vue';
import OptionList from './OptionList.vue';
import ProfileList from './ProfileList.vue';
import StartButton from './StartButton.vue';
import { invoke } from '../invoke';
import { useGeneralStore, usePkgStore, usePrfStore } from '../stores';
import { Dirs } from '../types';
const pkg = usePkgStore();
const prf = usePrfStore();
const general = useGeneralStore();
pkg.setupListeners();
const currentTab = ref('3');
const isProfileDisabled = computed(() => prf.current === null);
onMounted(async () => {
invoke('list_directories').then((d) => {
general.dirs = d as Dirs;
});
await prf.reloadList();
await prf.reload();
if (prf.current !== null) {
await pkg.reloadAll();
currentTab.value = '0';
}
});
</script>
<template>
<main>
<Tabs lazy :value="currentTab" class="h-screen">
<div class="fixed w-full flex z-100">
<TabList class="grow">
<Tab :disabled="isProfileDisabled" value="0"
><div class="pi pi-list-check"></div
></Tab>
<Tab :disabled="isProfileDisabled" value="1"
><div class="pi pi-download"></div
></Tab>
<Tab :disabled="isProfileDisabled" value="2"
><div class="pi pi-cog"></div
></Tab>
<Tab value="3"
><div class="pi pi-question-circle"></div
></Tab>
<div class="grow"></div>
<StartButton />
</TabList>
</div>
<TabPanels class="w-full grow mt-[3rem]">
<TabPanel value="0">
<ModList />
</TabPanel>
<TabPanel value="1">
<ModStore />
</TabPanel>
<TabPanel value="2">
<OptionList />
</TabPanel>
<TabPanel value="3">
<strong>UNDER CONSTRUCTION</strong><br />Some features are
missing.<br />Existing features are expected to break any
time.
<ProfileList />
<img
v-if="prf.current?.game === 'ongeki'"
src="/sticker-ongeki.svg"
class="fixed bottom-0 right-0"
/>
<img
v-else-if="prf.current?.game === 'chunithm'"
src="/sticker-chunithm.svg"
class="fixed bottom-0 right-0"
/>
<br /><br /><br />
<footer
style="
position: fixed;
left: 0px;
bottom: 0px;
height: 40px;
width: 100%;
"
>
<Button
style="margin-left: 6px"
icon="pi pi-discord"
as="a"
target="_blank"
href="https://discord.gg/jxvzHjjEmc"
/>
</footer>
</TabPanel>
</TabPanels>
</Tabs>
</main>
</template>
<style lang="css">
@import 'tailwindcss';
.p-tablist-tab-list {
height: 3rem;
}
html,
body {
margin: 0;
padding: 0;
}
</style>