HumanBreak/src/App.vue

98 lines
2.0 KiB
Vue
Raw Normal View History

2022-11-13 18:02:05 +08:00
<template>
2024-01-19 22:09:48 +08:00
<div id="ui">
2023-10-29 22:13:37 +08:00
<div id="ui-main">
<div id="ui-list">
2023-11-16 22:50:13 +08:00
<div class="ui-one" v-for="(ui, index) of mainUi.stack">
2023-11-05 10:54:26 +08:00
<component
2023-11-16 22:50:13 +08:00
v-if="show(index)"
2023-11-05 10:54:26 +08:00
:is="ui.ui.component"
v-on="ui.vOn ?? {}"
v-bind="ui.vBind ?? {}"
></component>
2023-10-29 22:13:37 +08:00
</div>
</div>
</div>
<div id="ui-fixed">
<template v-for="ui of fixedUi.stack">
<component
:is="ui.ui.component"
v-on="ui.vOn ?? {}"
v-bind="ui.vBind ?? {}"
></component>
</template>
</div>
2022-11-13 18:02:05 +08:00
</div>
</template>
<script lang="ts" setup>
2023-10-29 22:13:37 +08:00
import { onMounted } from 'vue';
import { mainUi, fixedUi } from './core/main/init/ui';
onMounted(() => {
2024-02-02 17:10:21 +08:00
const { hook } = Mota.requireAll('var');
2023-10-29 22:13:37 +08:00
hook.emit('mounted');
});
2023-11-16 22:50:13 +08:00
function show(index: number) {
if (mainUi.show === 'all') return true;
if (mainUi.show === 'end') return index === mainUi.stack.length - 1;
}
2022-11-13 18:02:05 +08:00
</script>
<style lang="less" scoped>
2022-11-14 17:11:23 +08:00
#ui {
2023-10-29 22:13:37 +08:00
width: 0;
height: 0;
left: 0;
top: 0;
position: fixed;
overflow: visible;
display: block;
2024-01-19 22:09:48 +08:00
font-family: 'normal';
2023-10-29 22:13:37 +08:00
}
#ui-main {
width: 100vw;
height: 100vh;
display: none;
justify-content: center;
2023-11-05 10:54:26 +08:00
align-items: center;
2023-10-29 22:13:37 +08:00
left: 0;
top: 0;
position: fixed;
2023-11-05 10:54:26 +08:00
background-color: #000b;
backdrop-filter: blur(5px);
2023-11-07 19:25:59 +08:00
z-index: 1;
2023-10-29 22:13:37 +08:00
}
#ui-list {
2023-11-07 19:25:59 +08:00
width: 90vw;
height: 90vh;
2023-10-29 22:13:37 +08:00
overflow: hidden;
position: relative;
left: 0;
top: 0;
}
.ui-one {
2023-11-07 19:25:59 +08:00
width: 90vw;
height: 90vh;
2023-10-29 22:13:37 +08:00
position: absolute;
left: 0;
top: 0;
display: flex;
justify-content: center;
}
#ui-fixed {
position: fixed;
width: 0;
height: 0;
overflow: visible;
left: 0;
top: 0;
display: none;
2023-11-07 19:25:59 +08:00
z-index: 0;
2023-10-29 22:13:37 +08:00
}
2022-11-13 18:02:05 +08:00
</style>