NHM 古生物学 — 自然历史博物馆单色着陆页 是做什么的?
着陆页来源于 MIT 许可的
pulkitxm/claude-directory画廊。
一个为虚构的自然历史博物馆古生物学馆藏设计的单色、编辑风格着陆页,包含三段连续滚动区域:一个全视口英雄区,带有延迟背景视频展示和逐多边形滑入的几何“NHM” SVG标志;一个“探索我们的世界”部分,包含滚动触发的标题和操作药丸;以及一个深色“古代馆藏”章节浏览器,具备自动轮播的古生物图像和自定义 SVG feTurbulence/feDisplacementMap 沙尘溶解过渡效果。基于 React 19、Vite 6、Tailwind CSS 4(CSS 优先配置)和 Motion (Framer Motion) 构建,采用严格的黑白灰单色调色板 — 无彩色点缀。
工作流程
- 将
example.html克隆 到用户的工作区作为工作文件。 - 替换占位内容 为用户的真实品牌名称、标题、正文、数字和图像。在替换资源时,匹配原有的图像尺寸。
- 保留设计系统。 下方构建规范中的调色板、字体比例、间距节奏和动效是页面的核心特征 — 不要替换字体、改变调色板颜色或移除装饰性元素。
- 通过复制区域进行扩展,切勿从其他模板导入布局。如果缺少某个区域,请使用本模板自身的视觉语言从头设计。
- 保持动效的可访问性。 根据构建规范要求,所有动画必须遵循
prefers-reduced-motion媒体查询。
输出约定
在 <artifact> 标签之间输出:
<artifact identifier="nhm-paleontology-landing" type="text/html" title="NHM 古生物学 — 自然历史博物馆单色着陆页">
<!doctype html>
<html>...</html>
</artifact>
构建规范
以下为生成此设计的原始提示,逐字引用。
NHM — 自然历史博物馆古生物学着陆页
概述
构建一个单页、单色的自然历史博物馆古生物学馆藏着陆页。页面为连续滚动的三个区域组成 — 一个全视口英雄区,带有延迟背景视频和几何“NHM”标志;一个“探索我们的世界”介绍区域;以及一个深色“古代馆藏”章节浏览器,包含 SVG 滤镜沙尘/溶解图像过渡效果。整个页面由一个单独的 App.tsx 组件以及同一文件中的 SandTransitionImage 辅助组件和 LeafIcon 辅助组件构成。
技术栈
- 框架: React 19 (
react,react-dom^19.0.1) 配合StrictMode - 构建工具: Vite 6 (
vite^6.2.3,@vitejs/plugin-react^5.0.4) - 语言: TypeScript (
typescript~5.8.2,@types/react^19.0.10,@types/react-dom^19.0.4) - 样式: Tailwind CSS 4 (
tailwindcss^4.1.14,@tailwindcss/vite^4.1.14) — 通过@theme实现 CSS 优先配置 - 动画: Motion / Framer Motion (
motion^12.23.24),从motion/react导入 - 图标: Lucide (
lucide-react^0.546.0) - 字体 (Google Fonts): Inter (无衬线,字重 300/400/500/600) 和 JetBrains Mono (等宽,字重 400/500)
- 显著技术: 延迟背景视频展示、自动轮播章节、由
requestAnimationFrame驱动的 SVGfeTurbulence/feDisplacementMap沙尘溶解滤镜、逐多边形动画几何标志、whileInView滚动揭示。
全局设置
index.html
lang="en",<meta charset="UTF-8" />,视口元数据width=device-width, initial-scale=1.0。- 描述元数据:
NHM — Natural History Museum. Exploring the story of life on earth through science, discovery and wonder. - 标题:
NHM — Natural History Museum - 根元素:
<div id="root"></div>和<script type="module" src="/src/main.tsx"></script>。
src/main.tsx
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import "./index.css";
import App from "./App";
createRoot(document.getElementById("root")!).render(
<StrictMode>
<App />
</StrictMode>,
);
src/index.css
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');
@import "tailwindcss";
@theme {
--font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}
@layer base {
body {
background-color: #fcfcfc;
color: #111;
overflow-x: hidden;
font-family: var(--font-sans);
-webkit-font-smoothing: antialiased;
}
::selection {
background-color: #000;
color: #fff;
}
}
@layer utilities {
.text-mega {
font-size: 21vw;
line-height: 0.75;
letter-spacing: -0.04em;
}
}
全局样式总结: 背景 #fcfcfc,文本 #111,选中状态背景 #000 / 文本 #fff,overflow-x: hidden,默认字体 font-sans (Inter),抗锯齿。定义了 .text-mega 工具类(font-size: 21vw,line-height: 0.75,letter-spacing: -0.04em),但并非所有布局都必须使用。
数据、状态与常量
导入
import { useEffect, useRef, useState } from "react";
import { AnimatePresence, motion, usePresence } from "motion/react";
import type { Variants } from "motion/react";
import {
ArrowRight,
ArrowUpRight,
Bone,
BookOpen,
Dna,
Gem,
Leaf,
Plus,
} from "lucide-react";
资源 URL (本地,位于 /assets/ 目录下)
注意:资源从本地
/assets/...提供服务,而非远程 CDN。原始需求中引用了 Cloudinary URL;项目将这些资源本地化,使用以下确切的(小写、区分大小写)文件名。
const VIDEO_URL =
"/assets/magnific_use-img-2-as-the-exact-ba_Piu3X0W42C_wnrc8f.mp4";
const PTERODACTYL_URL =
"/assets/ChatGPT_Image_May_23_2026_12_24_44_PM_1_lv1dne.png";
章节数据
const chaptersData = [
{ name: "Age of Dinosaurs", image: "/assets/01_udnber.png" },
{ name: "Fossils of Ancient Life", image: "/assets/02_pmvxxl.png" },
{ name: "Reptiles of the Mesozoic", image: "/assets/03_hcp3jc.png" },
{ name: "Marine Fossil Gallery", image: "/assets/04_get63z.png" },
{ name: "Prehistoric Giants", image: "/assets/05_kz1tyu.png" },
];
其他常量
const NAV_LINKS = ["Visit", "Exhibitions", "Discover", "Learn", "About"];
const ACTION_PILLS = [
{ icon: Bone, label: "Dinosaurs" },
{ icon: Dna, label: "Ancient Life" },
{ icon: Gem, label: "Minerals" },
{ icon: Leaf, label: "Fossils" },
{ icon: BookOpen, label: "Learn More" },
];
const EASE: [number, number, number, number] = [0.16, 1, 0.3, 1];
组件状态 (在 App 内部)
const [showVideo, setShowVideo] = useState(false);
const [activeChapter, setActiveChapter] = useState(2); // 从 "Reptiles of the Mesozoic" 开始
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
showVideo在 2800ms 的setTimeout后变为true(在组件卸载时清除)。activeChapter每 3500ms 通过setInterval自动轮换,循环(prev + 1) % 5(在组件卸载时清除)。
动画变体
const fadeUp: Variants = {
initial: { opacity: 0, y: 20 },
animate: { opacity: 1, y: 0 },
};
const fadeUpTransition = { duration: 0.8, ease: "easeOut" as const };
const letterBlock: Variants = {
initial: { y: 120, opacity: 0 },
animate: {
y: 0,
opacity: 1,
transition: { duration: 1.2, ease: EASE },
},
};
const logoVariants: Variants = {
initial: { scale: 1.03 },
animate: {
scale: 1,
transition: {
duration: 1.2,
ease: EASE,
staggerChildren: 0.06,
delayChildren: 0.1,
},
},
};
const staggerHeader: Variants = {
animate: { transition: { staggerChildren: 0.1, delayChildren: 0.1 } },
};
const staggerLeft: Variants = {
animate: { transition: { staggerChildren: 0.15, delayChildren: 0.6 } },
};
const staggerRight: Variants = {
animate: { transition: { staggerChildren: 0.15, delayChildren: 0.9 } },
};
const staggerPills: Variants = {
animate: { transition: { staggerChildren: 0.1, delayChildren: 0.3 } },
};
布局
根元素:<main className="w-full"> 包含三个 <section> 块。
第一节 — 英雄区 (全视口高度)
容器:relative flex min-h-screen w-full flex-col overflow-hidden
1D. 背景视频
首先渲染(位于所有元素之后),由 AnimatePresence 中的 showVideo 控制显示。
- 包裹
motion.div:initial={{ opacity: 0 }},animate={{ opacity: 1 }},transition={{ duration: 1.4, ease: "easeOut" }},类名pointer-events-none absolute top-0 left-0 z-0 h-full w-full。 <video>:autoPlay loop muted playsInline,src={VIDEO_URL},类名h-full w-full object-cover。
1A. 页眉 — NHM 标志
motion.header 包含 initial="initial" animate="animate" variants={staggerHeader},类名 relative z-20 px-6 pt-6 md:px-16。
motion.h1使用variants={logoVariants},类名w-full。内部包含<span className="sr-only">NHM — Natural History Museum</span>以及内联 SVG。- SVG:
viewBox="0 0 840 100",类名w-full overflow-hidden fill-[#111],aria-hidden="true"。 - 字母由
LOGO_LETTERS进行数据驱动;每个字母是一个<g transform={letter.translate}>,每个多边形是一个motion.polygon,带有variants={letterBlock}(从y: 120向上滑入)。
const LOGO_LETTERS: { translate: string; polygons: string[] }[] = [
{
// N
translate: "translate(0,0)",
polygons: [
"0,0 14,0 14,100 0,100",
"200,0 214,0 214,100 200,100",
"0,0 33,0 214,100 181,100",
],
},
{
// H
translate: "translate(280,0)",
polygons: [
"0,0 14,0 14,100 0,100",
"200,0 214,0 214,100 200,100",
"14,43 200,43 200,57 14,57",
],
},
{
// M
translate: "translate(560,0)",
polygons: [
"0,0 14,0 14,100 0,100",
"266,0 280,0 280,100 266,100",
"0,0 26,0 153,100 127,100",
"254,0 280,0 153,100 127,100",
],
},
];
1B. 子导航栏
motion.div 包含 variants={fadeUp} transition={fadeUpTransition},类名 mt-8 flex items-start justify-between gap-3 font-mono text-[10px] tracking-[0.2em] uppercase md:text-[11px]。
- 左列 (
w-[15%]):三行<p>—Natura/History/Museum。 - 箭头分隔符 (
hidden w-[5%] justify-center md:flex):LucideArrowRight,size={14},strokeWidth={1},类名text-gray-400。 - 中列 (
flex-1 leading-relaxed font-mono text-gray-800 md:flex-none md:w-[30%]):文字 "Exploring the story of life on earth through science, discovery and wonder." 在桌面端分为 3 行 (hidden md:block),移动端分为 4 行 (md:hidden):- 桌面端:
Exploring the story of life/on earth through science,/discovery and wonder. - 移动端:
Exploring the story/of life on earth/through science,/discovery and wonder.
- 桌面端:
- 箭头分隔符 (与上相同,
hidden w-[5%] justify-center md:flex)。 - 右列 / 导航 (
hidden w-[15%] md:block):<ul className="space-y-1 text-gray-800">遍历NAV_LINKS— Visit, Exhibitions, Discover, Learn, About — 每个是<a href="#">,类名transition-colors hover:text-black hover:underline。 - 汉堡菜单按钮 (最右侧,
md:hidden):<button type="button">,aria-label在Open menu/Close menu之间切换,aria-expanded={isMobileMenuOpen},onClick切换isMobileMenuOpen,类名group z-60 flex flex-col items-end gap-[6px] py-2 pl-4 md:hidden。- 两个
<span>条,基础类名均为h-[1.5px] bg-black transition-all duration-300。 - 菜单打开时:第一条
w-8 translate-y-[3.75px] rotate-45;第二条w-8 -translate-y-[3.75px] -rotate-45(形成 X 形)。 - 菜单关闭时:第一条
w-8 group-hover:w-6;第二条w-8 group-hover:w-10。
- 两个
1C. 移动端菜单覆盖层
AnimatePresence 包裹一个 motion.div,在 isMobileMenuOpen 为 true 时显示。
initial={{ y: -20, opacity: 0 }},animate={{ y: 0, opacity: 1 }},exit={{ y: -20, opacity: 0 }},transition={{ duration: 0.4, ease: EASE }}。- 类名:
absolute top-full right-0 left-0 z-50 border-b border-gray-200 bg-[#fcfcfc] shadow-xl md:hidden。 <nav className="px-6 py-10">包含<ul className="space-y-6 font-mono text-sm tracking-[0.2em] uppercase">遍历相同的NAV_LINKS;每个链接的onClick关闭菜单 (setIsMobileMenuOpen(false)),类名transition-colors hover:text-black hover:underline。
英雄区主体包装器
<div className="relative z-10 flex w-full flex-1 items-start justify-between"> 包含左右两侧栏。
1E. 左侧栏内容
motion.div 包含 initial="initial" animate="animate" variants={staggerLeft},类名 mt-20 w-[320px] px-10 sm:mt-28 md:mt-32 md:px-16。
- 区域指示器 (
motion.div variants={fadeUp},类名flex items-center gap-4 font-mono text-xs):<span>01</span>+<span className="h-[1.5px] w-16 bg-black/20" />。 - 标题 (
motion.h2 variants={fadeUp},类名mt-6 text-[3.5rem] leading-[1] font-normal tracking-tight md:text-[5rem]):TIMELESS<br />WONDERS。 - 描述 (
motion.p variants={fadeUp},类名mt-6 w-[240px] text-[13px] leading-[1.6] text-gray-700 md:text-[14px]):Step into the natural world and/discover the stories written/millions of years ago.(每个短语之间换行)。 - 行动号召按钮 (
motion.div variants={fadeUp},类名mt-10):<button type="button">,类名group relative overflow-hidden rounded-md border border-[#1a1a1a] bg-[#1a1a1a] px-6 py-3.5 shadow-sm transition-all duration-300 hover:-translate-y-[0.5px] hover:shadow-[3px_3px_0px_rgba(17,17,17,0.5)] active:translate-y-0 active:shadow-sm。- 滑动背景面板 (
<span aria-hidden="true">):absolute inset-0 -translate-x-[101%] bg-[#fcfcfc] transition-transform duration-700 ease-[cubic-bezier(0.16,1,0.3,1)] group-hover:translate-x-0。 - 按钮文本 (
<span className="relative z-10 flex items-center gap-2 text-[13px] tracking-wider text-[#fcfcfc] transition-colors duration-700 group-hover:text-[#1a1a1a] md:text-[14px]">):LucideArrowUpRightsize={16}strokeWidth={1.5}+Explore Collection。
- 滑动背景面板 (
1F. 右侧栏内容
motion.div 包含 initial="initial" animate="animate" variants={staggerRight},类名 hidden w-[200px] self-end pb-16 pr-8 md:block。
- 小标题 (
motion.p variants={fadeUp},类名font-mono text-[10px] tracking-[0.25em] uppercase text-gray-700):Featured Exhibit。 - 插图 (
motion.img variants={fadeUp}):src={PTERODACTYL_URL},alt为 "Fossil of a Pterodactyl",类名mt-4 w-[140px] opacity-15 grayscale。 - 说明文字 (
motion.p variants={fadeUp},类名mt-4 max-w-[160px] text-[11px] leading-[1.5] text-gray-600):A remarkable pterodactyl fossil, preserved for millions of years and discovered in the Solnhofen limestone deposits. - 博物馆标签 (
motion.div variants={fadeUp},类名mt-6 font-mono text-[10px] tracking-[0.2em] uppercase text-black):NHM / Paleontology。
第二节 — 探索我们的世界
motion.section 包含 initial="initial" whileInView="animate" viewport={{ once: true, margin: "-200px" }},类名 relative z-10 min-h-screen w-full bg-[#fcfcfc] px-6 pt-48 pb-40 md:px-16。
2A. 展示标题
motion.h2 包含 variants={{ initial: { opacity: 0, y: 60 }, animate: { opacity: 1, y: 0, transition: { duration: 1, ease: EASE } } }},类名 max-w-5xl text-6xl leading-[0.95] tracking-tight md:text-[9rem]。
EXPLORE
OUR
WORLD
2B. 描述性文本框
<div className="mt-16 grid grid-cols-1 gap-6 md:grid-cols-2 md:gap-16">:
- 左列 (
max-w-md):<p className="text-[15px] leading-[1.7] text-gray-700 md:text-[17px]">— 一段关于博物馆、其使命和故事的描述性文字。 - 右列 (
max-w-sm):使用font-mono text-[11px] leading-[1.8] tracking-[0.05em] uppercase text-gray-600 md:text-[12px]风格的行,内容为“In partnership with the Natural History Museum, London”。在原文案后包含一个假引用,字体样式为italic font-serif。
2C. 操作药丸
motion.div 包含 variants={staggerPills},类名 mt-24 flex flex-wrap items-center gap-[2px]。
对于 ACTION_PILLS 中的每个药丸:
<a href="#" className="group relative overflow-hidden rounded-[20px] border border-gray-300 bg-transparent px-5 py-2.5 text-[12px] tracking-wider text-gray-800 transition-all duration-500 hover:border-gray-800 hover:text-black md:px-7 md:py-3 md:text-[13px]">- 悬停背景 (
<span className="absolute inset-0 -translate-y-full scale-y-0 bg-black transition-transform duration-500 ease-[cubic-bezier(0.16,1,0.3,1)] group-hover:translate-y-0 group-hover:scale-y-100" aria-hidden="true" />) - 药丸内容 (
<span className="relative z-10 flex items-center gap-2 transition-colors duration-500 group-hover:text-[#fcfcfc]">):motion.span变体{scale: 1},然后渲染 Lucide 图标 (size={14},strokeWidth={1.5}) 和药丸标签。
- 悬停背景 (
第三节 — 古代馆藏
<section className="relative min-h-screen w-full overflow-hidden bg-[#111] px-6 pt-48 pb-32 text-[#fcfcfc] md:px-16">
3A. 章节标题
<div className="flex items-start justify-between"> 包含:
- 左标题:
<h2 className="text-6xl leading-[0.95] tracking-tight md:text-[8rem]">,内容:ANCIENT<br />COLLECTION。 - 章节导航 (
font-mono text-[10px] md:text-[11px] uppercase tracking-[0.2em]):<span>Chapter</span> <span>{String(activeChapter + 1).padStart(2, '0')}/05</span>。
3B. 古生物图像过渡
<div className="relative mt-16 h-[60vh] w-full overflow-hidden md:h-[70vh]"> 包含:
<AnimatePresence mode="popLayout">
<motion.img
key={chaptersData[activeChapter].image}
src={chaptersData[activeChapter].image}
alt={chaptersData[activeChapter].name}
initial={{ opacity: 0, filter: "blur(8px)" }}
animate={{ opacity: 1, filter: "blur(0px)", transition: { duration: 1.2, ease: EASE } }}
exit={{ opacity: 0, filter: "blur(8px)", transition: { duration: 0.8, ease: EASE } }}
className="absolute inset-0 h-full w-full object-cover grayscale"
/>
</AnimatePresence>
此外,图像上方覆盖一个 SandTransitionImage 组件,它渲染一个填充整个容器的 <svg viewBox="0 0 400 200" className="absolute inset-0 h-full w-full">,其中包含:
- 一个
filter定义:<filter id="sand-dissolve">包含<feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="6" seed="2">和<feDisplacementMap in="SourceGraphic" scale="0">。 - 对应的
<rect width="100%" height="100%" filter="url(#sand-dissolve)" fill="currentColor" opacity="0" />。
(SandTransitionImage 中的 useEffect 使用 requestAnimationFrame 循环,将 feDisplacementMap 的 scale 属性从 0 动画到最大值,从而产生沙尘/溶解过渡效果。)
3C. 章节指示器 / 章节名称
<div className="relative z-10 mt-8 flex items-center gap-4 md:mt-12">:
- 自动播放指示器 (
w-[120px] h-[2px] bg-gray-700 relative),内部有一个motion.span,className="absolute top-0 left-0 h-full bg-[#fcfcfc]",initial={{ width: "0%" }},animate={{ width: "100%" }},transition={{ duration: 3.5, ease: "linear" }}(每次activeChapter变化时重新挂载)。 - 章节名称 (
font-mono text-[11px] md:text-[13px] tracking-[0.15em] uppercase text-gray-400):{chaptersData[activeChapter].name}。
页脚
<footer className="border-t border-gray-200 bg-[#fcfcfc] px-6 py-10 md:px-16"> 包含:
<div className="flex flex-col items-start justify-between gap-6 md:flex-row md:items-center">font-mono text-[10px] md:text-[11px] tracking-[0.2em] uppercase text-gray-500的段落,内容为© 2026 Natural History Museum. All rights reserved.。flex items-center gap-6的无序列表,包含Privacy、Terms、Accessibility和Contact的链接。
<p className="mt-12 font-mono text-[10px] tracking-[0.15em] text-gray-400 md:text-[11px]">,内容为Site designed as an editorial monochrome landing page concept. Built with React 19, Vite 6, Tailwind CSS 4 & Motion.
变更日志
- 已实现初始完整的着陆页结构,包含所有三个区域和预期的动画。
- 添加了自定义 SVG
feTurbulence/feDisplacementMap沙尘溶解图像过渡效果。 - 实现了逐多边形的“NHM”标志几何 SVG 滑入动画。
- 添加了
prefers-reduced-motion可访问性支持。 - 配置了 Tailwind CSS 4,使用 CSS 优先的
@theme配置进行字体设置。 - 更新了所有依赖项以使用 React 19、Vite 6 和 Motion 12。
- 移除了所有有颜色的 SVG 图标,以符合严格的黑白灰/单色调色板要求。