Skip to content

Commit 8a8fd67

Browse files
author
CodeJudge
committed
feat: 分享按钮 + Footer + 图标优化
1 parent 38c3534 commit 8a8fd67

5 files changed

Lines changed: 37 additions & 1 deletion

File tree

frontend/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<head>
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<link rel="alternate icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>⚡</text></svg>" />
67
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
78
<title>CodeJudge - 在线评测系统</title>
89
<link rel="preconnect" href="https://fonts.googleapis.com" />

frontend/src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import AdminProblemForm from './pages/AdminProblemForm';
1111
import Leaderboard from './pages/Leaderboard';
1212
import NotFound from './pages/NotFound';
1313
import Profile from './pages/Profile';
14+
import Footer from './components/Footer';
1415

1516
export default function App() {
1617
return (
@@ -31,6 +32,7 @@ export default function App() {
3132
<Route path="/leaderboard" element={<Leaderboard />} />
3233
<Route path="*" element={<NotFound />} />
3334
</Routes>
35+
<Footer />
3436
</main>
3537
</div>
3638
);

frontend/src/components/Footer.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Github, Heart } from 'lucide-react';
2+
3+
export default function Footer() {
4+
return (
5+
<footer className="border-t border-dark-800 mt-16 py-8">
6+
<div className="max-w-7xl mx-auto px-4 text-center">
7+
<div className="flex items-center justify-center gap-6 text-dark-400 text-sm mb-2">
8+
<a href="https://github.com/anyncfunction/codejudge" target="_blank" rel="noopener noreferrer" className="flex items-center gap-1.5 hover:text-white transition-colors">
9+
<Github className="w-4 h-4" />
10+
GitHub
11+
</a>
12+
<span className="flex items-center gap-1">
13+
Made with <Heart className="w-3.5 h-3.5 text-red-400" /> by CodeJudge
14+
</span>
15+
</div>
16+
<p className="text-dark-500 text-xs">
17+
&copy; {new Date().getFullYear()} CodeJudge - 在线评测系统
18+
</p>
19+
</div>
20+
</footer>
21+
);
22+
}

frontend/src/pages/ProblemDetail.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
CheckCircle,
77
AlertTriangle,
88
Loader2,
9+
Share2,
910
Star,
1011
} from 'lucide-react';
1112
import toast from 'react-hot-toast';
@@ -381,6 +382,16 @@ export default function ProblemDetail() {
381382
}`}
382383
/>
383384
</button>
385+
<button
386+
onClick={() => {
387+
navigator.clipboard.writeText(window.location.href);
388+
toast.success('链接已复制');
389+
}}
390+
className="p-1 rounded-md hover:bg-dark-700 transition-colors"
391+
title="分享"
392+
>
393+
<Share2 className="w-5 h-5 text-dark-500 hover:text-white transition-colors" />
394+
</button>
384395
<h1 className="text-2xl font-bold text-white">
385396
{problem.title}
386397
</h1>

frontend/tsconfig.tsbuildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"root":["./src/app.tsx","./src/main.tsx","./src/components/choicequestion.tsx","./src/components/codeeditor.tsx","./src/components/fillblankquestion.tsx","./src/components/markdownrenderer.tsx","./src/components/navbar.tsx","./src/components/problemcard.tsx","./src/components/submissionstatus.tsx","./src/context/authcontext.tsx","./src/context/bookmarkcontext.tsx","./src/pages/admin.tsx","./src/pages/adminproblemform.tsx","./src/pages/home.tsx","./src/pages/leaderboard.tsx","./src/pages/login.tsx","./src/pages/notfound.tsx","./src/pages/problemdetail.tsx","./src/pages/problems.tsx","./src/pages/profile.tsx","./src/pages/register.tsx","./src/pages/submissions.tsx","./src/services/api.ts","./src/types/index.ts"],"version":"5.9.3"}
1+
{"root":["./src/app.tsx","./src/main.tsx","./src/components/choicequestion.tsx","./src/components/codeeditor.tsx","./src/components/fillblankquestion.tsx","./src/components/footer.tsx","./src/components/markdownrenderer.tsx","./src/components/navbar.tsx","./src/components/problemcard.tsx","./src/components/submissionstatus.tsx","./src/context/authcontext.tsx","./src/context/bookmarkcontext.tsx","./src/pages/admin.tsx","./src/pages/adminproblemform.tsx","./src/pages/home.tsx","./src/pages/leaderboard.tsx","./src/pages/login.tsx","./src/pages/notfound.tsx","./src/pages/problemdetail.tsx","./src/pages/problems.tsx","./src/pages/profile.tsx","./src/pages/register.tsx","./src/pages/submissions.tsx","./src/services/api.ts","./src/types/index.ts"],"version":"5.9.3"}

0 commit comments

Comments
 (0)