xyyd-fatfox/src/App.vue

57 lines
1.8 KiB
Vue
Raw Normal View History

2024-09-09 17:53:07 +08:00
<script setup lang="ts">
import useSettingsStore from './settings/useSettingsStore'
import Header from './layout/header'
import Background from './layout/background'
import GLobalModal from './GlobalModal'
import SettingsButton from './settings/SettingsButton'
import SettingsOverlay from './settings/SettingsOverlay'
2024-09-11 13:46:40 +08:00
import Sider from './layout/sider'
2024-09-25 14:25:44 +08:00
import Dock from './layout/dock'
2024-09-11 13:46:40 +08:00
import LoginModal from './user/LoginModal'
2024-09-09 17:53:07 +08:00
import { computed } from 'vue'
2024-09-11 16:03:17 +08:00
import asyncLoader from './utils/asyncLoader'
import useLayoutStore from './layout/useLayoutStore'
const Grid = asyncLoader(() => import('./layout/grid'))
2024-09-13 18:27:39 +08:00
const Fox = asyncLoader(() => import('./fox'))
2024-09-09 17:53:07 +08:00
const settings = useSettingsStore()
const blockSize = computed(() => settings.state.blockSize + 'rem')
const blockPadding = computed(() => settings.state.blockPadding + 'rem')
const mainWidth = computed(() => settings.state.mainWidth + '%')
2024-09-11 16:03:17 +08:00
const blockRadius = computed(() => settings.state.blockRadius)
const layout = useLayoutStore()
2024-09-09 17:53:07 +08:00
</script>
<template>
<div class="fixed left-0 top-0 w-full h-screen style-root" @contextmenu.prevent>
<Header />
<Background />
<GLobalModal />
<SettingsOverlay />
<SettingsButton />
2024-09-11 13:46:40 +08:00
<Sider />
<LoginModal />
2024-09-11 16:03:17 +08:00
<Grid v-if="layout.ready" />
2024-09-25 14:25:44 +08:00
<Dock />
2024-09-13 18:27:39 +08:00
<div class="fixed z-40 right-[14%] top-8">
<Fox />
</div>
2024-09-09 17:53:07 +08:00
</div>
</template>
<style lang="less">
.style-root {
--block-size: 5.2rem;
--block-padding: 1rem;
--main-width: 95%;
--block-radius: 0.2;
// 以下是响应式设计, 绑定 settings 中的尺寸
@media screen and (min-width: 68px) {
/* 768px 之上,尺寸可以独自设计 */
--block-size: v-bind(blockSize);
--block-padding: v-bind(blockPadding);
--main-width: v-bind(mainWidth);
--block-radius: v-bind(blockRadius);
}
}
</style>