feat: 实现 Mini Game AI 工具平台

基于 Next.js 15、React 19 和 TypeScript 构建面向小游戏开发者的 AI 赋能工具平台。

主要功能:
- 首页:包含 Hero、功能展示、优势介绍、定价和 CTA 区域
- 三大核心工具:视频转序列帧、图片压缩、音频压缩
- 响应式布局:包含顶部导航、页脚和侧边栏
- 文件上传:支持拖拽上传,使用 react-dropzone
- 进度追踪:实时显示上传和处理进度
- 可配置工具:每个工具都支持自定义参数配置
- 结果预览:支持下载处理后的文件
- 4K 优化:针对大屏幕优化的响应式设计
- API 路由:文件上传和处理的模拟实现

技术栈:
- Next.js 15 (App Router)
- React 19
- TypeScript (严格模式)
- Tailwind CSS(自定义 4K 断点)
- shadcn/ui 组件库
- Framer Motion 动画
- Zustand 状态管理

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-20 22:26:55 +08:00
parent 9529a684a1
commit a7449bf49b
40 changed files with 10963 additions and 0 deletions

View File

@@ -0,0 +1,146 @@
import Link from "next/link";
import { Sparkles, Github, Twitter } from "lucide-react";
const footerLinks = {
product: [
{ name: "Features", href: "/features" },
{ name: "Pricing", href: "/pricing" },
{ name: "API", href: "/api" },
{ name: "Documentation", href: "/docs" },
],
tools: [
{ name: "Video to Frames", href: "/tools/video-frames" },
{ name: "Image Compression", href: "/tools/image-compress" },
{ name: "Audio Compression", href: "/tools/audio-compress" },
{ name: "AI Tools", href: "/tools/ai-tools" },
],
company: [
{ name: "About", href: "/about" },
{ name: "Blog", href: "/blog" },
{ name: "Careers", href: "/careers" },
{ name: "Contact", href: "/contact" },
],
legal: [
{ name: "Privacy", href: "/privacy" },
{ name: "Terms", href: "/terms" },
{ name: "Cookie Policy", href: "/cookies" },
],
};
const socialLinks = [
{ name: "Twitter", icon: Twitter, href: "https://twitter.com" },
{ name: "GitHub", icon: Github, href: "https://github.com" },
];
export function Footer() {
return (
<footer className="border-t border-border/40 bg-background/50">
<div className="container py-12 md:py-16">
<div className="grid grid-cols-2 gap-8 md:grid-cols-6">
{/* Brand */}
<div className="col-span-2">
<Link href="/" className="flex items-center space-x-2">
<div className="flex h-8 w-8 items-center justify-center rounded-lg bg-primary">
<Sparkles className="h-5 w-5 text-primary-foreground" />
</div>
<span className="text-xl font-bold">Mini Game AI</span>
</Link>
<p className="mt-4 text-sm text-muted-foreground">
AI-powered tools for mini game developers. Process media files with ease.
</p>
</div>
{/* Product */}
<div>
<h3 className="mb-4 text-sm font-semibold">Product</h3>
<ul className="space-y-3 text-sm">
{footerLinks.product.map((link) => (
<li key={link.name}>
<Link
href={link.href}
className="text-muted-foreground transition-colors hover:text-foreground"
>
{link.name}
</Link>
</li>
))}
</ul>
</div>
{/* Tools */}
<div>
<h3 className="mb-4 text-sm font-semibold">Tools</h3>
<ul className="space-y-3 text-sm">
{footerLinks.tools.map((link) => (
<li key={link.name}>
<Link
href={link.href}
className="text-muted-foreground transition-colors hover:text-foreground"
>
{link.name}
</Link>
</li>
))}
</ul>
</div>
{/* Company */}
<div>
<h3 className="mb-4 text-sm font-semibold">Company</h3>
<ul className="space-y-3 text-sm">
{footerLinks.company.map((link) => (
<li key={link.name}>
<Link
href={link.href}
className="text-muted-foreground transition-colors hover:text-foreground"
>
{link.name}
</Link>
</li>
))}
</ul>
</div>
{/* Legal */}
<div>
<h3 className="mb-4 text-sm font-semibold">Legal</h3>
<ul className="space-y-3 text-sm">
{footerLinks.legal.map((link) => (
<li key={link.name}>
<Link
href={link.href}
className="text-muted-foreground transition-colors hover:text-foreground"
>
{link.name}
</Link>
</li>
))}
</ul>
</div>
</div>
{/* Bottom section */}
<div className="mt-12 flex flex-col items-center justify-between border-t border-border/40 pt-8 md:flex-row">
<p className="text-sm text-muted-foreground">
© {new Date().getFullYear()} Mini Game AI. All rights reserved.
</p>
<div className="mt-4 flex space-x-6 md:mt-0">
{socialLinks.map((link) => {
const Icon = link.icon;
return (
<Link
key={link.name}
href={link.href}
className="text-muted-foreground transition-colors hover:text-foreground"
aria-label={link.name}
>
<Icon className="h-5 w-5" />
</Link>
);
})}
</div>
</div>
</div>
</footer>
);
}

View File

