Feat: 更新 UI 细节

页眉样式修改,增加社交媒体按钮
调整卡片内间距和整体宽度
修复手机版文章卡片插图展示异常
This commit is contained in:
2026-05-20 19:01:12 +08:00
parent 13a09d6995
commit 7d0ac45e8a
9 changed files with 45 additions and 18 deletions
+24 -5
View File
@@ -1,4 +1,6 @@
import { NavLink } from "react-router";
import { Feed, GitHub, QQ } from "../ui/icons";
import { clsn } from "~/utils";
const navItems = [
{ name: "首页", to: "/" },
@@ -7,23 +9,40 @@ const navItems = [
{ name: "关于我", to: "/about" },
];
const inheritCls = "inline-block py-2 px-5";
const activeCls = "inline-block py-2 px-5 bg-orange-200 text-pink-400 rounded-xl";
const inheritCls = "hover:text-pink-400";
const activeCls = "bg-pink-300 text-white rounded-xl hover:border-pink-400 border-b-pink-400";
function Header() {
return (
<header className="fixed top-0 left-0 right-0 bg-pink-400 text-white z-10">
<nav className="py-3 px-2">
<header className="fixed top-0 left-0 right-0 bg-orange-50 z-10 flex justify-between items-center px-2 md:px-6 py-4">
<nav>
{navItems.map((item) => (
<NavLink
key={item.name}
to={item.to}
className={({ isActive }) => isActive ? activeCls : inheritCls}
className={({ isActive }) =>
clsn(
"inline-block font-semibold py-2 px-4",
"border-4 border-transparent transition-colors",
isActive ? activeCls : inheritCls
)
}
>
{item.name}
</NavLink>
))}
</nav>
<nav className="flex items-center gap-2 [&>a]:hover:text-pink-400 [&>a]:transition-colors">
<a href="https://paul.ren/join-group" target="_blank" rel="noreferrer" title="企鹅群">
<QQ className="w-5" />
</a>
<a href="https://github.com/Dreamer-Paul" target="_blank" rel="noreferrer" title="GitHub">
<GitHub className="w-5" />
</a>
<a href="https://paul.ren/feed" target="_blank" title="订阅 RSS">
<Feed className="w-5" />
</a>
</nav>
</header>
);
}