Files
webgame-frontend/src/layouts/BaseLayout.vue
T

160 lines
3.3 KiB
Vue
Raw Normal View History

2026-06-17 11:48:43 +08:00
<template>
<div class="base-layout">
<!-- 顶部导航栏 -->
2026-06-18 10:37:13 +08:00
<div class="base-layout__topbar">
<div class="base-layout__topbar-title">
<span class="base-layout__topbar-game-icon">{{ activeGameIcon }}</span>
<span class="base-layout__topbar-game-name">{{ activeGameName }}</span>
</div>
</div>
2026-06-17 11:48:43 +08:00
<!-- 主体区域 -->
<div class="base-layout__main">
<!-- 侧边栏 -->
<div class="base-layout__sidebar">
<!-- 侧边栏内容 -->
2026-06-18 10:15:13 +08:00
<div class="base-layout__sidebar-content">
<GameList />
</div>
2026-06-17 11:48:43 +08:00
<!-- 侧边栏底部固定区域 -->
<div class="base-layout__sidebar-bottom">
2026-06-17 14:36:02 +08:00
<div class="base-layout__sidebar-bottom-inner">
<UserBar />
</div>
2026-06-17 11:48:43 +08:00
</div>
<!-- 拖拽调整宽度的手柄 -->
<div class="base-layout__resize-handle"></div>
</div>
<!-- 主内容区域 -->
<div class="base-layout__content"></div>
</div>
</div>
</template>
2026-06-17 14:36:02 +08:00
<script setup lang="ts">
2026-06-18 10:15:13 +08:00
import UserBar from '@/components/baseLayouts/UserBar.vue'
import GameList from '@/components/baseLayouts/GameList.vue'
2026-06-18 10:37:13 +08:00
import { useBaseLayoutStore } from '@/stores'
import { storeToRefs } from 'pinia'
const baseLayoutStore = useBaseLayoutStore()
const { activeGameIcon, activeGameName } = storeToRefs(baseLayoutStore)
2026-06-17 14:36:02 +08:00
</script>
2026-06-17 11:48:43 +08:00
<style scoped lang="scss">
.base-layout {
display: flex;
flex-direction: column;
height: 100lvh;
width: 100lvw;
overflow: hidden;
}
.base-layout__topbar {
display: flex;
2026-06-18 10:37:13 +08:00
align-items: center;
justify-content: center;
2026-06-17 11:48:43 +08:00
width: 100%;
2026-06-18 09:19:23 +08:00
height: 30px;
2026-06-18 10:37:13 +08:00
padding: 0 12px;
2026-06-18 11:01:11 +08:00
background-color: var(--bg-topbar);
border-bottom: 1px solid var(--border-default);
2026-06-17 11:48:43 +08:00
}
2026-06-18 10:37:13 +08:00
.base-layout__topbar-title {
display: flex;
align-items: baseline;
gap: 6px;
height: 30px;
}
.base-layout__topbar-game-icon {
display: flex;
align-items: center;
font-size: 16px;
line-height: 1;
height: 100%;
}
.base-layout__topbar-game-name {
display: flex;
align-items: center;
font-size: 13px;
font-weight: 500;
line-height: 1;
height: 100%;
2026-06-18 11:01:11 +08:00
color: var(--text-primary);
2026-06-18 10:37:13 +08:00
}
2026-06-17 11:48:43 +08:00
.base-layout__main {
display: flex;
flex: 1;
width: 100%;
height: 100%;
}
.base-layout__sidebar {
display: flex;
flex-direction: column;
position: relative;
width: 400px;
height: 100%;
2026-06-18 11:01:11 +08:00
padding: var(--space-sm);
background-color: var(--bg-sidebar);
border-right: 1px solid var(--border-default);
2026-06-17 11:48:43 +08:00
}
.base-layout__sidebar-content {
display: flex;
flex-direction: column;
height: 100%;
width: 100%;
padding-bottom: 72px;
}
.base-layout__sidebar-bottom {
position: absolute;
display: flex;
flex-shrink: 0;
width: 100%;
height: 72px;
left: 0;
bottom: 0;
2026-06-18 11:01:11 +08:00
padding: var(--space-sm);
2026-06-17 11:48:43 +08:00
}
.base-layout__sidebar-bottom-inner {
display: flex;
flex: 1;
width: 100%;
height: 100%;
2026-06-18 11:01:11 +08:00
border-radius: var(--radius-md);
background-color: var(--bg-surface);
box-shadow: var(--shadow-sm);
border: 1px solid var(--border-light);
2026-06-17 11:48:43 +08:00
}
.base-layout__resize-handle {
position: absolute;
width: 4px;
height: 100%;
top: 0;
right: 0;
cursor: ew-resize;
2026-06-18 11:01:11 +08:00
transition: background-color 0.2s ease;
2026-06-17 11:48:43 +08:00
&:hover {
2026-06-18 11:01:11 +08:00
background-color: var(--border-default);
2026-06-17 11:48:43 +08:00
}
}
.base-layout__content {
display: flex;
flex: 1;
width: 100%;
height: 100%;
2026-06-18 11:01:11 +08:00
background-color: var(--bg-body);
2026-06-17 11:48:43 +08:00
}
</style>