feat: 添加设置入口并统一背景样式

新增设置菜单入口,将其放在侧边栏底部系统信息区下方
统一背景绘制到 html 元素上,避免元素高度差导致的留白
临时下架背景选项 bg-3,调整侧边栏布局与样式
新增中英文的设置翻译文本,优化系统信息区的间距
This commit is contained in:
Yuhang Wu
2026-10-13 11:38:06 +08:00
parent fd47adea1e
commit 5e48a0bbdd
7 changed files with 110 additions and 78 deletions
+2 -37
View File
@@ -1,6 +1,6 @@
<template>
<!-- 应用整体:背景(渐变 / 图片) + 悬浮面板 -->
<div class="app-shell flex h-screen w-screen flex-col overflow-hidden" :style="shellStyle">
<!-- 应用整体:背景由 <html> 统一绘制,此处只负责布局 -->
<div class="app-shell flex h-full w-full flex-col overflow-hidden">
<!-- 顶部自定义 TitleBar -->
<Header @settings="goToSetting" />
@@ -18,46 +18,11 @@
<script setup lang="ts">
import Header from "./header/Header.vue"
import Aside from "./aside/Aside.vue"
import { useAppStore } from "@/stores/app"
const router = useRouter()
const appStore = useAppStore()
/** 点击标题栏“设置”按钮 → 跳转设置页 */
function goToSetting() {
router.push("/setting")
}
/**
* 选中背景图片时覆盖默认渐变背景。
* `cover` 让图片按原始比例缩放铺满窗口,不会变形拉伸。
*/
const shellStyle = computed(() =>
appStore.backgroundUrl
? {
backgroundImage: `url('${appStore.backgroundUrl}')`,
backgroundSize: "cover",
backgroundPosition: "center",
backgroundRepeat: "no-repeat",
}
: {},
)
</script>
<style scoped lang="scss">
.app-shell {
background-color: #eef2ff;
background-image:
radial-gradient(1200px 600px at 10% -10%, rgba(99, 102, 241, 0.28), transparent 60%),
radial-gradient(1000px 500px at 110% 10%, rgba(34, 211, 238, 0.28), transparent 55%),
linear-gradient(160deg, #eef2ff 0%, #f8fafc 45%, #eef7ff 100%);
}
.dark .app-shell {
background-color: #0b1220;
background-image:
radial-gradient(1200px 600px at 10% -10%, rgba(99, 102, 241, 0.35), transparent 60%),
radial-gradient(1000px 500px at 110% 10%, rgba(14, 165, 233, 0.28), transparent 55%),
linear-gradient(160deg, #0b1220 0%, #0f172a 45%, #111827 100%);
}
</style>