Neuralyn — 黑暗分析 SaaS 着陆页
根据 MIT 许可的
pulkitxm/claude-directory图库提供的着陆页。
一个深色、全出血的着陆页,适用于虚构的分析仪表板 SaaS Neuralyn,具有全视口英雄区域,其中包含合成在循环背景视频上的滚动关联视差仪表板,以及滚动驱动的推荐信,其中每个单词在滚动时会依次亮起。美学风格为纯黑背景、白色字体、单个斜体衬线重音词和液态玻璃标签药丸。使用 React 18 + Vite 和 TypeScript 构建,使用 Tailwind CSS 3 和 shadcn/ui 风格的原语进行样式设计,通过 Framer Motion(useScroll/useTransform)实现滚动关联视差和逐字颜色揭示的动画,字体通过 Fontsource 自托管。
工作流程
- 将
example.html克隆到用户的工作区作为工作文件。 - 替换占位符内容为用户真实的品牌名称、标题、正文、数字和图片。在替换素材时匹配现有图片尺寸。
- 保留设计系统。 下面构建规范中的调色板、字体比例、间距节奏和动态效果是身份特征——不要替换字体、重新着色调色板或剥离装饰元素。
- 通过复制部分进行扩展,切勿从其他模板导入布局。如果缺少某个部分,请使用此模板自身的语言从头开始设计。
- 保持动态效果的可访问性。 每个动画都必须遵循
prefers-reduced-motion,正如构建规范所要求的那样。
输出契约
在 <artifact> 标记内输出:
<artifact identifier="neuralyn-dark-landing" type="text/html" title="Neuralyn — Dark Analytics SaaS Landing Page">
<!doctype html>
<html>...</html>
</artifact>
构建规范
产生此设计的上游提示,逐字提供。
Neuralyn — 黑暗分析着陆页
概述
为 Neuralyn(一个分析仪表板 SaaS)构建一个深色、全出血的着陆页。该页面有两个部分:一个全视口英雄区域,其中包含一个合成在循环背景视频上的视差仪表板,以及一个滚动驱动的推荐信,其中每个单词在滚动时会依次亮起。美学风格为纯黑背景、白色字体、单个斜体衬线重音词和“液态玻璃”标签药丸。
技术栈
- 框架: React 18(
react^18.3.1,react-dom^18.3.1)搭配 Vite(vite^5.4.10,@vitejs/plugin-react^4.3.3) - 语言: TypeScript(
typescript^5.6.3) - 样式: Tailwind CSS(
tailwindcss^3.4.14)搭配 PostCSS(postcss^8.4.49)和 Autoprefixer(autoprefixer^10.4.20) - 动画: Framer Motion(
framer-motion^11.11.17)——useScroll、useTransform、motion组件 - 图标: Lucide(
lucide-react^0.460.0)——ChevronDown - UI 原语(shadcn/ui 风格):
@radix-ui/react-slot^1.1.0,class-variance-authority^0.7.0,clsx^2.1.1,tailwind-merge^2.5.4 - 字体(通过 Fontsource 自托管):
- Inter(
@fontsource/inter^5.1.0)—— 字重 400、500、600、700 —— 正文/UI - Instrument Serif(
@fontsource/instrument-serif^5.1.0)—— 400 和 400-italic —— 用于斜体重音词
- Inter(
- 值得注意的技术: 全出血
w-screen搭配marginLeft: calc(-50vw + 50%),mix-blend-mode: luminosity图像合成,滚动关联视差和逐字颜色揭示,通过蒙版伪元素实现 CSS“液态玻璃”边框。
全局设置
路径别名
@ 在 vite.config.ts(path.resolve(__dirname, "./src"))和 tsconfig.json("@/*": ["./src/*"])中都解析为 ./src。
入口点(src/main.tsx)
导入字体 CSS,然后是全局 CSS,最后挂载应用:
import React from "react";
import ReactDOM from "react-dom/client";
import "@fontsource/inter/400.css";
import "@fontsource/inter/500.css";
import "@fontsource/inter/600.css";
import "@fontsource/inter/700.css";
import "@fontsource/instrument-serif/400.css";
import "@fontsource/instrument-serif/400-italic.css";
import "./index.css";
import App from "./App";
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<App />
</React.StrictMode>,
);
应用外壳(src/App.tsx)
import Hero from "@/components/Hero";
import Testimonial from "@/components/Testimonial";
export default function App() {
return (
<main>
<Hero />
<Testimonial />
</main>
);
}
HTML 文档(index.html)
<html lang="en">,<meta name="theme-color" content="#000000" />- Favicon:
<link rel="icon" type="image/png" href="/src/assets/logo.png" /> - Meta 描述:"Neuralyn helps teams track metrics, goals, and progress with precision."
- 标题:
Neuralyn — Your Insights. One Clear Overview. - 内联样式以避免闪烁:
html { background: #000; }
Tailwind 配置(tailwind.config.ts)
content: ["./index.html", "./src/**/*.{ts,tsx}"]fontFamily.sans:["Inter", "system-ui", "-apple-system", "sans-serif"]fontFamily.serif:["'Instrument Serif'", "Georgia", "serif"]- 颜色通过
hsl(var(--...))映射到 CSS 变量:background、foreground、border、input、ring,以及card、primary、secondary、muted、accent、destructive的DEFAULT/foreground对。
工具辅助函数(src/lib/utils.ts)
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
调色板
所有颜色都是在 src/index.css 的 :root(默认深色模式)中定义的 HSL CSS 变量:
| 变量 | 值 | 备注 |
|---|---|---|
--background | 0 0% 0% | 纯黑 |
--foreground | 0 0% 100% | 纯白 |
--card | 0 0% 5% | |
--card-foreground | 0 0% 100% | |
--primary | 0 0% 100% | |
--primary-foreground | 0 0% 0% | |
--secondary | 0 0% 10% | |
--secondary-foreground | 0 0% 100% | |
--muted | 0 0% 10% | |
--muted-foreground | 0 0% 65% | |
--accent | 0 0% 10% | |
--accent-foreground | 0 0% 100% | |
--destructive | 0 84% 60% | |
--destructive-foreground | 0 0% 100% | |
--border | 0 0% 20% | |
--input | 0 0% 20% | |
--ring | 0 0% 65% | |
--hero-subtitle | 210 17% 95% | 英雄区域副标题颜色 |
基础层(src/index.css)
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
* {
@apply border-border;
}
html {
scroll-behavior: smooth;
}
body {
@apply bg-background font-sans text-foreground antialiased;
}
}
液态玻璃 CSS
添加到 src/index.css。提供一个带有蒙版渐变边框的磨砂药丸:
.liquid-glass {
background: rgba(255, 255, 255, 0.01);
background-blend-mode: luminosity;
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
border: none;
box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
position: relative;
overflow: hidden;
}
.liquid-glass::before {
content: '';
position: absolute;
inset: 0;
border-radius: inherit;
padding: 1.4px;
background: linear-gradient(180deg,
rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.15) 20%,
rgba(255,255,255,0) 40%, rgba(255,255,255,0) 60%,
rgba(255,255,255,0.15) 80%, rgba(255,255,255,0.45) 100%);
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
-webkit-mask-composite: xor;
mask-composite: exclude;
pointer-events: none;
}
第 1 部分 — 英雄区域(src/components/Hero.tsx)
整个部分是 relative h-screen overflow-hidden(全视口高度),带有 data-testid="hero"。一个 sectionRef(useRef<HTMLElement>)驱动滚动关联视差。
滚动设置
const { scrollYProgress } = useScroll({
target: sectionRef,
offset: ["start start", "end start"],
});
const contentY = useTransform(scrollYProgress, [0, 1], [0, -200]);
const contentOpacity = useTransform(scrollYProgress, [0, 0.5], [1, 0]);
const dashboardY = useTransform(scrollYProgress, [0, 1], [0, -250]);
- 英雄文本内容组:
y: [0, -200]和opacity: [1, 0](不透明度在滚动的前 50% 内淡出)。 - 仪表板图片:
y: [0, -250]。
导航栏
<header> 是 relative z-40 flex items-center justify-between px-8 py-4 md:px-28。
- 左侧集群 —
flex items-center gap-12 md:gap-20:- 标志链接(
<a href="/">,flex items-center gap-2.5):<img src={logo} alt="Neuralyn logo" className="h-8 w-8" />- 品牌文字:
<span className="text-xl font-bold tracking-tight">Neuralyn</span>
- 导航(
hidden items-center gap-1 md:flex,aria-label="Main")——从const NAV_LINKS = ["Home", "Services", "Reviews", "Contact us"];渲染的链接。链接在移动设备上隐藏。每个链接:<a href="#">带有flex items-center gap-1 rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground。Services 链接在其标签后额外渲染一个<ChevronDown className="h-4 w-4" aria-hidden="true" />。
- 标志链接(
- 右侧 — 登录按钮(shadcn
Button组件):rounded-lg bg-foreground text-sm font-semibold text-background transition-opacity hover:bg-foreground hover:opacity-90。标签:Sign In。
英雄内容
一个 motion.div(data-testid="hero-content")样式为 { y: contentY, opacity: contentOpacity } 和类 relative z-20 mt-16 flex flex-col items-center px-4 text-center md:mt-20。按顺序包含:
- 标签药丸 — 带有类
liquid-glass mb-6 flex items-center gap-2 rounded-lg px-3 py-2的motion.div:- 内部的“新”徽章:
<span className="rounded-md bg-white px-2 py-0.5 text-sm font-medium text-black">New</span> - 标签:
<span className="text-sm font-medium text-muted-foreground">Say Hello to Corewave v3.2</span>
- 内部的“新”徽章:
- 标题 —
motion.h1带有mb-3 text-5xl font-medium leading-tight tracking-[-2px] md:text-7xl md:leading-[1.15]:- 第 1 行:
Your Insights. <br />- 第 2 行:
One Clear然后是使用 Instrument Serif 斜体的重音词:<span className="font-serif font-normal italic">Overview.</span>
- 第 1 行:
- 副标题 —
motion.p(data-testid="hero-subtitle")带有mb-8 text-lg font-normal leading-6 opacity-90和内联style={{ color: "hsl(var(--hero-subtitle))" }}:Neuralyn helps teams track metrics, goals,<br />and progress with precision.
- CTA 按钮 —
motion.button带有rounded-full bg-foreground px-8 py-3.5 text-base font-medium text-background,whileHover={{ scale: 1.03 }},whileTap={{ scale: 0.98 }}。标签:Get Started for Free。
仪表板 + 视频区域
一个 motion.div(data-testid="dashboard-area")带有 relative z-10 mt-12 w-screen md:mt-16 和内联 style={{ marginLeft: "calc(-50vw + 50%)", aspectRatio: "16 / 9" }} 以突破到全视口宽度。
-
背景视频 —
<video>带有absolute inset-0 h-full w-full object-cover,属性autoPlay muted loop playsInline。src是VIDEO_URL:const VIDEO_URL = "/assets/hf_20260307_083826_e938b29f-a43a-41ec-a153-3d4730578ab8.mp4";注意:原始提示引用了远程源
https://d8j0ntlcm91z4.cloudfront.net/user_38xzzbokvigwjottwixh07lwa1p/hf_20260307_083826_e938b29f-a43a-41ec-a153-3d4730578ab8.mp4。该素材现已本地化到public/assets/hf_20260307_083826_e938b29f-a43a-41ec-a153-3d4730578ab8.mp4,并通过上面的本地路径引用。(原始 URL 在提示中以全大写形式提供;方案和主机根据约定在此处小写,而路径则逐字保留。) -
仪表板图片 — 包裹在
<div className="absolute inset-0 flex items-center justify-center">中,该图片是一个motion.img(data-testid="dashboard-image")带有src={heroDashboard},alt="Neuralyn analytics dashboard",类w-[90%] max-w-5xl rounded-2xl,以及内联style={{ y: dashboardY, mixBlendMode: "luminosity" }}。
底部渐变淡出
一个 <div>(data-testid="hero-fade")带有 pointer-events-none absolute bottom-0 left-0 right-0 z-30 h-40 bg-gradient-to-t from-background to-transparent。
英雄区域入场动画
每个元素使用 initial={{ opacity: 0, y }} → animate={{ opacity: 1, y: 0 }},交错进行:
| 元素 | y | duration | delay |
|---|---|---|---|
| 标签药丸 | 10 | 0.5s | 0 |
| 标题 | 20 | 0.6s | 0.1 |
| 副标题 | 20 | 0.6s | 0.2 |
| CTA | 20 | 0.6s | 0.3 |
| 仪表板区域 | 40 | 0.8s | 0.4 |
英雄区域导入
import { useRef } from "react";
import { motion, useScroll, useTransform } from "framer-motion";
import { ChevronDown } from "lucide-react";
import { Button } from "@/components/ui/button";
import logo from "@/assets/logo.png";
import heroDashboard from "@/assets/hero-dashboard.png";
第 2 部分 — 推荐信(src/components/Testimonial.tsx)
该部分是 flex min-h-screen items-center justify-center px-8 py-24 md:px-28 md:py-32,带有 data-testid="testimonial"。内部一个容器 <div ref={containerRef}> 是 mx-auto flex w-full max-w-3xl flex-col items-start gap-10(最大宽度 3xl,左对齐,元素之间间距为 gap-10)。
引用文本
const QUOTE =
"Neuralyn revolutionized how we handle financial insights using smart analytics. We are now driving better outcomes quicker than we ever imagined! Neuralyn revolutionized how we handle financial insights using smart analytics.";
布局,从上到下
- 引用符号图片 —
<img src={quoteSymbol} alt="" aria-hidden="true" className="h-10 w-14 object-contain" />。 - 推荐信段落 —
<p data-testid="testimonial-quote" className="flex flex-wrap text-4xl font-medium leading-[1.2] md:text-5xl">。引用按空格分割(QUOTE.split(" ")),每个单词作为<Word>组件渲染。在单词之后,一个结束引号:<span className="ml-2 text-muted-foreground">”</span>。 - 作者行
...
[为翻译而截断]