Asme — 电影级暗色英雄着陆页
着陆页源自MIT许可的
pulkitxm/claude-directory图库。
全屏、单视口(100vh,无滚动)暗色英雄着陆页,为虚构的无代码AI应用平台 Asme 设计。全屏背景为来自Mux的HLS视频流,在Safari上原生播放,其他浏览器通过hls.js MediaSource播放。液态玻璃药丸导航条(亮度混合玻璃,带有蒙版 ::before 渐变边框)漂浮在Instrument Serif英雄标题和动画电子邮件捕获CTA之上——点击“Get early access”展开为一个表单,包含60 ms/字符的打字机占位符,提交时将 ArrowRight 图标切换为 Check 图标,并在4秒后自动重置。所有元素均在加载时通过Motion(Framer Motion)进行动画显示。
工作流程
- 将
example.html克隆 到用户的工作区作为工作文件。 - 替换占位内容为用户的真实品牌名称、标题、正文、数字和图片。在替换资源时,保持原有图片尺寸。
- 保留设计系统。 下方构建规范中的调色板、字体比例、间距韵律和动效是品牌标识——不要替换字体、重新着色或移除装饰元素。
- 通过复制区块来扩展,切勿从其他模板导入布局。如果缺少某个区块,请使用此模板自身的风格从头设计。
- 保持动效的可访问性。 根据构建规范的要求,所有动画必须遵守
prefers-reduced-motion。
输出契约
在 <artifact> 标签之间输出:
<artifact identifier="asme-hero-landing" type="text/html" title="Asme — 电影级暗色英雄着陆页">
<!doctype html>
<html>...</html>
</artifact>
构建规范
以下为生成此设计的原始提示,逐字转录。
Asme — 电影级暗色英雄着陆页
概述
构建一个全屏、暗色、单屏(100vh,无滚动)的“Asme”英雄着陆页。页面具有黑色背景、全屏循环背景视频、玻璃态导航条以及居中英雄区域,并带有动画电子邮件捕获CTA。标题使用优雅的衬线显示字体,大多数元素在加载时通过Motion动画显示。
技术栈
- 框架: React 19(
react^19.2.7,react-dom^19.2.7)配合Vite(vite^8.0.16),通过@vitejs/plugin-react^6.0.2集成。 - 样式: Tailwind CSS v4(
tailwindcss^4.3.0),通过@tailwindcss/vite^4.3.0集成(使用@import "tailwindcss";+@theme方式,无需tailwind.config.js)。 - 动画: Motion (Framer Motion)
motion^12.40.0,从motion/react导入(motion,AnimatePresence)。 - 图标: Lucide(
lucide-react^1.17.0)——Globe,ArrowRight,Check。 - 视频: 通过HLS.js(
hls.js^1.6.16)实现HLS回放,Safari浏览器回退到原生HLS支持。 - 字体: Inter(基础无衬线字体)和 Instrument Serif(英雄标题字体),均从Google Fonts加载。
- 值得注意的技术: 带蒙版渐变边框的玻璃态、渐变裁剪文本、打字机占位符效果、按钮与电子邮件表单之间的
AnimatePresence状态切换。
全局设置
入口HTML(index.html)
-
<html lang="en">,<meta charset="UTF-8" />,<meta name="viewport" content="width=device-width, initial-scale=1.0" />。 -
<title>:Asme — A new way to think and create with computers -
<meta name="description" content="Build a no-code AI app in minutes. Get early access to Asme." /> -
Favicon是一个白色地球图标的行内SVG数据URI:
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20'/%3E%3Cpath d='M2 12h20'/%3E%3C/svg%3E" /> -
Body包含
<div id="root"></div>和<script type="module" src="/src/main.jsx"></script>。
React入口(src/main.jsx)
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import "./index.css";
import App from "./App.jsx";
createRoot(document.getElementById("root")).render(
<StrictMode>
<App />
</StrictMode>,
);
样式(src/index.css)
导入顺序:首先导入两个Google Fonts URL,然后导入Tailwind,最后导入主题/基础规则。
-
字体(Google Fonts):
- Inter,字重300、400、500、600——基础无衬线字体。
- Instrument Serif,常规和斜体——用于英雄标题。
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap"); @import url("https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap"); @import "tailwindcss"; -
主题:
@theme { --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif; } -
根变量和body:
:root { --background: #000000; --foreground: #ffffff; } body { background-color: var(--background); color: var(--foreground); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; letter-spacing: -0.01em; } -
.liquid-glass——带蒙版渐变边框的玻璃态表面,通过::before实现:.liquid-glass { background: rgba(255, 255, 255, 0.01); background-blend-mode: luminosity; /* 先加前缀:确保标准属性在LightningCSS合并对时作为胜出声明保留 */ -webkit-backdrop-filter: blur(4px); 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: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude; pointer-events: none; } -
.glass-pill——药丸形状的玻璃表面(为完整性定义):.glass-pill { background: rgba(255, 255, 255, 0.04); -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%); border-radius: 9999px; box-shadow: none !important; }
应用根布局(src/App.jsx)
<main>,类名为relative bg-black h-screen w-screen flex flex-col overflow-hidden selection:bg-white selection:text-black shrink-0。- 文本选中样式为白色背景和黑色文本(
selection:bg-white selection:text-black)。 - 渲染顺序:
BackgroundVideo,Navbar,Hero。
import BackgroundVideo from "./components/BackgroundVideo.jsx";
import Navbar from "./components/Navbar.jsx";
import Hero from "./components/Hero.jsx";
export default function App() {
return (
<main className="relative bg-black h-screen w-screen flex flex-col overflow-hidden selection:bg-white selection:text-black shrink-0">
<BackgroundVideo />
<Navbar />
<Hero />
</main>
);
}
背景视频(src/components/BackgroundVideo.jsx)
- 渲染一个绝对定位的
<div>,覆盖整个父元素:absolute inset-0 overflow-hidden pointer-events-none。 - 包含一个
<video>元素,具有autoPlay,muted,loop,playsInline属性,类名为w-full h-full object-cover opacity-100,并带有ref。 - 视频源URL(托管在Mux上的HLS流——注意:这是Mux的
.m3u8流,不是CloudFront URL):https://stream.mux.com/kimF2ha9zLrX64H00UgLGPflCzNtl1T0215MlAmeOztv8.m3u8 - 使用HLS.js的回放逻辑: 在
useEffect中,如果浏览器原生支持HLS(video.canPlayType("application/vnd.apple.mpegurl")),直接设置video.src。否则,如果Hls.isSupported(),则实例化new Hls(),调用loadSource,然后attachMedia,并在清理时调用hls.destroy()。.m3u8格式需要HLS.js用于非Safari浏览器。
import { useEffect, useRef } from "react";
import Hls from "hls.js";
const VIDEO_SRC =
"https://stream.mux.com/kimF2ha9zLrX64H00UgLGPflCzNtl1T0215MlAmeOztv8.m3u8";
export default function BackgroundVideo() {
const videoRef = useRef(null);
useEffect(() => {
const video = videoRef.current;
if (!video) return undefined;
if (video.canPlayType("application/vnd.apple.mpegurl")) {
video.src = VIDEO_SRC;
return undefined;
}
if (Hls.isSupported()) {
const hls = new Hls();
hls.loadSource(VIDEO_SRC);
hls.attachMedia(video);
return () => hls.destroy();
}
return undefined;
}, []);
return (
<div className="absolute inset-0 overflow-hidden pointer-events-none">
<video
ref={videoRef}
autoPlay
muted
loop
playsInline
className="w-full h-full object-cover opacity-100"
/>
</div>
);
}
导航栏(src/components/Navbar.jsx)
- 使用
motion.nav进行动画显示:initial={{ y: -20, opacity: 0 }},animate={{ y: 0, opacity: 1 }}。 - 外部
motion.nav类名:relative z-20 px-6 py-6 w-full。 - 内部容器:
liquid-glass rounded-full px-6 py-3 flex items-center justify-between max-w-5xl mx-auto。 - 左侧(
flex items-center gap-8):- Logo: Lucide的
Globe图标(w-6 h-6 text-white)+ 品牌文本“Asme”(text-white font-semibold text-lg),放在flex items-center gap-2包裹器中。 - 导航链接: “Features”、“Pricing”、“About”——定义为
NAV_LINKS数组并映射。在移动设备上隐藏(hidden md:flex items-center gap-8 text-white/80 text-sm font-medium)。每个<a>使用href={#${link.toLowerCase()}},类名为hover:text-white transition-colors duration-300。
- Logo: Lucide的
- 右侧(
flex items-center gap-4):- “Sign Up” 纯文本按钮:
text-white hover:text-white/80 transition-colors text-sm font-medium cursor-pointer。 - “Login” 玻璃态按钮:
liquid-glass rounded-full px-6 py-2 text-sm font-medium text-white hover:opacity-90 transition-opacity cursor-pointer。
- “Sign Up” 纯文本按钮:
import { motion } from "motion/react";
import { Globe } from "lucide-react";
const NAV_LINKS = ["Features", "Pricing", "About"];
export default function Navbar() {
return (
<motion.nav
initial={{ y: -20, opacity: 0 }}
animate={{ y: 0, opacity: 1 }}
className="relative z-20 px-6 py-6 w-full"
>
<div className="liquid-glass rounded-full px-6 py-3 flex items-center justify-between max-w-5xl mx-auto">
<div className="flex items-center gap-8">
<div className="flex items-center gap-2">
<Globe className="w-6 h-6 text-white" />
<span className="text-white font-semibold text-lg">Asme</span>
</div>
<div className="hidden md:flex items-center gap-8 text-white/80 text-sm font-medium">
{NAV_LINKS.map((link) => (
<a
key={link}
href={`#${link.toLowerCase()}`}
className="hover:text-white transition-colors duration-300"
>
{link}
</a>
))}
</div>
</div>
<div className="flex items-center gap-4">
<button
type="button"
className="text-white hover:text-white/80 transition-colors text-sm font-medium cursor-pointer"
>
Sign Up
</button>
<button
type="button"
className="liquid-glass rounded-full px-6 py-2 text-sm font-medium text-white hover:opacity-90 transition-opacity cursor-pointer"
>
Login
</button>
</div>
</div>
</motion.nav>
);
}
英雄区域(src/components/Hero.jsx)
布局
<section>,类名为relative flex-1 flex flex-col items-center justify-center px-6。- 内容包裹器:
relative z-10 text-center max-w-5xl mx-auto flex flex-col items-center justify-center w-full gap-12。
标签(motion.p)
- 文本:“Build a no-code AI app in minutes”。
- 类名:
text-white/80 text-[10px] md:text-[11px] font-medium tracking-[0.2em] uppercase mb-4。 - 动画:
initial={{ opacity: 0, y: 10 }},animate={{ opacity: 1, y: 0 }},transition={{ delay: 0.1 }}。
标题(motion.h1)
- 文本:“A new way to think and create with computers”,在“create”后面插入
<br className="hidden md:block" />(即A new way to think and create{" "},然后<br />,再然后with computers)。 - 通过行内样式设置字体:
style={{ fontFamily: "'Instrument Serif', serif" }}。 - 类名:
text-4xl md:text-[64px] font-medium tracking-[-0.01em] leading-[1.1] mb-6 bg-gradient-to-b from-white via-white/95 to-white/70 bg-clip-text text-transparent max-w-4xl。 - 动画:
initial={{ opacity: 0, y: 20 }},animate={{ opacity: 1, y: 0 }},transition={{ duration: 1, ease: [0.16, 1, 0.3, 1] }}。
CTA区域(motion.div)
-
包裹器类名:
min-h-[50px] mt-2 w-full flex items-center justify-center。 -
动画:
initial={{ opacity: 0, y: 10 }},animate={{ opacity: 1, y: 0 }},transition={{ delay: 0.4 }}。 -
使用
AnimatePresence mode="wait"在两个状态之间切换。两个状态都使用initial={{ opacity: 0, scale: 0.95 }},animate={{ opacity: 1, scale: 1 }},exit={{ opacity: 0, scale: 0.95 }},transition={{ duration: 0.2 }}。 -
按钮状态(
motion.button,key="cta-button"):文本“Get early access”。类名px-10 py-3 text-[14px] font-medium border border-white/10 rounded-full ho
…
[为翻译截断]