Velorah — 电影级英雄登陆区
英雄区来源于 MIT 许可的
pulkitxm/claude-directory作品集。
一个虚构创意品牌 Velorah 的电影级单页英雄区,包含全屏循环背景视频、液态玻璃导航栏和 CTA 按钮(通过自定义 .liquid-glass 毛玻璃效果实现)、以及 Instrument Serif 展示字体搭配深海军蓝主题。CSS 关键帧驱动的淡入上升入场动画带有交错延迟,在加载时呈现出精致的揭示效果,使其成为创意机构、作品集网站和编辑着陆页的理想模板。
工作流程
- 将
example.html克隆到用户工作区作为工作文件。 - 替换占位内容,使用用户真实的品牌名称、标题、正文、数据和图像。交换资源时,请匹配现有图像尺寸。
- 保留设计系统。 下方构建规范中的调色板、字体比例、间距节奏和动效是该设计的核心——不要替换字体、重新着色或移除装饰元素。
- 通过复制区块来扩展,绝不要从其他模板导入布局。如果缺少某个区块,请在该模板自身的视觉语汇下从头设计。
- 保持动效可访问。 按照构建规范的要求,每个动画都必须包含在
prefers-reduced-motion媒体查询之后。
输出约定
在 <artifact> 标签之间输出:
<artifact identifier="velorah-hero-landing" type="text/html" title="Velorah — 电影级英雄登陆区">
<!doctype html>
<html>...</html>
</artifact>
构建规范
以下是最终产生此设计的原始提示,逐字保留。
Velorah — 电影级英雄区
概述
构建一个单页英雄区,包含全屏循环背景视频、玻璃态(“液态玻璃”)导航栏和行动号召按钮,以及电影级展示字体。布局极简且垂直居中——视频提供了所有视觉深度,不包含任何装饰性斑点、径向渐变或叠加层。
技术栈
- 框架: React 18(
react/react-dom^18.3.1)搭配 TypeScript(^5.7.3) - 构建工具: Vite(
^5.4.14),通过@vitejs/plugin-react(^4.3.4) - 样式: Tailwind CSS(
^3.4.17)搭配tailwindcss-animate(^1.0.7)、autoprefixer(^10.4.20)、postcss(^8.5.1) - UI 组件: shadcn/ui(
default样式,neutral基础色,启用 CSS 变量),基于class-variance-authority(^0.7.1)、clsx(^2.1.1)和tailwind-merge(^2.6.0) - 字体: Instrument Serif(展示)和 Inter 字重 400/500(正文),来自 Google Fonts
- 显著技术: 全屏自动播放背景视频、自定义
.liquid-glass毛玻璃效果(背景模糊 + 渐变边框遮罩)、以及带有交错延迟的 CSS 关键帧淡入上升入场动画
全局设置
HTML (index.html)
-
<html lang="en">、<meta charset="UTF-8" />、视口 metawidth=device-width, initial-scale=1.0。 -
<meta name="theme-color" content="#002b42" /> -
Meta 描述:
Velorah — tools for deep thinkers, bold creators, and quiet rebels. Digital spaces for sharp focus and inspired work. -
预连接到
https://fonts.googleapis.com和https://fonts.gstatic.com(后者需加crossorigin)。 -
通过样式表链接加载 Google Fonts:
<link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500&display=swap" rel="stylesheet" /> -
<title>Velorah — Where dreams rise through the silence.</title> -
Body 包含
<div id="root"></div>和<script type="module" src="/src/main.tsx"></script>。
字体
- CSS 变量:
--font-display: 'Instrument Serif', serif;和--font-body: 'Inter', sans-serif;。 - Body 使用
font-family: var(--font-body);。 - 标题使用内联样式
fontFamily: "'Instrument Serif', serif"(定义为常量displayFont并复用)。 - Tailwind
fontFamily扩展映射display: "var(--font-display)"和body: "var(--font-body)"。
入口点 (src/main.tsx)
import { StrictMode } from "react"
import { createRoot } from "react-dom/client"
import App from "./App"
import "./index.css"
createRoot(document.getElementById("root")!).render(
<StrictMode>
<App />
</StrictMode>
)
Vite (vite.config.ts)
使用 @vitejs/plugin-react 和一个指向 ./src 的 @ 别名:
import path from "node:path"
import react from "@vitejs/plugin-react"
import { defineConfig } from "vite"
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(import.meta.dirname, "./src"),
},
},
})
PostCSS (postcss.config.js)
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
调色板
定义为 CSS 变量(HSL 通道值)的深色主题,在 :root 中定义(在 Tailwind 配置中通过 hsl(var(--token)) 使用):
--background: 201 100% 13%(深海军蓝)--foreground: 0 0% 100%(白色)--muted-foreground: 240 4% 66%(柔灰)--primary: 0 0% 100%,--primary-foreground: 0 0% 4%--secondary: 0 0% 10%,--secondary-foreground: 0 0% 100%--muted: 0 0% 10%--accent: 0 0% 10%,--accent-foreground: 0 0% 100%--border: 0 0% 18%,--input: 0 0% 18%--ring: 0 0% 100%--radius: 0.5rem
基础层规则:
*获得@apply border-border;。body获得@apply bg-background text-foreground antialiased;加上font-family: var(--font-body);。::selection使用background: hsl(var(--foreground) / 0.92);和color: hsl(var(--background));。
Tailwind 配置 (tailwind.config.ts)
darkMode: ["class"],content: ["./index.html", "./src/**/*.{ts,tsx}"],plugins: [animate](来自tailwindcss-animate)。theme.extend.colors将每个 token 映射到hsl(var(--token)),其中primary、secondary、muted和accent分别暴露DEFAULT和foreground。theme.extend.borderRadius:lg: "var(--radius)",md: "calc(var(--radius) - 2px)",sm: "calc(var(--radius) - 4px)"。
布局 (src/App.tsx)
根容器:relative flex min-h-screen flex-col overflow-hidden bg-background。
视频背景
一个全屏 <video> 元素,作为根容器内的第一个元素:
- 类名:
absolute inset-0 z-0 h-full w-full object-cover。 - 属性:
autoPlay、loop、muted、playsInline,加上aria-hidden="true"和tabIndex={-1}以确保可访问性。 - 资源(
VIDEO_SRC常量),作为本地资源提供:/assets/hf_20260314_131748_f2ca2a28-fed7-44c8-b9a9-bd9acdd5ec31.mp4。
注意:该资源已本地化,位于
public/assets/目录下。它最初来自一个 CloudFront URL(https://d8j0ntlcm91z4.cloudfront.net/user_38xzzbokvigwjottwixh07lwa1p/hf_20260314_131748_f2ca2a28-fed7-44c8-b9a9-bd9acdd5ec31.mp4);重新构建时应引用源码中使用的本地/assets/...路径。此处的主机和协议已转换为小写;路径段从源文件名原样保留。
导航栏 (<header>)
- 容器:
relative z-10 mx-auto flex w-full max-w-7xl flex-row items-center justify-between px-8 py-6。 - Logo: 一个
<a href="/">,包含Velorah®,其中®是一个<sup className="text-xs">®</sup>。类名text-3xl tracking-tight text-foreground,使用displayFont(Instrument Serif)样式,aria-label="Velorah home"。 - 导航链接: 一个
<nav className="hidden items-center gap-9 md:flex" aria-label="Primary">(在移动端隐藏,在md断点显示)。- 第一个链接 Home:
<a href="/">,带text-sm text-foreground transition-colors和aria-current="page"(活动状态)。 - 其余链接来自
NAV_LINKS = ["Studio", "About", "Journal", "Reach Us"]数组,每个渲染为<a>,带href={#${label.toLowerCase().replace(/\s+/g, "-")}}和类名text-sm text-muted-foreground transition-colors hover:text-foreground。
- 第一个链接 Home:
- CTA 按钮: shadcn
Button,使用variant="glass"和size="pill",标签Begin Journey,额外类名px-6 py-2.5 text-sm text-foreground hover:scale-[1.03]。
英雄区 (<main>)
- 容器:
relative z-10 flex flex-1 flex-col items-center justify-center px-6 pb-40 pt-32 text-center py-[90px]。 - 标题 (
<h1>):- 类名:
animate-fade-rise max-w-7xl text-5xl font-normal leading-[0.95] tracking-[-2.46px] sm:text-7xl sm:leading-[0.95] md:text-8xl md:leading-[0.95],使用displayFont(Instrument Serif)样式。 - 文案:
Where dreams rise through the silence.——其中dreams和through the silence.分别用<em className="not-italic text-muted-foreground">包裹,以实现颜色对比(直立显示,柔灰色)。
- 类名:
- 副文本 (
<p>):- 类名:
animate-fade-rise-delay mt-8 max-w-2xl text-base leading-relaxed text-muted-foreground sm:text-lg。 - 文案:
We're designing tools for deep thinkers, bold creators, and quiet rebels. Amid the chaos, we build digital spaces for sharp focus and inspired work.(使用’实体表示“We're”中的撇号)。
- 类名:
- CTA 按钮: shadcn
Button,使用variant="glass"和size="pill",标签Begin Journey,额外类名animate-fade-rise-delay-2 mt-12 cursor-pointer px-14 py-5 text-base text-foreground hover:scale-[1.03]。
App 常量
const VIDEO_SRC =
"/assets/hf_20260314_131748_f2ca2a28-fed7-44c8-b9a9-bd9acdd5ec31.mp4"
const NAV_LINKS = ["Studio", "About", "Journal", "Reach Us"]
const displayFont = { fontFamily: "'Instrument Serif', serif" }
按钮组件 (src/components/ui/button.tsx)
一个 shadcn/ui Button,使用 class-variance-authority 构建,通过 cn 辅助函数转发 ref 和合并类名。
- 基础类名:
inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50。 - 变体:
default:bg-primary text-primary-foreground transition-colors hover:bg-primary/90secondary:bg-secondary text-secondary-foreground transition-colors hover:bg-secondary/80ghost:transition-colors hover:bg-accent hover:text-accent-foregroundglass:liquid-glass text-foreground transition-transform duration-300 ease-out will-change-transform
- 尺寸:
default:h-10 rounded-md px-4 py-2sm:h-9 rounded-md px-3lg:h-11 rounded-md px-8pill:rounded-full
- 默认变体:
variant: "default",size: "default"。
import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50",
{
variants: {
variant: {
default:
"bg-primary text-primary-foreground transition-colors hover:bg-primary/90",
secondary:
"bg-secondary text-secondary-foreground transition-colors hover:bg-secondary/80",
ghost:
"transition-colors hover:bg-accent hover:text-accent-foreground",
glass:
"liquid-glass text-foreground transition-transform duration-300 ease-out will-change-transform",
},
size: {
default: "h-10 rounded-md px-4 py-2",
sm: "h-9 rounded-md px-3",
lg: "h-11 rounded-md px-8",
pill: "rounded-full",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
)
cn 辅助函数 (src/lib/utils.ts)
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
液态玻璃效果
一个自定义的 .liquid-glass 组件类(在 @layer components 中定义)提供了毛玻璃外观:近透明的白色填充,具有亮度混合模式、4px 背景模糊、内高光阴影,以及通过蒙版 ::before 伪元素渲染的渐变“边框”。
.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;
}
动画
基于关键帧的淡入上升入场动画(在 @layer utilities 中定义),每个动画运行 0.8s ease-out,使用 both 填充模式,并带有交错延迟。在 prefers-reduced-motion: reduce 条件下,动画会被禁用。
@keyframes fade-rise {
from { opacity: 0; transform: translateY(24px); }
to { opacity: 1; transform: translateY(0); }
}
.animate-fade-rise { animation: fade-rise 0.8s ease-out both; }
.animate-fade-rise-delay { animation: fade-rise 0.8s ease-out 0.2s both; }
.animate-fade-rise-delay-2 { animation: fade-rise 0.8s ease-out 0.4s both; }
@media (prefers-reduced-motion: reduce) {
.animate-fade-rise,
.animate-fade-rise-delay,
.animate-fade-rise-delay-2 {
animation: none;
}
}
应用说明:
- 标题使用
animate-fade-rise——立即出现。 - 副文本使用
animate-fade-rise-delay——200ms 后出现。 - CTA 按钮使用
animate-fade-rise-delay-2——400ms 后出现。