feat: add MorePage component with app icons and styles for enhanced user experience
This commit is contained in:
1 parent
e69931bb41
commit
4c5352a3e2
5 files changed
+240
-1
No files matched your search
@@ -2,8 +2,15 @@ import Banner from "./components/Banner";
|
||||
import AboutSection from "./components/sections/AboutSection";
|
||||
import ProjectsSection from "./components/sections/ProjectsSection";
|
||||
import ContactSection from "./components/sections/ContactSection";
|
||||
import MorePage from "./pages/MorePage";
|
||||
|
||||
export default function App() {
|
||||
const { pathname } = window.location;
|
||||
|
||||
if (pathname === "/more" || pathname === "/more/") {
|
||||
return <MorePage />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="bg-black">
|
||||
<Banner />
|
||||
|
||||
@@ -31,7 +31,7 @@ export const NAV_ITEMS: NavItem[] = [
|
||||
{
|
||||
name: "More",
|
||||
desc: "更多工具与服务",
|
||||
path: "https://xiaozhou233.cn/more",
|
||||
path: "/more",
|
||||
Icon: ListCollapse,
|
||||
color: "text-cyan-400",
|
||||
borderHover:
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
import { useEffect } from "react";
|
||||
import "./more.css";
|
||||
|
||||
const appIcons = {
|
||||
water: <path d="M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z" />,
|
||||
atom: (
|
||||
<>
|
||||
<circle cx="12" cy="12" r="1" />
|
||||
<path d="M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z" />
|
||||
<path d="M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z" />
|
||||
</>
|
||||
),
|
||||
};
|
||||
|
||||
const apps = [
|
||||
{ name: "水质监测面板", desc: "实时掌握水质状况", color: "#06b6d4", link: "/water-admin", icon: appIcons.water },
|
||||
{ name: "力的课题", desc: "认识三种基本的力", color: "#ef4444", link: "/forces.html", icon: appIcons.atom },
|
||||
];
|
||||
|
||||
export default function MorePage() {
|
||||
useEffect(() => {
|
||||
document.title = "更多应用";
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="more-page">
|
||||
<div className="more-page-inner">
|
||||
<header className="more-banner">
|
||||
<h1 className="more-banner-title">更多应用</h1>
|
||||
<p className="more-banner-subtitle">一个入口,汇聚所有工具</p>
|
||||
<a className="more-home-link" href="/">
|
||||
返回主站
|
||||
</a>
|
||||
</header>
|
||||
|
||||
<main className="more-app-grid">
|
||||
{apps.map((app) => (
|
||||
<a key={app.name} className="more-app-card" href={app.link}>
|
||||
<span
|
||||
className="more-app-icon"
|
||||
style={{ background: `linear-gradient(135deg, ${app.color}, ${app.color}cc)` }}
|
||||
>
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
aria-hidden="true"
|
||||
>
|
||||
{app.icon}
|
||||
</svg>
|
||||
</span>
|
||||
<div className="more-app-info">
|
||||
<h2 className="more-app-name">{app.name}</h2>
|
||||
<p className="more-app-desc">{app.desc}</p>
|
||||
</div>
|
||||
</a>
|
||||
))}
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
.more-page {
|
||||
position: relative;
|
||||
min-height: 100svh;
|
||||
box-sizing: border-box;
|
||||
color: #94a3b8;
|
||||
font-family: system-ui, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
|
||||
}
|
||||
|
||||
.more-page::before {
|
||||
content: "";
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: -1;
|
||||
background: linear-gradient(rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.6)),
|
||||
url("/banner.jpg") center / cover no-repeat, #0f172a;
|
||||
}
|
||||
|
||||
.more-page *,
|
||||
.more-page *::before,
|
||||
.more-page *::after {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
.more-page-inner {
|
||||
max-width: 1120px;
|
||||
margin: 0 auto;
|
||||
padding: 0 24px 64px;
|
||||
}
|
||||
|
||||
.more-banner {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
padding: 88px 24px;
|
||||
margin: 32px 0 48px;
|
||||
border-radius: 20px;
|
||||
background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.more-home-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-top: 24px;
|
||||
padding: 8px 16px;
|
||||
border-radius: 999px;
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border: 1px solid rgba(255, 255, 255, 0.14);
|
||||
color: #e2e8f0;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
text-decoration: none;
|
||||
transition:
|
||||
background 0.2s ease,
|
||||
border-color 0.2s ease;
|
||||
}
|
||||
|
||||
.more-home-link:hover {
|
||||
background: rgba(255, 255, 255, 0.16);
|
||||
border-color: rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
|
||||
.more-banner-title {
|
||||
font-size: 48px;
|
||||
font-weight: 700;
|
||||
letter-spacing: -1px;
|
||||
margin: 0 0 12px;
|
||||
color: #f1f5f9;
|
||||
}
|
||||
|
||||
.more-banner-subtitle {
|
||||
font-size: 18px;
|
||||
margin: 0;
|
||||
color: #94a3b8;
|
||||
}
|
||||
|
||||
.more-app-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.more-app-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
padding: 20px;
|
||||
border-radius: 16px;
|
||||
background: #1e293b;
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
text-decoration: none;
|
||||
transition:
|
||||
transform 0.25s ease,
|
||||
box-shadow 0.25s ease,
|
||||
border-color 0.25s ease;
|
||||
}
|
||||
|
||||
.more-app-card:hover {
|
||||
transform: translateY(-4px);
|
||||
border-color: rgba(255, 255, 255, 0.14);
|
||||
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.more-app-icon {
|
||||
flex-shrink: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 14px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.more-app-icon svg {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
.more-app-info {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.more-app-name {
|
||||
font-size: 17px;
|
||||
font-weight: 600;
|
||||
margin: 0 0 4px;
|
||||
color: #f1f5f9;
|
||||
}
|
||||
|
||||
.more-app-desc {
|
||||
font-size: 13px;
|
||||
margin: 0;
|
||||
color: #94a3b8;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
.more-banner {
|
||||
padding: 64px 20px;
|
||||
}
|
||||
|
||||
.more-app-grid {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.more-banner {
|
||||
padding: 48px 16px;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.more-banner-title {
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.more-app-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.more-app-desc {
|
||||
white-space: normal;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user