Profectus-Niffix/src/App.vue

54 lines
1.5 KiB
Vue
Raw Normal View History

2021-05-19 22:21:51 +00:00
<template>
<div id="modal-root" :style="theme" />
2022-03-27 05:49:04 +00:00
<div class="app" :style="theme" :class="{ useHeader }">
<Nav v-if="useHeader" />
2022-01-14 04:25:47 +00:00
<Game />
<TPS v-if="unref(showTPS)" />
<GameOverScreen />
<NaNScreen />
2022-03-20 04:59:52 +00:00
<component :is="gameComponent" />
</div>
2021-05-19 22:21:51 +00:00
</template>
2022-03-20 04:59:52 +00:00
<script setup lang="tsx">
import { jsx } from "features/feature";
import { coerceComponent, render } from "util/vue";
import { computed, toRef, unref } from "vue";
2022-02-27 22:04:56 +00:00
import Game from "./components/Game.vue";
import GameOverScreen from "./components/GameOverScreen.vue";
import NaNScreen from "./components/NaNScreen.vue";
import Nav from "./components/Nav.vue";
import TPS from "./components/TPS.vue";
import projInfo from "./data/projInfo.json";
import themes from "./data/themes";
2022-03-20 04:59:52 +00:00
import settings, { gameComponents } from "./game/settings";
import "./main.css";
import "@fontsource/roboto-mono";
import type { CSSProperties } from "vue";
const useHeader = projInfo.useHeader;
const theme = computed(() => themes[settings.theme].variables as CSSProperties);
2022-01-14 04:25:47 +00:00
const showTPS = toRef(settings, "showTPS");
2022-03-20 04:59:52 +00:00
const gameComponent = computed(() => {
return coerceComponent(jsx(() => (<>{gameComponents.map(render)}</>)));
2022-03-20 04:59:52 +00:00
});
2021-05-19 22:21:51 +00:00
</script>
2021-06-12 04:38:16 +00:00
<style scoped>
2021-07-24 22:08:52 +00:00
.app {
background-color: var(--background);
2021-09-04 21:51:41 +00:00
color: var(--foreground);
display: flex;
flex-flow: column;
min-height: 100%;
height: 100%;
2021-07-24 22:08:52 +00:00
}
#modal-root {
position: absolute;
min-height: 100%;
height: 100%;
}
2021-05-19 22:21:51 +00:00
</style>