Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
195 changes: 104 additions & 91 deletions app/components/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ export default function Hero() {
const response = await fetch(
"https://api.github.com/repos/MaaEnd/MaaEnd/releases/latest"
);
if (!response.ok) throw new Error("Failed to fetch release info");
if (!response.ok) {
console.error("Failed to fetch release info");
return;
}
const data: ReleaseInfo = await response.json();
setReleaseInfo(data);

Expand Down Expand Up @@ -252,7 +255,7 @@ export default function Hero() {
return (
<section
ref={containerRef}
className="bg-background relative flex min-h-screen flex-col justify-center overflow-hidden px-4 pt-24 transition-colors duration-300 md:px-16 md:pt-20"
className="bg-background relative flex min-h-screen flex-col justify-start overflow-hidden px-4 pt-32 transition-colors duration-300 md:px-16 md:pt-28"
>
{/* Industrial Background Layer */}
<BackgroundLayer />
Expand Down Expand Up @@ -298,7 +301,7 @@ export default function Hero() {
</motion.div>

<div className="text-left text-[2.5rem] leading-[0.9] tracking-tighter select-none sm:text-[3rem] md:text-[3rem] lg:text-[5rem]">
<span className="block bg-gradient-to-r from-[#d4a017] via-[#c49102] to-black bg-clip-text text-transparent dark:from-[#FFD000] dark:via-[#FFD000] dark:to-white">
<span className="block bg-linear-to-r from-[#d4a017] via-[#c49102] to-black bg-clip-text text-transparent dark:from-[#FFD000] dark:via-[#FFD000] dark:to-white">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): bg-linear-to-r 类名看起来像是拼写错误,很可能会破坏渐变效果。

bg-linear-to-r 不是标准的 Tailwind 类名(内置的渐变工具类是 bg-gradient-to-r),因此除非你添加了对应的自定义工具类,否则这会让 hero 标题上的渐变效果失效。如果这不是你在 Tailwind 配置中刻意为之,建议改回 bg-gradient-to-r

Original comment in English

issue (bug_risk): The bg-linear-to-r class name looks like a typo and likely breaks the gradient.

bg-linear-to-r isn’t a standard Tailwind class (the built‑in gradient utility is bg-gradient-to-r), so this will drop the gradient on the hero title unless you’ve added a matching custom utility. If this wasn’t intentional in your Tailwind config, please switch back to bg-gradient-to-r.

{t("hero.title")}
</span>
<span className="hidden text-black md:block dark:text-white">
Expand Down Expand Up @@ -346,95 +349,105 @@ export default function Hero() {
initial={{ opacity: 0, x: -20 }}
animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: -20 }}
className="flex flex-wrap items-center justify-center gap-3 md:justify-start"
className="flex flex-col gap-3 md:flex-row md:items-center"
>
{/* 主下载按钮 - 自动检测系统 */}
<Button
variant="primary"
className="group relative h-16 overflow-hidden border-none bg-[#fef901] pr-10 pl-8 text-xl font-bold tracking-wide text-black hover:bg-[#fef901] dark:bg-[#FFD000] dark:hover:bg-[#E6CF00]"
style={{
clipPath:
"polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px)",
}}
onClick={() => {
// 移动设备不支持下载,点击无效
if (currentPlatform === "mobile") return;
if (currentDownload) {
window.open(currentDownload.url, "_blank");
}
}}
disabled={loading || !currentDownload}
>
<span className="relative z-10 flex items-center gap-3">
{loading ? (
<>
<Loader2 size={20} className="animate-spin" />
{t("hero.loading")}
</>
) : currentPlatform === "mobile" ? (
<>
<Monitor size={20} className="shrink-0" />
<span className="flex flex-col items-start gap-0.5 text-left text-base leading-tight">
<span>{t("hero.desktopOnlyLine1")}</span>
<span>{t("hero.desktopOnlyLine2")}</span>
</span>
</>
) : currentDownload ? (
<>
<PlatformIcon
platform={currentDownload.platform}
className="h-5 w-5"
/>
{t("hero.downloadFor")}{" "}
{getPlatformDisplayName(currentDownload.platform)}{" "}
{getArchDisplayName(currentDownload.arch)}
<ArrowRight size={20} strokeWidth={3} />
</>
) : (
<>
{t("hero.initCore")}
<ArrowRight size={20} strokeWidth={3} />
</>
)}
</span>
{/* Warning Stripes on Hover */}
<div className="absolute inset-0 bg-[repeating-linear-gradient(45deg,transparent,transparent_10px,#00000010_10px,#00000010_20px)] opacity-0 transition-opacity duration-300 group-hover:opacity-100" />
</Button>

{/* 更多下载选项按钮 */}
<Button
variant="outline"
className="group relative h-16 w-16 overflow-hidden border-2 border-[#d4a017] bg-transparent p-0 hover:bg-[#d4a017]/10 dark:border-[#FFD000] dark:hover:bg-[#FFD000]/10"
style={{
clipPath:
"polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px)",
}}
onClick={() => setShowDownloadOptions(true)}
disabled={loading}
>
<ChevronDown
size={24}
className="text-[#d4a017] dark:text-[#FFD000]"
/>
</Button>

<Button
variant="outline"
className="group relative h-16 max-w-[320px] overflow-hidden border-2 border-[#008fa6]/60 bg-transparent px-5 text-left text-sm leading-tight font-semibold tracking-normal text-[#008fa6] normal-case hover:border-[#008fa6] hover:bg-[#008fa6]/10 dark:border-[#00F0FF]/60 dark:text-[#00F0FF] dark:hover:border-[#00F0FF] dark:hover:bg-[#00F0FF]/10"
style={{
clipPath:
"polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px)",
}}
onClick={() => window.open(mirrorDownloadUrl, "_blank")}
>
<span className="flex w-full flex-col items-start gap-1">
<span>{t("hero.mirrorDownloadLine1")}</span>
<span className="flex items-center gap-2">
{t("hero.mirrorDownloadLine2")}
<ArrowRight size={16} strokeWidth={2.5} />
{/* 第一行:主下载 + 展示全部 */}
<div className="flex items-center gap-3">
{/* 主下载按钮 - 自动检测系统 */}
<div className="relative flex-1 border-2 border-dashed border-[#d4a017]/50 p-[2px] md:flex-none dark:border-[#FFD000]/50">
<Button
variant="primary"
className="group relative h-16 w-full overflow-hidden border-none bg-[#fef901] pr-10 pl-8 text-xl font-bold tracking-wide text-black hover:bg-[#fef901] dark:bg-[#FFD000] dark:hover:bg-[#E6CF00]"
style={{
clipPath:
"polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px)",
}}
onClick={() => {
// 移动设备不支持下载,点击无效
if (currentPlatform === "mobile") return;
if (currentDownload) {
window.open(currentDownload.url, "_blank");
}
}}
disabled={loading || !currentDownload}
>
<span className="relative z-10 flex items-center gap-3">
{loading ? (
<>
<Loader2 size={20} className="animate-spin" />
{t("hero.loading")}
</>
) : currentPlatform === "mobile" ? (
<>
<Monitor size={20} className="shrink-0" />
<span className="flex flex-col items-start gap-0.5 text-left text-base leading-tight">
<span>{t("hero.desktopOnlyLine1")}</span>
<span>{t("hero.desktopOnlyLine2")}</span>
</span>
</>
) : currentDownload ? (
<>
<PlatformIcon
platform={currentDownload.platform}
className="h-5 w-5"
/>
{t("hero.downloadFor")}{" "}
{getPlatformDisplayName(currentDownload.platform)}{" "}
{getArchDisplayName(currentDownload.arch)}
<ArrowRight size={20} strokeWidth={3} />
</>
) : (
<>
{t("hero.initCore")}
<ArrowRight size={20} strokeWidth={3} />
</>
)}
</span>
{/* Warning Stripes on Hover */}
<div className="absolute inset-0 bg-[repeating-linear-gradient(45deg,transparent,transparent_10px,#00000010_10px,#00000010_20px)] opacity-0 transition-opacity duration-300 group-hover:opacity-100" />
</Button>
</div>

{/* 更多下载选项按钮 */}
<div className="relative shrink-0 border-2 border-dashed border-[#d4a017]/50 p-[2px] dark:border-[#FFD000]/50">
<Button
variant="outline"
className="group relative h-16 w-16 overflow-hidden border-none bg-transparent p-0 hover:bg-[#d4a017]/10 dark:hover:bg-[#FFD000]/10"
style={{
clipPath:
"polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px)",
}}
onClick={() => setShowDownloadOptions(true)}
disabled={loading}
>
<ChevronDown
size={24}
className="text-[#d4a017] dark:text-[#FFD000]"
/>
</Button>
</div>
</div>

{/* 第二行:Mirror酱 */}
<div className="relative w-full border-2 border-dashed border-[#008fa6]/40 p-[2px] md:w-auto md:max-w-[320px] dark:border-[#00F0FF]/40">
<Button
variant="outline"
className="group relative h-16 w-full overflow-hidden border-none bg-transparent px-5 text-left text-sm leading-tight font-semibold tracking-normal text-[#008fa6] normal-case hover:bg-[#008fa6]/10 dark:text-[#00F0FF] dark:hover:bg-[#00F0FF]/10"
style={{
clipPath:
"polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px)",
}}
onClick={() => window.open(mirrorDownloadUrl, "_blank")}
>
<span className="flex w-full flex-col items-start gap-1">
<span>{t("hero.mirrorDownloadLine1")}</span>
<span className="flex items-center gap-2">
{t("hero.mirrorDownloadLine2")}
<ArrowRight size={16} strokeWidth={2.5} />
</span>
</span>
</span>
</Button>
</Button>
</div>
</motion.div>
) : (
<motion.div
Expand Down Expand Up @@ -509,7 +522,7 @@ export default function Hero() {
</div>

{/* Right: Interactive Particle Model */}
<div className="pointer-events-auto relative col-span-1 hidden h-[500px] lg:col-span-5 lg:block lg:h-[700px]">
<div className="pointer-events-auto relative col-span-1 hidden h-[550px] lg:col-span-5 lg:block lg:h-[750px]">
<InteractiveModelOptimized />
</div>
</div>
Expand Down
Loading
Loading