feat: 添加主页组件并设为默认首页

- 新增 HomePage.vue 主页组件 (玻璃态设计风格)
- GlobalSidebar logo 改为可点击跳转主页
- 默认页面从 writer 改为 home
- 新增玻璃态 CSS 变量支持

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
empty
2026-01-12 03:56:40 +08:00
parent 2c664f77d8
commit 4212b63df2
5 changed files with 621 additions and 27 deletions

View File

@@ -1,13 +1,18 @@
<template>
<aside class="sidebar">
<!-- Logo/Home -->
<div class="sidebar-logo" title="AI 写作工坊">
<button
class="sidebar-logo"
:class="{ active: currentPage === 'home' }"
title="主页"
@click="switchPage('home')"
>
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 2L2 7L12 12L22 7L12 2Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M2 17L12 22L22 17" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M2 12L12 17L22 12" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
</button>
<!-- 导航项 -->
<nav class="sidebar-nav">
@@ -99,6 +104,10 @@ const switchPage = (page) => {
margin-bottom: var(--space-8);
color: var(--accent-primary);
transition: all var(--transition-normal);
background: transparent;
border: none;
border-radius: var(--radius-lg);
cursor: pointer;
}
.sidebar-logo:hover {
@@ -106,6 +115,10 @@ const switchPage = (page) => {
transform: scale(1.05);
}
.sidebar-logo.active {
background: var(--info-bg);
}
.sidebar-logo svg {
width: 100%;
height: 100%;