This commit is contained in:
eric
2026-03-18 02:35:18 -05:00
parent 1f8c9c6d26
commit 538fdfea01
11 changed files with 304 additions and 203 deletions

View File

@@ -1,138 +1,108 @@
"use client";
import Link from "next/link";
import { MapPin, BookOpen, Crown } from "lucide-react";
import { MapPin, Zap, Users, ArrowRight } from "lucide-react";
import { motion } from "framer-motion";
import { HERO_TAGS } from "~/lib/data";
import { Button } from "~/components/ui/button";
import { ENTRY_CARDS } from "~/lib/data";
import { Particles } from "~/components/ui/particles";
const HERO_CARDS = [
{
title: "探索城市",
desc: "找到适合远程生活的地方",
icon: MapPin,
href: "https://meetup.hackrobot.cn",
},
{
title: "学习专题",
desc: "从零搭建你的技能与收入结构",
icon: BookOpen,
href: "https://digital.hackrobot.cn",
},
{
title: "会员社区",
desc: "进入更高密度的人脉与资源网络",
icon: Crown,
href: "https://vip.hackrobot.cn",
},
];
const ICON_MAP = {
MapPin,
Zap,
Users,
} as const;
const ACCENT_STYLES = {
blue: "from-blue-500/20 to-cyan-500/10 border-blue-300/80 hover:border-blue-400 hover:shadow-2xl",
emerald: "from-emerald-500/20 to-teal-500/10 border-emerald-300/80 hover:border-emerald-400 hover:shadow-2xl",
amber: "from-amber-500/20 to-orange-500/10 border-amber-300/80 hover:border-amber-400 hover:shadow-2xl",
} as const;
const CARD_EMOJI = {
nav: "🧭",
arbitrage: "",
salon: "🎯",
} as const;
const ICON_COLORS = {
blue: "text-blue-600",
emerald: "text-emerald-600",
amber: "text-amber-600",
} as const;
export function Hero() {
return (
<section className="relative overflow-hidden bg-white">
<div className="container mx-auto px-4 py-16 md:px-6 md:py-24 lg:py-32">
<div className="grid gap-12 lg:grid-cols-2 lg:gap-16">
<div className="flex flex-col justify-center">
<motion.div
initial={{ opacity: 0, y: 16 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5 }}
>
<h1 className="text-3xl font-semibold tracking-tight text-neutral-900 sm:text-4xl md:text-5xl">
</h1>
<p className="mt-4 text-lg text-neutral-600 md:text-xl">
</p>
<p className="mt-2 text-base text-neutral-500">
</p>
</motion.div>
<motion.p
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ delay: 0.2, duration: 0.4 }}
className="mt-6 max-w-lg text-sm text-neutral-500"
>
+ + +
</motion.p>
<motion.div
initial={{ opacity: 0, y: 12 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.3, duration: 0.4 }}
className="mt-8 flex flex-wrap gap-3"
>
<Link
href="https://meetup.hackrobot.cn"
target="_blank"
rel="noopener noreferrer"
>
<Button size="lg" className="min-w-[180px]">
</Button>
</Link>
<Link
href="https://meetup.hackrobot.cn"
target="_blank"
rel="noopener noreferrer"
>
<Button variant="outline" size="lg">
</Button>
</Link>
<Link
href="https://digital.hackrobot.cn"
target="_blank"
rel="noopener noreferrer"
>
<Button variant="ghost" size="lg">
</Button>
</Link>
</motion.div>
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ delay: 0.5 }}
className="mt-10 flex flex-wrap gap-2"
>
{HERO_TAGS.map((tag, i) => (
<span
key={tag}
className="rounded-full border border-neutral-200 bg-neutral-50 px-3 py-1 text-xs text-neutral-600"
>
{tag}
</span>
))}
</motion.div>
</div>
<section className="relative min-h-[100dvh] overflow-hidden bg-gradient-to-br from-violet-50 via-white to-cyan-50">
<Particles />
<div
className="pointer-events-none absolute inset-0 opacity-30"
style={{
backgroundImage: `radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.15) 0%, transparent 50%)`,
}}
/>
<div className="container relative mx-auto flex min-h-[100dvh] flex-col justify-center px-3 py-6 sm:px-4 sm:py-8 md:px-6 md:py-16 lg:py-24">
<div className="mx-auto max-w-4xl text-center">
<motion.div
initial={{ opacity: 0, y: 16 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.1, duration: 0.5 }}
>
<h1 className="text-2xl font-bold tracking-tight sm:text-4xl md:text-5xl lg:text-6xl">
<span className="bg-gradient-to-r from-violet-600 via-fuchsia-500 to-cyan-600 bg-clip-text text-transparent">
</span>{" "}
<span className="text-neutral-800">nomadro</span>
</h1>
</motion.div>
<motion.div
initial={{ opacity: 0, x: 24 }}
animate={{ opacity: 1, x: 0 }}
transition={{ delay: 0.4, duration: 0.5 }}
className="flex flex-col gap-4 lg:justify-center"
initial={{ opacity: 0, y: 24 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.3, duration: 0.5 }}
className="mt-6 flex flex-col gap-3 sm:mt-8 sm:gap-4 lg:mt-12 lg:grid lg:grid-cols-3 lg:gap-6"
>
<div className="grid gap-4 sm:grid-cols-3">
{HERO_CARDS.map((card, i) => (
<Link
key={card.title}
href={card.href}
target="_blank"
rel="noopener noreferrer"
className="group flex flex-col rounded-xl border border-neutral-200 bg-white p-5 shadow-sm transition-all hover:-translate-y-1 hover:shadow-md"
{ENTRY_CARDS.map((card, i) => {
const Icon = ICON_MAP[card.icon];
const accent = ACCENT_STYLES[card.accent];
const emoji = CARD_EMOJI[card.id];
const iconColor = ICON_COLORS[card.accent];
return (
<motion.div
key={card.id}
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.4 + i * 0.1, duration: 0.4 }}
whileHover={{ scale: 1.01, y: -2 }}
>
<card.icon className="h-8 w-8 text-neutral-400 transition-colors group-hover:text-neutral-700" />
<h3 className="mt-3 font-medium text-neutral-900">
{card.title}
</h3>
<p className="mt-1 text-sm text-neutral-500">{card.desc}</p>
</Link>
))}
</div>
<Link
href={card.href}
target="_blank"
rel="noopener noreferrer"
className={`group relative flex items-center gap-4 overflow-hidden rounded-2xl border-2 bg-gradient-to-br p-4 transition-all duration-300 active:scale-[0.99] lg:flex-col lg:items-stretch lg:gap-0 lg:p-6 ${accent}`}
>
<div className="absolute -right-6 -top-6 text-5xl opacity-20 transition-transform group-hover:scale-110 group-hover:opacity-30 sm:-right-8 sm:-top-8 sm:text-6xl">
{emoji}
</div>
<div className={`relative flex h-11 w-11 shrink-0 items-center justify-center self-start rounded-xl bg-white/80 shadow-sm lg:h-12 lg:w-12 ${iconColor}`}>
<Icon className="h-5 w-5 group-hover:scale-110 transition-transform lg:h-6 lg:w-6" />
</div>
<div className="relative min-w-0 flex-1 lg:mt-4">
<h2 className="text-base font-bold text-neutral-900 lg:text-xl">
{card.label}
</h2>
<p className="mt-0.5 text-sm text-neutral-600">
{card.title}
</p>
<p className="mt-1 hidden text-xs text-neutral-500 lg:block">
{card.description}
</p>
</div>
<ArrowRight className="relative h-5 w-5 shrink-0 text-neutral-400 transition-all group-hover:translate-x-1 group-hover:text-violet-500 lg:absolute lg:right-4 lg:top-4" />
</Link>
</motion.div>
);
})}
</motion.div>
</div>
</div>