Skip to content

Commit 5e99794

Browse files
committed
v 1.009 更新UI界面
1 parent 9864006 commit 5e99794

4 files changed

Lines changed: 99 additions & 15 deletions

File tree

frontend/package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"preview": "vite preview"
1010
},
1111
"dependencies": {
12+
"@element-plus/icons-vue": "^2.3.2",
1213
"dompurify": "^3.3.3",
1314
"marked": "^17.0.5",
1415
"vue": "^3.5.30",

frontend/src/assets/blog.css

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,15 +1781,44 @@ body {
17811781
.site-brand {
17821782
color: var(--text);
17831783
text-decoration: none;
1784-
font-size: 18px;
1785-
font-weight: 500;
1784+
font-size: clamp(16px, 1.2vw, 18px);
1785+
font-weight: 750;
17861786
letter-spacing: -0.01em;
1787+
line-height: 1.2;
1788+
white-space: nowrap;
1789+
display: inline-flex;
1790+
align-items: center;
1791+
gap: 10px;
1792+
}
1793+
1794+
.site-brand-logo {
1795+
width: 22px;
1796+
height: 22px;
1797+
display: inline-flex;
1798+
align-items: center;
1799+
justify-content: center;
1800+
flex-shrink: 0;
1801+
color: var(--accent);
1802+
}
1803+
1804+
[data-theme='dark'] .site-brand-logo {
1805+
color: #e8e8ea;
1806+
}
1807+
1808+
.site-brand-logo svg {
1809+
width: 100%;
1810+
height: 100%;
1811+
display: block;
1812+
}
1813+
1814+
.site-brand-text {
1815+
display: inline-block;
17871816
}
17881817

17891818
.site-nav {
17901819
display: inline-flex;
17911820
align-items: center;
1792-
gap: 18px;
1821+
gap: 22px;
17931822
}
17941823

17951824
.site-nav-link {
@@ -1805,6 +1834,26 @@ body {
18051834
appearance: none;
18061835
-webkit-appearance: none;
18071836
line-height: 1.2;
1837+
display: inline-flex;
1838+
align-items: center;
1839+
gap: 8px;
1840+
white-space: nowrap;
1841+
}
1842+
1843+
.site-nav-ico {
1844+
display: inline-flex;
1845+
align-items: center;
1846+
justify-content: center;
1847+
width: 16px;
1848+
height: 16px;
1849+
color: currentColor;
1850+
flex-shrink: 0;
1851+
opacity: 0.95;
1852+
}
1853+
1854+
.site-nav-ico svg {
1855+
width: 16px;
1856+
height: 16px;
18081857
}
18091858

18101859
.site-nav-link:hover {
@@ -1837,13 +1886,6 @@ body {
18371886
gap: 8px;
18381887
}
18391888

1840-
.site-nav-widgets-ico {
1841-
font-size: 14px;
1842-
line-height: 1;
1843-
transform: translateY(-0.5px);
1844-
opacity: 0.9;
1845-
}
1846-
18471889
@media (max-width: 520px) {
18481890
.site-nav-widgets-text {
18491891
display: none;

frontend/src/components/BlogHeader.vue

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
<template>
22
<header class="site-top-bar" role="banner">
33
<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>
520

621
<nav class="site-nav" aria-label="主导航">
722
<button
@@ -11,12 +26,21 @@
1126
aria-label="打开个人信息侧栏"
1227
title="个人信息"
1328
>
14-
<span class="site-nav-widgets-ico" aria-hidden="true"></span>
29+
<span class="site-nav-ico" aria-hidden="true"><Menu /></span>
1530
<span class="site-nav-widgets-text">个人</span>
1631
</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>
2044
<div ref="dropdownRoot" class="site-nav-dropdown">
2145
<button
2246
type="button"
@@ -25,6 +49,7 @@
2549
aria-haspopup="menu"
2650
@click.stop="toggleDropdown"
2751
>
52+
<span class="site-nav-ico" aria-hidden="true"><MagicStick /></span>
2853
AI实验室 <span class="site-nav-dropdown-caret" aria-hidden="true">▾</span>
2954
</button>
3055

@@ -47,9 +72,14 @@
4772
target="_blank"
4873
rel="noopener noreferrer"
4974
>
75+
<span class="site-nav-ico" aria-hidden="true"><Link /></span>
5076
源码
5177
</a>
5278
<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>
5383
{{ isDark ? '浅色' : '深色' }}
5484
</button>
5585
</nav>
@@ -61,6 +91,7 @@
6191
import { onBeforeUnmount, onMounted, ref } from 'vue'
6292
import { useRoute } from 'vue-router'
6393
import { toggleTheme as applyToggle } from '../theme'
94+
import { House, InfoFilled, Link, MagicStick, Menu, Moon, Notebook, Sunny } from '@element-plus/icons-vue'
6495
6596
const isDark = ref(false)
6697
const route = useRoute()

0 commit comments

Comments
 (0)