@@ -0,0 +1,111 @@
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { useState } from "react";
import { motion, AnimatePresence } from "framer-motion";
import { Menu, X, Sparkles } from "lucide-react";
import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";
const navItems = [
{ name: "Tools", href: "/tools" },
{ name: "Pricing", href: "/pricing" },
{ name: "Docs", href: "/docs" },
{ name: "About", href: "/about" },
];
export function Header() {
const pathname = usePathname();
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
return (
<header className="sticky top-0 z-50 w-full border-b border-border/40 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
<nav className="container flex h-16 items-center justify-between">
{/* Logo */}
<Link href="/" className="flex items-center space-x-2">
<div className="flex h-8 w-8 items-center justify-center rounded-lg bg-primary">
<Sparkles className="h-5 w-5 text-primary-foreground" />
</div>
<span className="text-xl font-bold">Mini Game AI</span>
</Link>
{/* Desktop Navigation */}
<div className="hidden md:flex md:items-center md:space-x-6">
{navItems.map((item) => (
<Link
key={item.name}
href={item.href}
className={cn(
"text-sm font-medium transition-colors hover:text-primary",
pathname === item.href ? "text-primary" : "text-muted-foreground"
)}
>
{item.name}
</Link>
))}
</div>
{/* CTA Buttons */}
<div className="hidden md:flex md:items-center md:space-x-4">
<Button variant="ghost" size="sm" asChild>
<Link href="/login">Sign In</Link>
</Button>
<Button size="sm" asChild>
<Link href="/register">Get Started</Link>
</Button>
</div>
{/* Mobile Menu Button */}
<button
className="md:hidden"
onClick={() => setIsMobileMenuOpen(!isMobileMenuOpen)}
aria-label="Toggle menu"
>
{isMobileMenuOpen ? (
<X className="h-6 w-6" />
) : (
<Menu className="h-6 w-6" />
)}
</button>
</nav>
{/* Mobile Menu */}
<AnimatePresence>
{isMobileMenuOpen && (
<motion.div
initial={{ opacity: 0, height: 0 }}
animate={{ opacity: 1, height: "auto" }}
exit={{ opacity: 0, height: 0 }}
transition={{ duration: 0.2 }}
className="md:hidden border-t border-border/40"
>
<div className="container space-y-4 py-6">
{navItems.map((item) => (
<Link
key={item.name}
href={item.href}
onClick={() => setIsMobileMenuOpen(false)}
className={cn(
"block text-sm font-medium transition-colors hover:text-primary",
pathname === item.href ? "text-primary" : "text-muted-foreground"
)}
>
{item.name}
</Link>
))}
<div className="flex flex-col space-y-2 pt-4">
<Button variant="ghost" size="sm" asChild className="w-full">
<Link href="/login">Sign In</Link>
</Button>
<Button size="sm" asChild className="w-full">
<Link href="/register">Get Started</Link>
</Button>
</div>
</div>
</motion.div>
)}
</AnimatePresence>
</header>
);
}

View File

@@ -0,0 +1,105 @@
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { motion } from "framer-motion";
import {
Video,
Image,
Music,
Sparkles,
LayoutDashboard,
CreditCard,
Settings,
} from "lucide-react";
import { cn } from "@/lib/utils";
const sidebarNavItems = [
{
title: "Dashboard",
items: [
{ name: "Overview", href: "/dashboard", icon: LayoutDashboard },
],
},
{
title: "Tools",
items: [
{ name: "Video to Frames", href: "/tools/video-frames", icon: Video },
{ name: "Image Compression", href: "/tools/image-compress", icon: Image },
{ name: "Audio Compression", href: "/tools/audio-compress", icon: Music },
],
},
{
title: "AI Tools",
items: [
{ name: "AI Image", href: "/tools/ai-image", icon: Sparkles },
{ name: "AI Audio", href: "/tools/ai-audio", icon: Sparkles },
],
},
{
title: "Account",
items: [
{ name: "Pricing", href: "/pricing", icon: CreditCard },
{ name: "Settings", href: "/settings", icon: Settings },
],
},
];
interface SidebarProps {
className?: string;
}
export function Sidebar({ className }: SidebarProps) {
const pathname = usePathname();
return (
<aside
className={cn(
"fixed left-0 top-16 z-40 h-[calc(100vh-4rem)] w-64 border-r border-border/40 bg-background/95 backdrop-blur",
className
)}
>
<div className="h-full overflow-y-auto py-6 pr-4">
<nav className="space-y-8 px-4">
{sidebarNavItems.map((section) => (
<div key={section.title}>
<h3 className="mb-4 px-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground">
{section.title}
</h3>
<ul className="space-y-1">
{section.items.map((item) => {
const Icon = item.icon;
const isActive = pathname === item.href || pathname?.startsWith(item.href + "/");
return (
<li key={item.name}>
<Link
href={item.href}
className={cn(
"group flex items-center rounded-lg px-3 py-2 text-sm font-medium transition-all",
isActive
? "bg-primary/10 text-primary"
: "text-muted-foreground hover:bg-accent hover:text-accent-foreground"
)}
>
<Icon className={cn("mr-3 h-4 w-4", isActive ? "text-primary" : "")} />
<span className="flex-1">{item.name}</span>
{isActive && (
<motion.div
layoutId="activeIndicator"
className="h-4 w-1 rounded-full bg-primary"
transition={{ type: "spring", stiffness: 300, damping: 30 }}
/>
)}
</Link>
</li>
);
})}
</ul>
</div>
))}
</nav>
</div>
</aside>
);
}