|
1 | 1 | <template> |
2 | 2 | <header class="site-top-bar" role="banner"> |
3 | 3 | <div class="site-top-bar-inner"> |
4 | | - <router-link class="site-brand" to="/">烧仙草冰室</router-link> |
| 4 | + <router-link class="site-brand" to="/" aria-label="烧仙草冰室,返回首页"> |
| 5 | + <span class="site-brand-logo" aria-hidden="true"> |
| 6 | + <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"> |
| 7 | + <!-- cup --> |
| 8 | + <path d="M7 6h10l-1.2 14.2a2 2 0 0 1-2 1.8H10.2a2 2 0 0 1-2-1.8L7 6z" /> |
| 9 | + <!-- rim --> |
| 10 | + <path d="M6.2 6h11.6" /> |
| 11 | + <!-- ice cubes --> |
| 12 | + <path d="M10 9.2h2.6v2.6H10z" /> |
| 13 | + <path d="M13.6 10.6h2.6v2.6h-2.6z" /> |
| 14 | + <!-- grass jelly layer --> |
| 15 | + <path d="M9.2 15.2c1.1-.8 2.4-.8 3.5 0s2.4.8 3.5 0" /> |
| 16 | + </svg> |
| 17 | + </span> |
| 18 | + <span class="site-brand-text">烧仙草冰室</span> |
| 19 | + </router-link> |
5 | 20 |
|
6 | 21 | <nav class="site-nav" aria-label="主导航"> |
7 | 22 | <button |
|
11 | 26 | aria-label="打开个人信息侧栏" |
12 | 27 | title="个人信息" |
13 | 28 | > |
14 | | - <span class="site-nav-widgets-ico" aria-hidden="true">☰</span> |
| 29 | + <span class="site-nav-ico" aria-hidden="true"><Menu /></span> |
15 | 30 | <span class="site-nav-widgets-text">个人</span> |
16 | 31 | </button> |
17 | | - <router-link class="site-nav-link" to="/" :class="{ active: isActive('/') }">首页</router-link> |
18 | | - <router-link class="site-nav-link" to="/all" :class="{ active: isActive('/all') }">博客</router-link> |
19 | | - <router-link class="site-nav-link" to="/about" :class="{ active: isActive('/about') }">关于</router-link> |
| 32 | + <router-link class="site-nav-link" to="/" :class="{ active: isActive('/') }"> |
| 33 | + <span class="site-nav-ico" aria-hidden="true"><House /></span> |
| 34 | + 首页 |
| 35 | + </router-link> |
| 36 | + <router-link class="site-nav-link" to="/all" :class="{ active: isActive('/all') }"> |
| 37 | + <span class="site-nav-ico" aria-hidden="true"><Notebook /></span> |
| 38 | + 博客 |
| 39 | + </router-link> |
| 40 | + <router-link class="site-nav-link" to="/about" :class="{ active: isActive('/about') }"> |
| 41 | + <span class="site-nav-ico" aria-hidden="true"><InfoFilled /></span> |
| 42 | + 关于 |
| 43 | + </router-link> |
20 | 44 | <div ref="dropdownRoot" class="site-nav-dropdown"> |
21 | 45 | <button |
22 | 46 | type="button" |
|
25 | 49 | aria-haspopup="menu" |
26 | 50 | @click.stop="toggleDropdown" |
27 | 51 | > |
| 52 | + <span class="site-nav-ico" aria-hidden="true"><MagicStick /></span> |
28 | 53 | AI实验室 <span class="site-nav-dropdown-caret" aria-hidden="true">▾</span> |
29 | 54 | </button> |
30 | 55 |
|
|
47 | 72 | target="_blank" |
48 | 73 | rel="noopener noreferrer" |
49 | 74 | > |
| 75 | + <span class="site-nav-ico" aria-hidden="true"><Link /></span> |
50 | 76 | 源码 |
51 | 77 | </a> |
52 | 78 | <button type="button" class="site-nav-link site-nav-link-btn" @click="onToggle"> |
| 79 | + <span class="site-nav-ico" aria-hidden="true"> |
| 80 | + <Sunny v-if="isDark" /> |
| 81 | + <Moon v-else /> |
| 82 | + </span> |
53 | 83 | {{ isDark ? '浅色' : '深色' }} |
54 | 84 | </button> |
55 | 85 | </nav> |
|
61 | 91 | import { onBeforeUnmount, onMounted, ref } from 'vue' |
62 | 92 | import { useRoute } from 'vue-router' |
63 | 93 | import { toggleTheme as applyToggle } from '../theme' |
| 94 | +import { House, InfoFilled, Link, MagicStick, Menu, Moon, Notebook, Sunny } from '@element-plus/icons-vue' |
64 | 95 |
|
65 | 96 | const isDark = ref(false) |
66 | 97 | const route = useRoute() |
|
0 commit comments