mirror of
https://github.com/stardrophere/InsightRadar.git
synced 2026-06-06 00:57:51 +08:00
界面优化
This commit is contained in:
@@ -19,13 +19,18 @@ const avatarUrl = computed(
|
||||
`https://ui-avatars.com/api/?name=${encodeURIComponent(displayName.value)}&background=6366f1&color=fff`,
|
||||
)
|
||||
|
||||
const navItems = [
|
||||
{ name: '全局热点池', icon: 'fa-solid fa-fire', route: '/' },
|
||||
{ name: '事件追溯分析', icon: 'fa-solid fa-chart-line', route: '/search' },
|
||||
{ name: '公关修改追踪', icon: 'fa-solid fa-mask', route: '/revisions' },
|
||||
{ name: '我的泛订阅', icon: 'fa-solid fa-rss', route: '/topics' },
|
||||
{ name: 'AI 简报设置', icon: 'fa-solid fa-paper-plane', route: '/delivery' },
|
||||
]
|
||||
const navItems = computed(() => {
|
||||
const items = [
|
||||
{ name: '全局热点池', icon: 'fa-solid fa-fire', route: '/' },
|
||||
{ name: '事件追溯分析', icon: 'fa-solid fa-chart-line', route: '/search' },
|
||||
{ name: '公关修改追踪', icon: 'fa-solid fa-mask', route: '/revisions' },
|
||||
]
|
||||
if (authStore.isAuthenticated) {
|
||||
items.push({ name: '我的泛订阅', icon: 'fa-solid fa-rss', route: '/topics' })
|
||||
items.push({ name: 'AI 简报设置', icon: 'fa-solid fa-paper-plane', route: '/delivery' })
|
||||
}
|
||||
return items
|
||||
})
|
||||
|
||||
function isActive(path: string) {
|
||||
return route.path === path
|
||||
@@ -72,7 +77,7 @@ function toggleSidebar() {
|
||||
</div>
|
||||
|
||||
<!-- 用户信息 -->
|
||||
<div class="sidebar-user">
|
||||
<div class="sidebar-user" v-if="authStore.isAuthenticated">
|
||||
<img :src="avatarUrl" class="user-avatar" alt="头像" />
|
||||
<div class="user-info">
|
||||
<p class="user-name">{{ displayName }}</p>
|
||||
@@ -85,6 +90,18 @@ function toggleSidebar() {
|
||||
<i class="fa-solid fa-right-from-bracket"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="sidebar-user guest-user" v-else>
|
||||
<div class="user-info">
|
||||
<p class="user-name">游客,您好</p>
|
||||
<p class="user-status guest">
|
||||
<span class="status-dot gray"></span>
|
||||
未登录
|
||||
</p>
|
||||
</div>
|
||||
<button class="login-btn" title="前往登录" @click="router.push('/login')">
|
||||
<i class="fa-solid fa-arrow-right-to-bracket"></i>
|
||||
</button>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- 主内容区 -->
|
||||
@@ -240,6 +257,10 @@ function toggleSidebar() {
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.user-status.guest {
|
||||
color: var(--text-placeholder);
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
@@ -249,17 +270,25 @@ function toggleSidebar() {
|
||||
animation: pulse-dot 2s infinite;
|
||||
}
|
||||
|
||||
.status-dot.gray {
|
||||
background: var(--text-placeholder);
|
||||
animation: none;
|
||||
}
|
||||
|
||||
@keyframes pulse-dot {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.4; }
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
.logout-btn, .login-btn {
|
||||
color: var(--text-secondary);
|
||||
padding: 8px;
|
||||
border-radius: var(--radius-md);
|
||||
font-size: 14px;
|
||||
transition: all 0.2s;
|
||||
cursor: pointer;
|
||||
background: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.logout-btn:hover {
|
||||
@@ -267,6 +296,11 @@ function toggleSidebar() {
|
||||
background: rgba(239, 68, 68, 0.1);
|
||||
}
|
||||
|
||||
.login-btn:hover {
|
||||
color: var(--brand-primary);
|
||||
background: var(--brand-primary-alpha);
|
||||
}
|
||||
|
||||
/* ==========================================
|
||||
主内容区
|
||||
========================================== */
|
||||
|
||||
Reference in New Issue
Block a user