blob: 97bf4537325911cb5e73ed8aac18c7ec63f18a6b [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 animeTypes = [
25 "华语动漫(大陆)",
26 "欧美动漫",
27 "日韩动漫",
28 "港台动漫",
29 "其他"
30];
31
32const areaTabs = [
ssq5067cb92025-06-05 11:44:23 +000033 { label: "大陆", icon: <EmojiPeopleIcon fontSize="small" /> },
34 { label: "港台", icon: <EmailIcon fontSize="small" /> },
35 { label: "欧美", icon: <PersonIcon fontSize="small" /> },
36 { label: "日韩", icon: <EmojiPeopleIcon fontSize="small" /> },
37 { label: "其他", icon: <PersonIcon fontSize="small" /> },
956303669a32fc2c2025-06-02 19:45:53 +080038];
39
40export default function AnimePage() {
41 const navigate = useNavigate();
42 const [activeTab, setActiveTab] = React.useState(0);
43
44 // 每个tab对应的动漫类型
45 const animeTypesList = [
46 ["华语动漫(大陆)", "欧美动漫", "日韩动漫", "港台动漫", "其他"], // 大陆
47 ["港台热血", "港台搞笑", "港台其他"], // 港台
48 ["欧美冒险", "欧美科幻", "欧美其他"], // 欧美
49 ["日韩热血", "日韩恋爱", "日韩其他"], // 日韩
50 ["其他类型1", "其他类型2"] // 其他
51 ];
52 const animeTypes = animeTypesList[activeTab] || [];
53
54 return (
55 <div className="container">
56 {/* 顶部空白与音乐界面一致,用户栏绝对定位在页面右上角 */}
57 <div style={{ height: 80 }} />
58 <div className="user-bar" style={{ position: 'fixed', top: 18, right: 42, zIndex: 100, display: 'flex', alignItems: 'center', background: '#e0f3ff', borderRadius: 12, padding: '6px 18px', boxShadow: '0 2px 8px #b2d8ea', minWidth: 320, minHeight: 48, width: 420 }}>
59 <div style={{ cursor: 'pointer', marginRight: 16 }} onClick={() => navigate('/user')}>
60 <AccountCircleIcon style={{ fontSize: 38, color: '#1a237e', background: '#e0f3ff', borderRadius: '50%' }} />
61 </div>
62 <div style={{ color: '#222', fontWeight: 500, marginRight: 24 }}>用户栏</div>
63 <div style={{ display: 'flex', gap: 28, flex: 1, justifyContent: 'flex-end', alignItems: 'center' }}>
64 <span style={{ color: '#1976d2', fontWeight: 500 }}>魔力值: <b>12345</b></span>
65 <span style={{ color: '#1976d2', fontWeight: 500 }}>分享率: <b>2.56</b></span>
66 <span style={{ color: '#1976d2', fontWeight: 500 }}>上传量: <b>100GB</b></span>
67 <span style={{ color: '#1976d2', fontWeight: 500 }}>下载量: <b>50GB</b></span>
68 </div>
69 </div>
70 {/* 下方内容整体下移,留出与音乐界面一致的间距 */}
71 <div style={{ height: 32 }} />
72 <nav className="nav-bar">
73 {navItems.map((item) => (
74 <div
75 key={item.label}
76 className={item.label === "动漫" ? "nav-item active" : "nav-item"}
77 onClick={() => navigate(item.path)}
78 >
79 {item.icon}
80 <span>{item.label}</span>
81 </div>
82 ))}
83 </nav>
84 <div className="search-section card">
85 <input className="search-input" placeholder="输入搜索关键词" />
86 <button className="search-btn">
87 <span role="img" aria-label="search">🔍</span>
88 </button>
89 </div>
90 <div className="area-tabs" style={{ display: 'flex', justifyContent: 'center', gap: 24, margin: '18px 0' }}>
91 {areaTabs.map((tab, idx) => (
92 <div
93 key={tab.label}
94 className={activeTab === idx ? "area-tab active" : "area-tab"}
95 onClick={() => setActiveTab(idx)}
96 >
97 {tab.icon} <span>{tab.label}</span>
98 </div>
99 ))}
100 </div>
101 <div className="table-section">
9563036699e95ae32025-06-02 21:42:11 +0800102 <table className="anime-table">
956303669a32fc2c2025-06-02 19:45:53 +0800103 <thead>
104 <tr>
105 <th>动漫类型</th>
106 <th>标题</th>
107 <th>发布者</th>
108 </tr>
109 </thead>
110 <tbody>
ssq5067cb92025-06-05 11:44:23 +0000111 {animeTypes.map((type, index) => (
112 <tr key={type}>
113 <td>
114 <a href={`/torrent/${type}`} style={{ color: '#1a237e', textDecoration: 'none' }}>
115 {type}
116 </a>
117 </td>
118 <td>
119 <a href={`/torrent/${type}`} style={{ color: '#1a237e', textDecoration: 'none' }}>
120 种子{index + 1}
121 </a>
122 </td>
123 <td>发布者{index + 1}</td>
124 </tr>
125 ))}
956303669a32fc2c2025-06-02 19:45:53 +0800126 </tbody>
127 </table>
128 </div>
129 <div style={{ height: 32 }} />
130 <Pagination />
131 </div>
132 );
133}
134
135function Pagination() {
136 const [page, setPage] = React.useState(3);
137 const total = 5;
138 return (
139 <div className="pagination">
140 <button onClick={() => setPage(p => Math.max(1, p - 1))} disabled={page === 1}>上一页</button>
141 <span className="page-num">{page}/{total}</span>
142 <button onClick={() => setPage(p => Math.min(total, p + 1))} disabled={page === total}>下一页</button>
143 <span className="page-info">第 <b>{page}</b> 页</span>
144 </div>
145 );
146}