Files
oh-my-opencode/packages/web/components/landing/sections/hero.tsx
T
YeonGyu-Kim 4d5f58f0c3 refactor(web): decompose 832-LOC landing into 10 section components
app/_components/landing-page.tsx: 832 LOC -> 33-LOC composition shell.
Each section becomes a focused, named component under
components/landing/sections/:

- hero.tsx: terminal headline + install command + primary CTA
- ultrawork.tsx: ultrawork mode pitch
- sisyphus.tsx: Sisyphus orchestrator showcase
- prometheus-atlas.tsx: planner + executor pair (was amber+indigo,
  now violet — single secondary accent)
- hephaestus.tsx: code surgeon (was orange, now cyan)
- team-mode.tsx: parallel team coordination (was fuchsia/purple/cyan
  gradient, now solid cyan headline + violet skills accent)
- sub-agents.tsx: explore/librarian/oracle/multimodal etc.
- architecture.tsx: 4-tier diagram
- reviews.tsx: testimonials (Star kept text-cyan-500 / fill-cyan-500,
  on-brand)
- cta.tsx: final call-to-action

components/landing/constants.ts (new):
- SUB_AGENT_KEYS, AGENT_STYLES, PRINCIPLE_KEYS, PRINCIPLE_ICONS,
  REVIEW_KEYS, CATEGORY_ROUTING, SKILL_INJECTIONS
- Single source of truth for agent/principle/review metadata used
  across sections

components/icons/github-icon.tsx (new):
- Extracted inline SVG into a typed component with default
  aria-hidden and overridable size/className

Color consolidation: 9-color rainbow per-section -> cyan (primary)
+ violet (secondary, agent identity) + neutral grays + status colors
only. 'Evolution not revolution': dark + cyan brand soul intact.
2026-05-20 14:27:02 +09:00

102 lines
3.5 KiB
TypeScript

import type { JSX } from "react"
import { getTranslations } from "next-intl/server"
import { getStats, formatStats } from "@/lib/stats"
import { HeroStats } from "@/components/landing/hero-stats"
import { InstallCommand } from "@/components/landing/install-command"
import { Button } from "@/components/ui/button"
import { Link } from "@/i18n/routing"
import { GithubIcon } from "@/components/icons/github-icon"
const FALLBACK_STATS = {
stars: "40k+",
totalDownloads: "1M+",
monthlyDownloads: "580k+",
weeklyDownloads: "90k+",
}
export async function HeroSection(): Promise<JSX.Element> {
const t = await getTranslations("landing")
let formattedStats = FALLBACK_STATS
try {
const stats = await getStats()
formattedStats = formatStats(stats)
} catch {
formattedStats = FALLBACK_STATS
}
return (
<section
data-section="hero"
className="relative flex min-h-[100dvh] items-center justify-center overflow-hidden pt-16"
>
<div
aria-hidden="true"
className="hero-bg absolute inset-0 z-0 bg-cover bg-center"
style={{ backgroundImage: "url(/images/hero.webp)" }}
/>
<div className="absolute inset-0 z-0 bg-gradient-to-b from-black/80 via-black/90 to-[#0a0a0a]" />
<div className="reveal-on-enter relative z-10 container mx-auto flex flex-col items-center gap-8 px-4 text-center md:px-6">
<div className="space-y-4">
<h1 className="text-5xl font-bold tracking-tighter text-white md:text-7xl">
{t("hero.title")}
<span className="text-cyan-400">{t("hero.titleHighlight")}</span>
</h1>
<p className="mx-auto max-w-3xl text-xl font-light text-zinc-400 md:text-2xl">
{t("hero.subtitle", {
stars: formattedStats.stars,
downloads: formattedStats.totalDownloads,
})}
</p>
</div>
<HeroStats
initialStats={{
stars: formattedStats.stars,
totalDownloads: formattedStats.totalDownloads,
monthlyDownloads: formattedStats.monthlyDownloads,
weeklyDownloads: formattedStats.weeklyDownloads,
}}
labels={{
githubStars: t("hero.githubStars", { count: "{count}" }),
specializedAgents: t("hero.specializedAgents", { count: "11" }),
totalDownloads: t("hero.totalDownloads", { count: "{count}" }),
monthlyDownloads: t("hero.monthlyDownloads", { count: "{count}" }),
lifecycleHooks: t("hero.lifecycleHooks", { count: "54+" }),
}}
/>
<div className="w-full max-w-md">
<InstallCommand command={t("hero.installCommand")} />
</div>
<div className="flex flex-col gap-4 sm:flex-row">
<Link href="/docs">
<Button
size="lg"
className="h-12 bg-cyan-500 px-8 text-lg font-bold text-black shadow-sm hover:bg-cyan-600"
>
{t("hero.getStarted")}
</Button>
</Link>
<Link
href="https://github.com/code-yeongyu/oh-my-openagent"
target="_blank"
rel="noopener noreferrer"
>
<Button
size="lg"
variant="outline"
className="h-12 border-zinc-700 px-8 text-lg text-white hover:bg-zinc-800"
>
<GithubIcon className="mr-2 h-5 w-5" />
{t("hero.viewOnGitHub")}
</Button>
</Link>
</div>
</div>
</section>
)
}