blob: 569f0221ac0d5d895b58a6ba46a22aa0be2051a1 [file] [log] [blame]
956303669a32fc2c2025-06-02 19:45:53 +08001import React from "react";
2import MovieIcon from "@mui/icons-material/Movie";
3import EmailIcon from "@mui/icons-material/Email";
4import MusicNoteIcon from "@mui/icons-material/MusicNote";
5import EmojiPeopleIcon from "@mui/icons-material/EmojiPeople";
6import SportsEsportsIcon from "@mui/icons-material/SportsEsports";
7import SportsMartialArtsIcon from "@mui/icons-material/SportsMartialArts";
8import PersonIcon from "@mui/icons-material/Person";
9import AccountCircleIcon from "@mui/icons-material/AccountCircle";
10import "./App.css";
11import { useNavigate } from "react-router-dom";
12
13const navItems = [
14 { label: "电影", icon: <MovieIcon />, path: "/movie" },
15 { label: "剧集", icon: <EmailIcon />, path: "/tv" },
16 { label: "音乐", icon: <MusicNoteIcon />, path: "/music" },
17 { label: "动漫", icon: <EmojiPeopleIcon />, path: "/anime" },
18 { label: "游戏", icon: <SportsEsportsIcon />, path: "/game" },
19 { label: "体育", icon: <SportsMartialArtsIcon />, path: "/sport" },
20 { label: "资料", icon: <PersonIcon />, path: "/info" },
9563036699e95ae32025-06-02 21:42:11 +080021 { label: "发布", icon: <AccountCircleIcon />, path: "/publish" }, // Added Publish option
956303669a32fc2c2025-06-02 19:45:53 +080022];
23
24const sportTypes = [""];
25
26const areaTabs = [
27 { label: "篮球", icon: <MovieIcon fontSize="small" /> },
28 { label: "足球", icon: <EmailIcon fontSize="small" /> },
29 { label: "羽毛球", icon: <EmojiPeopleIcon fontSize="small" /> },
30 { label: "排球", icon: <PersonIcon fontSize="small" /> },
31 { label: "电竞", icon: <PersonIcon fontSize="small" />, active: true },
32];
33
9563036699e95ae32025-06-02 21:42:11 +080034const exampleTorrents = [
35 { type: "Soccer", title: "实例1", id: 1 },
36 { type: "Basketball", title: "实例2", id: 2 },
37 { type: "Tennis", title: "实例3", id: 3 },
38];
39
956303669a32fc2c2025-06-02 19:45:53 +080040export default function SportPage() {
41 const navigate = useNavigate();
42 const [activeTab, setActiveTab] = React.useState(0);
43
44 // 每个tab对应的运动类型
45 const sportTypesList = [
46 ["篮球赛事", "篮球技巧", "篮球明星"], // 篮球
47 ["足球赛事", "足球技巧", "足球明星"], // 足球
48 ["羽毛球赛事", "羽毛球技巧"], // 羽毛球
49 ["排球赛事", "排球技巧"], // 排球
50 ["电竞赛事", "电竞技巧"], // 电竞
51 ];
52 const sportTypes = sportTypesList[activeTab] || [];
53
54 return (
55 <div className="container">
56 {/* 顶部空白与音乐界面一致,用户栏绝对定位在页面右上角 */}
57 <div style={{ height: 80 }} />
58 <div
59 className="user-bar"
60 style={{
61 position: "fixed",
62 top: 18,
63 right: 42,
64 zIndex: 100,
65 display: "flex",
66 alignItems: "center",
67 background: "#e0f3ff",
68 borderRadius: 12,
69 padding: "6px 18px",
70 boxShadow: "0 2px 8px #b2d8ea",
71 minWidth: 320,
72 minHeight: 48,
73 width: 420,
74 }}
75 >
76 <div
77 style={{ cursor: "pointer", marginRight: 16 }}
78 onClick={() => navigate("/user")}
79 >
80 <AccountCircleIcon
81 style={{
82 fontSize: 38,
83 color: "#1a237e",
84 background: "#e0f3ff",
85 borderRadius: "50%",
86 }}
87 />
88 </div>
89 <div style={{ color: "#222", fontWeight: 500, marginRight: 24 }}>
90 用户栏
91 </div>
92 <div
93 style={{
94 display: "flex",
95 gap: 28,
96 flex: 1,
97 justifyContent: "flex-end",
98 alignItems: "center",
99 }}
100 >
101 <span style={{ color: "#1976d2", fontWeight: 500 }}>
102 魔力值: <b>12345</b>
103 </span>
104 <span style={{ color: "#1976d2", fontWeight: 500 }}>
105 分享率: <b>2.56</b>
106 </span>
107 <span style={{ color: "#1976d2", fontWeight: 500 }}>
108 上传量: <b>100GB</b>
109 </span>
110 <span style={{ color: "#1976d2", fontWeight: 500 }}>
111 下载量: <b>50GB</b>
112 </span>
113 </div>
114 </div>
115 {/* 下方内容整体下移,留出与音乐界面一致的间距 */}
116 <div style={{ height: 32 }} />
117 <nav className="nav-bar card">
118 {navItems.map((item) => (
119 <div
120 key={item.label}
121 className={item.label === "体育" ? "nav-item active" : "nav-item"}
122 onClick={() => navigate(item.path)}
123 >
124 {item.icon}
125 <span>{item.label}</span>
126 </div>
127 ))}
128 </nav>
129 <div className="search-section card">
130 <input className="search-input" placeholder="输入搜索关键词" />
131 <button className="search-btn">
132 <span role="img" aria-label="search">
133 🔍
134 </span>
135 </button>
136 </div>
137 <div
138 className="area-tabs"
139 style={{
140 display: "flex",
141 justifyContent: "center",
142 gap: 24,
143 margin: "18px 0",
144 }}
145 >
146 {areaTabs.map((tab, idx) => (
147 <div
148 key={tab.label}
149 className={activeTab === idx ? "area-tab active" : "area-tab"}
150 onClick={() => setActiveTab(idx)}
151 >
152 {tab.icon} <span>{tab.label}</span>
153 </div>
154 ))}
155 </div>
156 <div className="table-section">
9563036699e95ae32025-06-02 21:42:11 +0800157 <table className="sport-table">
956303669a32fc2c2025-06-02 19:45:53 +0800158 <thead>
159 <tr>
9563036699e95ae32025-06-02 21:42:11 +0800160 <th>体育类型</th>
956303669a32fc2c2025-06-02 19:45:53 +0800161 <th>标题</th>
162 <th>发布者</th>
163 </tr>
164 </thead>
165 <tbody>
ssq5067cb92025-06-05 11:44:23 +0000166 {sportTypes.map((type, index) => (
167 <tr key={type}>
168 <td>
169 <a
170 href={`/torrent/${type}`}
171 style={{ color: "#1a237e", textDecoration: "none" }}
172 >
173 {type}
174 </a>
175 </td>
176 <td>
177 <a
178 href={`/torrent/${type}`}
179 style={{ color: "#1a237e", textDecoration: "none" }}
180 >
181 种子{index + 1}
182 </a>
183 </td>
184 <td>发布者{index + 1}</td>
185 </tr>
186 ))}
956303669a32fc2c2025-06-02 19:45:53 +0800187 </tbody>
188 </table>
189 </div>
190 <div style={{ height: 32 }} />
191 <Pagination />
192 </div>
193 );
194}
195
196function Pagination() {
197 const [page, setPage] = React.useState(3);
198 const total = 5;
199 return (
200 <div className="pagination">
201 <button
202 onClick={() => setPage((p) => Math.max(1, p - 1))}
203 disabled={page === 1}
204 >
205 上一页
206 </button>
207 <span className="page-num">
208 {page}/{total}
209 </span>
210 <button
211 onClick={() => setPage((p) => Math.min(total, p + 1))}
212 disabled={page === total}
213 >
214 下一页
215 </button>
216 <span className="page-info">
217 <b>{page}</b>
218 </span>
219 </div>
220 );
221}