Skip to content

Commit d634d5e

Browse files
authored
feat(footer): 新增友情链接 (#23)
- MAA - MaaFramework - 终末地一图流 - Mirror酱 ## Summary by Sourcery 在主视觉区域新增“友情链接”入口和常量配置,用于展示外部合作伙伴站点。 New Features: - 在主视觉区域新增友情链接下拉菜单,列出带有图标和外链的外部合作伙伴站点。 Enhancements: - 优化主视觉布局,将镜像下载按钮与新的友情链接入口并排展示。 - 在常量中添加友情链接的集中配置,便于统一管理外部合作伙伴站点。 <details> <summary>Original summary in English</summary> ## Summary by Sourcery Add a friend links entry point and constants to display external partner sites from the hero section. New Features: - Introduce a friend links dropdown in the hero area that lists external partner sites with icons and outbound links. Enhancements: - Refine the hero layout to place the mirror download button alongside the new friend links entry point. - Add centralized configuration for friend links in constants for easier management of external partner sites. </details>
1 parent 33c765a commit d634d5e

8 files changed

Lines changed: 99 additions & 4 deletions

File tree

app/components/Footer.tsx

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import { motion } from "framer-motion";
44
import { useTranslation } from "react-i18next";
5-
import { GITHUB_URLS, QQ_GROUPS } from "../constants";
5+
import Image from "next/image";
6+
import { FRIEND_LINKS, GITHUB_URLS, QQ_GROUPS } from "../constants";
67

78
export default function Footer() {
89
const { t } = useTranslation();
@@ -34,8 +35,8 @@ export default function Footer() {
3435
</motion.div>
3536
</div>
3637

37-
<div className="container mx-auto grid grid-cols-1 gap-12 px-6 md:grid-cols-4">
38-
<div className="col-span-2">
38+
<div className="container mx-auto grid grid-cols-1 gap-12 px-6 md:grid-cols-6">
39+
<div className="col-span-1 md:col-span-2">
3940
<h3 className="font-heading mb-4 text-2xl text-black dark:text-white">
4041
MaaEnd
4142
</h3>
@@ -101,6 +102,34 @@ export default function Footer() {
101102
</li>
102103
</ul>
103104
</div>
105+
<div className="col-span-1 md:col-span-2">
106+
<h4 className="mb-4 font-mono text-black dark:text-white">
107+
{t("footer.friendLinks")}
108+
</h4>
109+
<ul className="flex flex-wrap gap-x-4 gap-y-2 text-sm text-black/80 dark:text-white/70">
110+
{FRIEND_LINKS.map((friend) => (
111+
<li key={friend.id} className="w-40">
112+
<a
113+
href={friend.href}
114+
target="_blank"
115+
rel="noopener noreferrer"
116+
className="group flex items-center gap-2 transition-colors hover:text-[#c49102] dark:hover:text-[#FFE600]"
117+
>
118+
<span className="rounded-sm border border-black/10 bg-white/90 p-1.5 dark:border-white/15 dark:bg-white/10">
119+
<Image
120+
src={friend.iconSrc}
121+
alt={friend.iconAlt}
122+
width={24}
123+
height={24}
124+
className="h-6 w-6 object-contain"
125+
/>
126+
</span>
127+
<span className="min-w-0 truncate">{friend.name}</span>
128+
</a>
129+
</li>
130+
))}
131+
</ul>
132+
</div>
104133
</div>
105134

106135
<div className="mt-20 text-center font-mono text-xs text-black/30 dark:text-white/20">

app/constants.ts

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,57 @@ export const QQ_GROUPS = {
1717
DEV_GROUP: "1072587329",
1818
DEV_GROUP_LINK: "https://qm.qq.com/q/EyirQpBiW4",
1919
} as const;
20+
21+
export interface FriendLink {
22+
id: string;
23+
name: string;
24+
href: string;
25+
iconSrc: string;
26+
iconAlt: string;
27+
}
28+
29+
// 友情链接:图标来自 public/friend
30+
export const FRIEND_LINKS: FriendLink[] = [
31+
{
32+
id: "MAA",
33+
name: "MAA",
34+
href: "https://maa.plus/",
35+
iconSrc: "/friend/maa.png",
36+
iconAlt: "MAA",
37+
},
38+
{
39+
id: "MaaFramework",
40+
name: "MaaFramework",
41+
href: "https://maafw.com/",
42+
iconSrc: "/friend/maa.png",
43+
iconAlt: "MAA",
44+
},
45+
{
46+
id: "ef-yituliu",
47+
name: "终末地一图流",
48+
href: "https://www.yituliu.cn/",
49+
iconSrc: "/friend/ef-yituliu.png",
50+
iconAlt: "终末地一图流",
51+
},
52+
{
53+
id: "mirrorchyan",
54+
name: "Mirror酱",
55+
href: "https://mirrorchyan.com/zh/projects?rid=MaaEnd&os=windows&arch=x64&channel=stable",
56+
iconSrc: "/friend/mirrorchyan.png",
57+
iconAlt: "Mirror酱",
58+
},
59+
{
60+
id: "endfield-terminal",
61+
name: "终末地-协议终端",
62+
href: "https://end.shallow.ink",
63+
iconSrc: "https://end.shallow.ink/icon.svg",
64+
iconAlt: "终末地-协议终端",
65+
},
66+
{
67+
id: "zmd-map",
68+
name: "终末地地图站",
69+
href: "https://www.zmdmap.com/",
70+
iconSrc: "https://assets.zmdmap.com/logo.png",
71+
iconAlt: "终末地地图站",
72+
},
73+
];

locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
"userGroup": "User QQ Group",
9393
"devGroup": "Dev QQ Group",
9494
"project": "PROJECT",
95+
"friendLinks": "Friendly Links",
9596
"github": "GitHub",
9697
"releases": "Releases",
9798
"issues": "Issues",

locales/zh.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
"userGroup": "用户 QQ 群",
9393
"devGroup": "开发 QQ 群",
9494
"project": "PROJECT",
95+
"friendLinks": "友情链接",
9596
"github": "源码",
9697
"releases": "发行版",
9798
"issues": "问题反馈",

next.config.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
import type { NextConfig } from "next";
22

33
const nextConfig: NextConfig = {
4-
output: 'export',
4+
output: "export",
55
images: {
66
unoptimized: true,
7+
remotePatterns: [
8+
{
9+
protocol: "https",
10+
hostname: "end.shallow.ink",
11+
},
12+
{
13+
protocol: "https",
14+
hostname: "assets.zmdmap.com",
15+
},
16+
],
717
},
818
trailingSlash: true,
919
};

public/friend/ef-yituliu.png

4.37 KB
Loading

public/friend/maa.png

9.77 KB
Loading

public/friend/mirrorchyan.png

8.03 KB
Loading

0 commit comments

Comments
 (0)