Shape Landing Hero — 动画几何形状英雄组件 是做什么的?
英雄区模块来源于 MIT 许可的
pulkitxm/claude-directory画廊。
将 Kokonut UI 的 HeroGeometric 组件集成到项目中——五个模糊、渐变填充的形状在近黑色 #030303 画布上,通过 Framer Motion 驱动,漂浮在渐变裁剪的标题后方。组件被放置到标准的 shadcn/ui 项目结构中,并包装在登陆体验(浮动导航栏、行动号召按钮、实时属性演示、功能网格、安装区域)中,在首屏上方展示。此动画英雄区是深色主题 SaaS、设计工具或作品集登陆页面的理想起点。
工作流程
- 克隆
example.html到用户的工作空间作为工作文件。 - 替换占位内容 为用户的真实品牌名称、标题、正文、数据和图像。替换资源时保持现有图像尺寸。
- 保留设计系统。 下方构建规范中的调色板、字体比例、间距节奏和动效是身份特征——不要替换字体、更改调色板或移除装饰元素。
- 通过复制部分进行扩展,绝不要从其他模板导入布局。如果缺少某个部分,请以该模板自身的语言从头设计。
- 保持动效可访问。 根据构建规范要求,每个动画必须遵循
prefers-reduced-motion。
输出约定
在 <artifact> 标签之间输出:
<artifact identifier="shape-landing-hero" type="text/html" title="Shape Landing Hero — 动画几何形状英雄组件">
<!doctype html>
<html>...</html>
</artifact>
构建规范
以下是生成此设计的原始提示(逐字保留)。
集成组件
你被要求将现有 React 组件集成到代码库中。
代码库应支持:
- SHADCN 项目结构
- TAILWIND CSS
- TYPESCRIPT
如果不支持,请提供通过 SHADCN CLI 设置项目、安装 Tailwind 或 TypeScript 的说明。
确定组件的默认路径和样式路径。
如果组件的默认路径不是 /components/ui,请说明创建此文件夹的重要性。
将此组件复制粘贴到 /components/ui 文件夹:
shape-landing-hero.tsx
"use client";
import { motion, useMotionValue, useTransform, animate } from "framer-motion";
import { Circle } from "lucide-react";
import { useEffect, useState } from "react";
import { cn } from "@/lib/utils";
function ElegantShape({
className,
delay = 0,
width = 400,
height = 100,
rotate = 0,
gradient = "from-white/[0.08]",
}: {
className?: string;
delay?: number;
width?: number;
height?: number;
rotate?: number;
gradient?: string;
}) {
return (
<motion.div
initial={{
opacity: 0,
y: -150,
rotate: rotate - 15,
}}
animate={{
opacity: 1,
y: 0,
rotate: rotate,
}}
transition={{
duration: 2.4,
delay,
ease: [0.23, 0.86, 0.39, 0.96],
opacity: { duration: 1.2 },
}}
className={cn("absolute", className)}
>
<motion.div
animate={{
y: [0, 15, 0],
}}
transition={{
duration: 12,
repeat: Number.POSITIVE_INFINITY,
ease: "easeInOut",
}}
style={{
width,
height,
}}
className="relative"
>
<div
className={cn(
"absolute inset-0 rounded-full",
"bg-gradient-to-r to-transparent",
gradient,
"backdrop-blur-[2px] border-2 border-white/[0.15]",
"shadow-[0_8px_32px_0_rgba(255,255,255,0.1)]",
"after:absolute after:inset-0 after:rounded-full",
"after:bg-[radial-gradient(circle_at_50%_50%,rgba(255,255,255,0.2),transparent_70%)]"
)}
/>
</motion.div>
</motion.div>
);
}
function HeroGeometric({
badge = "Design Collective",
title1 = "Elevate Your Digital Vision",
title2 = "Crafting Exceptional Websites",
}: {
badge?: string;
title1?: string;
title2?: string;
}) {
const fadeUpVariants = {
hidden: { opacity: 0, y: 30 },
visible: (i: number) => ({
opacity: 1,
y: 0,
transition: {
duration: 1,
delay: 0.5 + i * 0.2,
ease: [0.25, 0.4, 0.25, 1],
},
}),
};
return (
<div className="relative min-h-screen w-full flex items-center justify-center overflow-hidden bg-[#030303]">
<div className="absolute inset-0 bg-gradient-to-br from-indigo-500/[0.05] via-transparent to-rose-500/[0.05] blur-3xl" />
<div className="absolute inset-0 overflow-hidden">
<ElegantShape
delay={0.3}
width={600}
height={140}
rotate={12}
gradient="from-indigo-500/[0.15]"
className="left-[-10%] md:left-[-5%] top-[15%] md:top-[20%]"
/>
<ElegantShape
delay={0.5}
width={500}
height={120}
rotate={-15}
gradient="from-rose-500/[0.15]"
className="right-[-5%] md:right-[0%] top-[70%] md:top-[75%]"
/>
<ElegantShape
delay={0.4}
width={300}
height={80}
rotate={-8}
gradient="from-violet-500/[0.15]"
className="left-[5%] md:left-[10%] bottom-[5%] md:bottom-[10%]"
/>
<ElegantShape
delay={0.6}
width={200}
height={60}
rotate={20}
gradient="from-amber-500/[0.15]"
className="right-[15%] md:right-[20%] top-[10%] md:top-[15%]"
/>
<ElegantShape
delay={0.7}
width={150}
height={40}
rotate={-25}
gradient="from-cyan-500/[0.15]"
className="left-[20%] md:left-[25%] top-[5%] md:top-[10%]"
/>
</div>
<div className="relative z-10 container mx-auto px-4 md:px-6">
<div className="max-w-3xl mx-auto text-center">
<motion.div
custom={0}
variants={fadeUpVariants}
initial="hidden"
animate="visible"
className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/[0.03] border border-white/[0.08] mb-8 md:mb-12"
>
<Circle className="h-2 w-2 fill-rose-500/80" />
<span className="text-sm text-white/60 tracking-wide">
{badge}
</span>
</motion.div>
<motion.div
custom={1}
variants={fadeUpVariants}
initial="hidden"
animate="visible"
>
<h1 className="text-4xl sm:text-6xl md:text-8xl font-bold mb-6 md:mb-8 tracking-tight">
<span className="bg-clip-text text-transparent bg-gradient-to-b from-white to-white/80">
{title1}
</span>
<br />
<span
className={cn(
"bg-clip-text text-transparent bg-gradient-to-r from-indigo-300 via-white/90 to-rose-300 "
)}
>
{title2}
</span>
</h1>
</motion.div>
<motion.div
custom={2}
variants={fadeUpVariants}
initial="hidden"
animate="visible"
>
<p className="text-base sm:text-lg md:text-xl text-white/40 mb-8 leading-relaxed font-light tracking-wide max-w-xl mx-auto px-4">
通过创新设计和前沿技术,打造卓越的数字体验。
</p>
</motion.div>
</div>
</div>
<div className="absolute inset-0 bg-gradient-to-t from-[#030303] via-transparent to-[#030303]/80 pointer-events-none" />
</div>
);
}
export { HeroGeometric }
demo.tsx
import { HeroGeometric } from "@/components/ui/shape-landing-hero"
function DemoHeroGeometric() {
return <HeroGeometric badge="Kokonut UI"
title1 = "Elevate Your"
title2 = "Digital Vision" />
}
export { DemoHeroGeometric }
安装 NPM 依赖:
lucide-react, framer-motion
实现指南
- 分析组件结构,识别所有必需的依赖项。
- 审查组件的参数和状态。
- 识别任何必需的上下文提供者或钩子并安装它们。
- 需要询问的问题
- 将向此组件传递哪些数据/属性?
- 是否有特定的状态管理要求?
- 是否有必需的资源(图像、图标等)?
- 预期的响应式行为是什么?
- 在应用程序中使用此组件的最佳位置是哪里?
集成步骤
- 将上述所有代码复制粘贴到正确的目录中。
- 安装外部依赖项。
- 用您知道存在的 Unsplash 库存图像填充图像资源。
- 如果组件需要,使用 lucide-react 图标用于 SVG 或 Logo。
来源与许可证
模块来源于 MIT 许可证的
pulkitxm/claude-directory。
上游 MIT 许可证文本随此模板一起提供,位于 LICENSE,并且在任何分发 example.html 或 assets/ 的副本时必须一并重新分发。
Web 字体和高分辨率图像不包含在此模块中:本地 @font-face 规则从 Google Fonts CDN 提供,引用的图像已缩小。获取上游文件夹以获取原始资源。