expressive-style-guide
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese快速参考
Quick Reference
| 要素 | 规范 |
|---|---|
| 背景色 | |
| 前景色 | |
| 强调色 | |
| 圆角 | |
| 动效引擎 | Framer Motion, Spring Physics 优先 |
| 视觉模式 | 聚光灯 / 视差 / 形变 / 氛围渐变 / 遮罩揭示 / 浮层玻璃 / 动态排版 (可组合) |
| 对比度 | WCAG AA (≥4.5:1),暗色背景上的文本必须达标 |
| 硬编码 Hex | 禁止 — 组件层严格使用语义 Token |
| Element | Specification |
|---|---|
| Background Color | |
| Foreground Color | |
| Accent Color | |
| Border Radius | |
| Animation Engine | Framer Motion, Spring Physics preferred |
| Visual Patterns | Spotlight / Parallax / Morph / Ambient Gradient / Mask Reveal / Frosted Overlay / Kinetic Typography (combinable) |
| Contrast | WCAG AA (≥4.5:1), text on dark backgrounds must meet the standard |
| Hardcoded Hex | Forbidden — Strictly use semantic Tokens at component layer |
核心指令 (Core Mandate)
Core Mandate
本规范旨在构建 "影院级质感 (Cinematic UI)" 或 "动效极简主义 (Kinetic Minimalism)"。核心在于将界面视为一个受控的摄影舞台,利用光影、材质和摄像机逻辑(运镜)将数字内容提升至艺术品高度。
强制技术栈 (Hard Constraints):
- UI 库: (仅作为底层结构,必须通过
shadcn/ui合并样式进行视觉提纯,严禁硬编码样式覆盖系统 Token)。cn() - 样式引擎: (严格使用语义化 Token 类,在 CSS Variables 层定义影院色彩)。
Tailwind CSS - 动效库: (核心引擎。Spring Physics 为首选驱动,辅以滚动驱动和视差动效)。
Framer Motion
This specification aims to build "Cinematic UI" or "Kinetic Minimalism". The core is to treat the interface as a controlled photographic stage, using light and shadow, materials, and camera logic (camera movement) to elevate digital content to the level of art.
Hard Constraints:
- UI Library: (Only used as underlying structure, must purify visuals by merging styles via
shadcn/ui, hardcoded style overrides of system Tokens are strictly prohibited).cn() - Styling Engine: (Strictly use semantic Token classes, define cinematic colors in CSS Variables layer).
Tailwind CSS - Animation Library: (Core engine. Spring Physics is the preferred driver, supplemented by scroll-driven and parallax animations).
Framer Motion
一、设计哲学:电影感的虚无 (Cinematic Void)
I. Design Philosophy: Cinematic Void
- 内容即英雄 (Content as Hero): 界面必须绝对退后。除了内容(图片、音乐、艺术品)本身,所有装饰性元素都应被剥离。
- 黑暗画布 (The Dark Canvas): 背景通过 CSS Variables 定义近黑色调 (),组件层使用
--background。利用极高的动态范围,让局部光照产生戏剧性的对比。bg-background - 舞台级运镜 (Camera Work): 动画不应是"跳动"或"回弹",而是"平滑的滑轨 (Dolly Zoom)"或"形变 (Morph)"。
- 质感的触觉 (Tactile Material): 界面对象应具有质量感和表面反光,模拟物理实体在暗房中的质感。
- Content as Hero: The interface must absolutely recede. All decorative elements should be stripped away except for the content itself (images, music, artworks).
- The Dark Canvas: Background uses a near-black tone defined in CSS Variables (), and components use
--background. Utilize extremely high dynamic range to create dramatic contrast with local lighting.bg-background - Camera Work: Animations should not be "jumpy" or "bouncy", but rather "smooth dolly zoom" or "morph".
- Tactile Material: Interface objects should have a sense of mass and surface reflection, simulating the texture of physical entities in a darkroom.
二、基础系统 (System Foundations)
II. System Foundations
1. Token 化色彩系统 (Cinematic Color Tokens)
1. Cinematic Color Tokens
原则: 所有色彩在 CSS Variables 层定义,组件层严格使用 Tailwind 语义类。禁止在组件代码中出现任何硬编码 Hex 值。
CSS Variables 定义(影院色调):
css
:root {
/* 影院场景下 Light Mode 极少使用,但必须定义 */
--background: 0 0% 98%; /* 近白 */
--foreground: 0 0% 4%; /* 近黑 */
--card: 0 0% 96%;
--card-foreground: 0 0% 4%;
--primary: 220 90% 56%; /* 品牌强调色 */
--primary-foreground: 0 0% 98%;
--secondary: 0 0% 92%;
--secondary-foreground: 0 0% 10%;
--muted: 0 0% 90%;
--muted-foreground: 0 0% 40%;
--accent: 0 0% 92%;
--accent-foreground: 0 0% 10%;
--border: 0 0% 85%;
--ring: 220 90% 56%;
}
.dark {
/* 影院核心色调 — 近黑高对比 */
--background: 0 0% 2%; /* 近纯黑画布 */
--foreground: 0 0% 95%; /* 高亮白前景 */
--card: 0 0% 4%; /* 卡片微提亮 */
--card-foreground: 0 0% 92%;
--primary: 220 85% 65%; /* 光谱偏移后的强调色 */
--primary-foreground: 0 0% 2%;
--secondary: 0 0% 8%;
--secondary-foreground: 0 0% 88%;
--muted: 0 0% 12%;
--muted-foreground: 0 0% 55%;
--accent: 0 0% 10%;
--accent-foreground: 0 0% 90%;
--border: 0 0% 14%; /* 极微弱边界 */
--ring: 220 85% 65%;
}组件层用法示例:
tsx
// ✅ 正确 — 使用语义 Token
<div className="bg-background text-foreground">
<div className="bg-card border-border">
<span className="text-muted-foreground">
// ❌ 禁止 — 硬编码 Hex
<div className="bg-[#030303] text-[#ffffff]">
<div style={{ background: '#000000' }}>Principle: All colors are defined in the CSS Variables layer, and components strictly use Tailwind semantic classes. Hardcoded Hex values are strictly prohibited in component code.
CSS Variables Definition (Cinematic Tones):
css
:root {
/* Light Mode is rarely used in cinematic scenarios but must be defined */
--background: 0 0% 98%; /* Near-white */
--foreground: 0 0% 4%; /* Near-black */
--card: 0 0% 96%;
--card-foreground: 0 0% 4%;
--primary: 220 90% 56%; /* Brand accent color */
--primary-foreground: 0 0% 98%;
--secondary: 0 0% 92%;
--secondary-foreground: 0 0% 10%;
--muted: 0 0% 90%;
--muted-foreground: 0 0% 40%;
--accent: 0 0% 92%;
--accent-foreground: 0 0% 10%;
--border: 0 0% 85%;
--ring: 220 90% 56%;
}
.dark {
/* Cinematic core palette - near-black high contrast */
--background: 0 0% 2%; /* Near-pure black canvas */
--foreground: 0 0% 95%; /* Highlighted white foreground */
--card: 0 0% 4%; /* Slightly brightened card */
--card-foreground: 0 0% 92%;
--primary: 220 85% 65%; /* Accent color after spectral shift */
--primary-foreground: 0 0% 2%;
--secondary: 0 0% 8%;
--secondary-foreground: 0 0% 88%;
--muted: 0 0% 12%;
--muted-foreground: 0 0% 55%;
--accent: 0 0% 10%;
--accent-foreground: 0 0% 90%;
--border: 0 0% 14%; /* Extremely subtle border */
--ring: 220 85% 65%;
}Component Layer Usage Example:
tsx
// ✅ Correct — Use semantic tokens
<div className="bg-background text-foreground">
<div className="bg-card border-border">
<span className="text-muted-foreground">
// ❌ Forbidden — Hardcoded Hex
<div className="bg-[#030303] text-[#ffffff]">
<div style={{ background: '#000000' }}>2. 光影与反光 (Cinematic Lighting)
2. Cinematic Lighting
光影效果通过 Token 化的 和 表达,禁止硬编码 RGBA。
borderopacity- 抛光边框 (Reflective Sheen): 卡片顶部的微弱反光使用 Token 化边框:
- Primary Sheen: (顶部边缘高亮)
border-t border-foreground/20 - Ambient Border: (整体微弱边界)
border border-border
- Primary Sheen:
- 氛围灯 (Ambient Glow): 仅在极其克制的场景下使用背景模糊光晕,不透明度控制在 5-8%:
- 或
bg-primary/5作为内容的氛围背景bg-primary/8
- 模糊层级: 弹出层使用 配合语义背景色:
backdrop-blur-xlbg-background/80 backdrop-blur-xl
Light and shadow effects are expressed through tokenized and , hardcoded RGBA is forbidden.
borderopacity- Reflective Sheen: Subtle reflection on card top uses tokenized border:
- Primary Sheen: (Highlighted top edge)
border-t border-foreground/20 - Ambient Border: (Overall subtle border)
border border-border
- Primary Sheen:
- Ambient Glow: Use background blur halo only in extremely restrained scenarios, with opacity controlled at 5-8%:
- or
bg-primary/5as ambient background for contentbg-primary/8
- Blur Layers: Popups use with semantic background color:
backdrop-blur-xlbg-background/80 backdrop-blur-xl
3. 动效物理学 (Kinetic Physics)
3. Kinetic Physics
Spring Physics(交互驱动)
Spring Physics (Interaction-driven)
-
运镜 (Dolly/Morph): 针对布局切换,追求稳重与连贯。ts
const dolly = { type: "spring", stiffness: 280, damping: 28, mass: 1 }; -
触感 (Tactile Precision): 针对微交互(点击、悬停),快速且无波动。ts
const tactile = { type: "spring", stiffness: 380, damping: 30, mass: 0.8 }; -
渐现 (Reveal): 针对新元素入场,使用平滑的 Expo 公式。ts
const reveal = { duration: 1, ease: [0.16, 1, 0.3, 1] };
-
Camera Movement (Dolly/Morph): For layout switching, pursue stability and coherence.ts
const dolly = { type: "spring", stiffness: 280, damping: 28, mass: 1 }; -
Tactile Precision: For micro-interactions (clicks, hovers), fast and without oscillation.ts
const tactile = { type: "spring", stiffness: 380, damping: 30, mass: 0.8 }; -
Reveal: For new element entry, use smooth Expo easing.ts
const reveal = { duration: 1, ease: [0.16, 1, 0.3, 1] };
滚动驱动动效 (Scroll-Driven)
Scroll-Driven Animations
-
视差滚动: 通过+
useScroll实现前景/背景差速移动。useTransformtsconst { scrollYProgress } = useScroll({ target: ref }); const y = useTransform(scrollYProgress, [0, 1], ["0%", "-20%"]); -
遮罩揭示: 通过驱动
scrollYProgress或clipPath渐现。opacitytsconst opacity = useTransform(scrollYProgress, [0.2, 0.6], [0, 1]); const clipPath = useTransform(scrollYProgress, [0, 1], ["inset(100% 0 0 0)", "inset(0% 0 0 0)"] );
-
Parallax Scrolling: Achieve differential movement between foreground/background via+
useScroll.useTransformtsconst { scrollYProgress } = useScroll({ target: ref }); const y = useTransform(scrollYProgress, [0, 1], ["0%", "-20%"]); -
Mask Reveal: Driveor
clipPathreveal viaopacity.scrollYProgresstsconst opacity = useTransform(scrollYProgress, [0.2, 0.6], [0, 1]); const clipPath = useTransform(scrollYProgress, [0, 1], ["inset(100% 0 0 0)", "inset(0% 0 0 0)"] );
入场编排 (Stagger Orchestration)
Stagger Orchestration
-
列表/网格子元素使用实现级联入场:
staggerChildrentsconst container = { animate: { transition: { staggerChildren: 0.08 } } }; const item = { initial: { opacity: 0, y: 24 }, animate: { opacity: 1, y: 0, transition: reveal } };
-
List/grid child elements usefor cascading entry:
staggerChildrentsconst container = { animate: { transition: { staggerChildren: 0.08 } } }; const item = { initial: { opacity: 0, y: 24 }, animate: { opacity: 1, y: 0, transition: reveal } };
4. 影院排版 (Display Typography)
4. Display Typography
- Display Heading: 标题应具有戏剧性的对比力。
- Scale: 至
text-5xl。text-9xl - Tracking: (-0.05em+)。
tracking-tighter - Color: (严禁硬编码白色)。
text-foreground
- Scale:
- Mono Secondary: 所有辅助信息(年代、元数据)强制使用 Mono 字体,增强工业精密感。
- Font: 或
JetBrains Mono。Geist Mono - Color: 。
text-muted-foreground
- Font:
- 正文: 行高 (1.625),确保暗色背景下的可读性。
leading-relaxed
- Display Heading: Headings should have dramatic contrast.
- Scale: to
text-5xl.text-9xl - Tracking: (-0.05em+).
tracking-tighter - Color: (Hardcoded white is strictly prohibited).
text-foreground
- Scale:
- Mono Secondary: All auxiliary information (year, metadata) must use Mono fonts to enhance industrial precision.
- Font: or
JetBrains Mono.Geist Mono - Color: .
text-muted-foreground
- Font:
- Body Text: Line height (1.625) to ensure readability on dark backgrounds.
leading-relaxed
三、视觉模式菜单 (Visual Mode Palette)
III. Visual Mode Palette
以下模式可独立使用或组合叠加,根据内容类型选择最佳搭配。避免在单一项目中滥用所有模式 — 选择 2-3 种建立统一的视觉语言。
The following modes can be used independently or combined and layered. Choose the best combination based on content type. Avoid overusing all modes in a single project — select 2-3 to establish a unified visual language.
1. 聚光灯 (Spotlight)
1. Spotlight
鼠标追踪的局部照明,让内容从黑暗中浮现。
- 通过 +
useMotionTemplate追踪鼠标坐标生成useMotionValue。radial-gradient - 光圈半径 240-320px,仅受光区域显示边框和精细纹理。
- 适用: 卡片网格、作品画廊、功能展示。
Mouse-tracking local lighting that makes content emerge from darkness.
- Track mouse coordinates via +
useMotionTemplateto generateuseMotionValue.radial-gradient - Aperture radius 240-320px, only the illuminated area displays borders and fine textures.
- Suitable for: Card grids, art galleries, feature showcases.
2. 视差滚动 (Parallax Depth)
2. Parallax Depth
前景/背景分层差速移动,创造空间纵深感。
- 背景层以 0.3-0.5 倍速跟随滚动,前景以 1.0 倍速。
- 通过 +
useScroll映射useTransform。translateY - 可叠加 变换模拟"推近 (Dolly In)"。
scale - 适用: Landing Page Hero、长滚动叙事、产品展示。
Differential movement between foreground/background layers creates spatial depth.
- Background layer follows scroll at 0.3-0.5x speed, foreground at 1.0x speed.
- Map via
translateY+useScroll.useTransform - Can be combined with transform to simulate "dolly in".
scale - Suitable for: Landing Page Hero, long-scroll narratives, product showcases.
3. 形变过渡 (Morph Transition)
3. Morph Transition
元素间的形态插值,建立空间连续性。
- 强制使用 Framer Motion 的 实现跨视图无缝变形。
layoutId - 封面图在缩略图 → 详情页间进行尺寸/位置/圆角的连续插值。
- 搭配 确保退出动画完整。
AnimatePresence - 适用: 详情展开、导航切换、状态过渡。
Morph interpolation between elements establishes spatial continuity.
- Mandatory use of Framer Motion's to achieve seamless cross-view deformation.
layoutId - Cover images perform continuous interpolation of size/position/border-radius between thumbnail → detail page.
- Combine with to ensure complete exit animations.
AnimatePresence - Suitable for: Detail expansion, navigation switching, state transitions.
4. 氛围渐变 (Ambient Gradient)
4. Ambient Gradient
低饱和度动态渐变背景,营造沉浸氛围。
- 使用 搭配 Token 化色彩:
bg-gradient-to-*。from-background via-muted/10 to-background - 可通过 缓慢循环渐变角度或位置 (duration: 8-15s)。
animate - 饱和度严格控制在 5-15%,禁止高饱和渐变。
- 适用: 音乐播放器背景、品牌页氛围、加载状态。
Low-saturation dynamic gradient background creates immersive atmosphere.
- Use with tokenized colors:
bg-gradient-to-*.from-background via-muted/10 to-background - Can slowly cycle gradient angle or position via (duration: 8-15s).
animate - Saturation is strictly controlled at 5-15%, high-saturation gradients are forbidden.
- Suitable for: Music player backgrounds, brand page atmosphere, loading states.
5. 遮罩揭示 (Mask Reveal)
5. Mask Reveal
滚动驱动的内容渐现,创造戏剧性的揭幕效果。
- 通过 动画实现几何形状的展开揭示。
clipPath - 支持多种揭示形态:垂直擦除、中心圆扩、对角线切入。
- 搭配 过渡防止硬边闪烁。
opacity - 适用: 章节入场、图片展示、时间线节点。
Scroll-driven content reveal creates dramatic unveiling effects.
- Achieve geometric shape reveal via animation.
clipPath - Supports multiple reveal forms: vertical wipe, central circle expansion, diagonal cut-in.
- Combine with transition to prevent hard-edge flicker.
opacity - Suitable for: Section entry, image showcases, timeline nodes.
6. 浮层玻璃 (Frosted Overlay)
6. Frosted Overlay
毛玻璃面板 + 景深模糊,建立层级与聚焦。
- 面板使用 。
bg-background/60 backdrop-blur-xl border border-border - 背景层同步应用 +
scale(1.02)模拟景深。blur(4px) - 浮层入场使用 spring 参数,退场使用
dolly参数。reveal - 适用: Modal/Dialog、侧边栏、详情弹出面板。
Frosted glass panel + depth-of-field blur establishes hierarchy and focus.
- Panel uses .
bg-background/60 backdrop-blur-xl border border-border - Background layer simultaneously applies +
scale(1.02)to simulate depth of field.blur(4px) - Overlay entry uses spring parameters, exit uses
dollyparameters.reveal - Suitable for: Modal/Dialog, sidebar, detail pop-up panels.
7. 微动态排版 (Kinetic Typography)
7. Kinetic Typography
文字入场的戏剧性编排,让排版本身成为视觉焦点。
- 标题逐字/逐词入场,通过 级联。
staggerChildren: 0.03-0.06 - 每个字符独立应用 +
opacity+y过渡。filter: blur() - 大标题可叠加 从 1.1 → 1.0 的微缩放。
scale - 适用: Hero 标题、品牌宣言、章节标题。
Dramatic orchestration of text entry makes typography itself a visual focus.
- Headings enter character-by-character or word-by-word, cascaded via .
staggerChildren: 0.03-0.06 - Each character independently applies +
opacity+ytransitions.filter: blur() - Large headings can be combined with a slight scale transform from 1.1 → 1.0.
- Suitable for: Hero headings, brand declarations, section titles.
四、组件实现 (Implementation Specs)
IV. Implementation Specs
shadcn/ui 影院化改造 (Cinematic Overrides)
Cinematic Overrides for shadcn/ui
所有改造通过 合并样式,使用语义 Token,禁止硬编码颜色值。
cn()All modifications merge styles via , use semantic tokens, and hardcoded color values are forbidden.
cn()Button
Button
tsx
// Primary — 高对比动作按钮
<Button className={cn(
"bg-primary text-primary-foreground",
"rounded-lg tracking-wide font-medium",
"transition-none" // 由 Framer Motion 接管
)}>
<motion.span whileTap={{ scale: 0.97 }} transition={tactile}>
Action
</motion.span>
</Button>
// Ghost — 影院幽灵按钮
<Button variant="ghost" className={cn(
"text-muted-foreground hover:text-foreground",
"hover:bg-accent/50"
)}>
Secondary
</Button>tsx
// Primary — High-contrast action button
<Button className={cn(
"bg-primary text-primary-foreground",
"rounded-lg tracking-wide font-medium",
"transition-none" // Handled by Framer Motion
)}>
<motion.span whileTap={{ scale: 0.97 }} transition={tactile}>
Action
</motion.span>
</Button>
// Ghost — Cinematic ghost button
<Button variant="ghost" className={cn(
"text-muted-foreground hover:text-foreground",
"hover:bg-accent/50"
)}>
Secondary
</Button>Card (影院卡片)
Card (Cinematic Card)
tsx
<motion.div className={cn(
"bg-card border border-border rounded-xl overflow-hidden",
"border-t-foreground/15" // 顶部反光 Sheen
)}>
{/* 封面图默认降低亮度,交互时恢复 */}
<motion.img
className="w-full object-cover brightness-[0.6]"
whileHover={{ brightness: 1 }}
/>
<div className="p-6">
<h3 className="text-foreground text-lg font-semibold tracking-tight">
{title}
</h3>
<p className="text-muted-foreground text-sm font-mono mt-1">
{metadata}
</p>
</div>
</motion.div>tsx
<motion.div className={cn(
"bg-card border border-border rounded-xl overflow-hidden",
"border-t-foreground/15" // Top reflective sheen
)}>
{/* Cover image defaults to reduced brightness, restores on interaction */}
<motion.img
className="w-full object-cover brightness-[0.6]"
whileHover={{ brightness: 1 }}
/>
<div className="p-6">
<h3 className="text-foreground text-lg font-semibold tracking-tight">
{title}
</h3>
<p className="text-muted-foreground text-sm font-mono mt-1">
{metadata}
</p>
</div>
</motion.div>Dialog (影院弹出层)
Dialog (Cinematic Popup)
tsx
<Dialog>
<DialogOverlay className={cn(
"bg-background/80 backdrop-blur-xl"
)} />
<DialogContent className={cn(
"bg-card border border-border rounded-xl",
"shadow-none"
)}>
{/* 内容使用 AnimatePresence 编排入场 */}
<AnimatePresence mode="wait">
<motion.div
initial={{ opacity: 0, y: 16 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -8 }}
transition={dolly}
>
{children}
</motion.div>
</AnimatePresence>
</DialogContent>
</Dialog>tsx
<Dialog>
<DialogOverlay className={cn(
"bg-background/80 backdrop-blur-xl"
)} />
<DialogContent className={cn(
"bg-card border border-border rounded-xl",
"shadow-none"
)}>
{/* Content uses AnimatePresence for entry orchestration */}
<AnimatePresence mode="wait">
<motion.div
initial={{ opacity: 0, y: 16 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -8 }}
transition={dolly}
>
{children}
</motion.div>
</AnimatePresence>
</DialogContent>
</Dialog>Navigation (影院导航)
Navigation (Cinematic Navigation)
tsx
<nav className={cn(
"fixed top-0 w-full z-50",
"bg-background/60 backdrop-blur-lg border-b border-border"
)}>
<div className="flex items-center justify-between px-8 h-16">
<span className="text-foreground font-semibold tracking-tight">
{brand}
</span>
<div className="flex gap-6 text-muted-foreground">
{links.map(link => (
<motion.a
key={link.href}
className="hover:text-foreground transition-colors"
whileHover={{ y: -1 }}
transition={tactile}
>
{link.label}
</motion.a>
))}
</div>
</div>
</nav>tsx
<nav className={cn(
"fixed top-0 w-full z-50",
"bg-background/60 backdrop-blur-lg border-b border-border"
)}>
<div className="flex items-center justify-between px-8 h-16">
<span className="text-foreground font-semibold tracking-tight">
{brand}
</span>
<div className="flex gap-6 text-muted-foreground">
{links.map(link => (
<motion.a
key={link.href}
className="hover:text-foreground transition-colors"
whileHover={{ y: -1 }}
transition={tactile}
>
{link.label}
</motion.a>
))}
</div>
</div>
</nav>非对称 Bento 网格 (Asymmetric Grid)
Asymmetric Bento Grid
网格打破等宽单调性,创造视觉节奏:
- Hero Item: — 主视觉焦点。
col-span-2 row-span-2 - Vertical/Square: 交错排列,创造视觉节奏。
- Gap: 或
gap-4,使用 Token 化间距。gap-6 - Mobile: 间距折半 (),但保持足够的内衬空间 (
gap-2)。p-4
tsx
<div className="grid grid-cols-2 md:grid-cols-4 gap-4 md:gap-6">
<div className="col-span-2 row-span-2">{/* Hero Card */}</div>
<div className="col-span-1">{/* Vertical Card */}</div>
<div className="col-span-1">{/* Square Card */}</div>
</div>The grid breaks equal-width monotony to create visual rhythm:
- Hero Item: — Main visual focus.
col-span-2 row-span-2 - Vertical/Square: Staggered arrangement to create visual rhythm.
- Gap: or
gap-4, use tokenized spacing.gap-6 - Mobile: Halve the spacing (), but maintain sufficient padding (
gap-2).p-4
tsx
<div className="grid grid-cols-2 md:grid-cols-4 gap-4 md:gap-6">
<div className="col-span-2 row-span-2">{/* Hero Card */}</div>
<div className="col-span-1">{/* Vertical Card */}</div>
<div className="col-span-1">{/* Square Card */}</div>
</div>共享元素跳转 (Shared Element Transition)
Shared Element Transition
- 强制使用 Framer Motion 的 。
layoutId - 封面图必须在形态间进行无缝插值过渡,严禁出现页面间的瞬间闪烁或硬切。
- 搭配 管理组件生命周期。
AnimatePresence
tsx
<motion.div layoutId={`card-${id}`} transition={dolly}>
<motion.img layoutId={`image-${id}`} src={cover} />
</motion.div>- Mandatory use of Framer Motion's .
layoutId - Cover images must perform seamless interpolation transitions between forms, and instant flicker or hard cuts between pages are strictly prohibited.
- Combine with to manage component lifecycle.
AnimatePresence
tsx
<motion.div layoutId={`card-${id}`} transition={dolly}>
<motion.img layoutId={`image-${id}`} src={cover} />
</motion.div>五、代码审查清单 (The Cinematic Audit)
V. The Cinematic Audit
Token 合规
Token Compliance
- Token Check — 组件代码中是否存在硬编码 Hex (如 ,
#030303)?所有颜色是否使用#ffffff/bg-background/text-foreground等语义类?border-border - CSS Variable Check — 影院色调是否在 /
:root的 CSS Variables 中正确定义?.dark
- Token Check — Are there hardcoded Hex values (e.g., ,
#030303) in component code? Do all colors use semantic classes like#ffffff/bg-background/text-foreground?border-border - CSS Variable Check — Are cinematic tones correctly defined in /
:rootCSS Variables?.dark
视觉与材质
Visual & Material
- Lighting Logic — 是否合理使用了光影效果?是否避免了全向均匀照明?
- Material Check — 所有容器是否具备顶部反光 ()?边框是否使用
border-t-foreground/15?border-border - Imagery Authenticity — 封面是否为高质量摄影或 3D 渲染?是否存在廉价的矢量或渐变占位?
- Lighting Logic — Are light and shadow effects used appropriately? Is omnidirectional uniform lighting avoided?
- Material Check — Do all containers have top reflection ()? Do borders use
border-t-foreground/15?border-border - Imagery Authenticity — Are cover images high-quality photography or 3D renders? Are there cheap vector or gradient placeholders?
动效质量
Animation Quality
- Physics Check — 交互动效是否使用 Spring Physics?是否存在线性或 ease-in-out 动画?Damping 是否足够大以保证稳定性?
- Continuity Check — 图片转换是否应用了 ?详情页入场是否使用了
layoutId?AnimatePresence - Scroll Motion Check — 是否合理使用了滚动驱动动效 (视差/遮罩揭示)?是否存在不必要的 JS 滚动监听?
- Physics Check — Do interaction animations use Spring Physics? Are there linear or ease-in-out animations? Is damping sufficient to ensure stability?
- Continuity Check — Are applied to image transitions? Does detail page entry use
layoutId?AnimatePresence - Scroll Motion Check — Are scroll-driven animations (parallax/mask reveal) used appropriately? Are there unnecessary JS scroll listeners?
模式多样性
Pattern Diversity
- Variety Check — 项目是否过度依赖单一视觉模式 (如仅使用聚光灯)?是否根据内容类型选择了 2-3 种互补模式?
- Composition Check — 多种模式叠加时,是否保持了视觉克制?是否存在过度堆叠导致的性能问题或审美疲劳?
- Variety Check — Does the project over-rely on a single visual pattern (e.g., only using spotlight)? Are 2-3 complementary patterns selected based on content type?
- Composition Check — When multiple patterns are layered, is visual restraint maintained? Are there performance issues or aesthetic fatigue caused by over-stacking?
可访问性
Accessibility
- Contrast Safety — 暗色背景上的所有文本 (尤其是 ) 对比度是否 ≥ 4.5:1?
text-muted-foreground - Motion Safety — 是否尊重 ?开启后是否禁用视差和复杂入场动画?
prefers-reduced-motion
- Contrast Safety — Does all text on dark backgrounds (especially ) meet a contrast ratio of ≥ 4.5:1?
text-muted-foreground - Motion Safety — Is respected? Are parallax and complex entry animations disabled when enabled?
prefers-reduced-motion
参考资源
Reference Resources
- 示例项目: 目录包含一个名为 Aero Music 的完整演示应用,展示了 Bento 布局、聚光灯遮罩及摄像机运镜的完整实现。
example/
- Example Project: The directory contains a complete demo app called Aero Music, showcasing the full implementation of Bento layout, spotlight mask, and camera movement.
example/
合成笔记 (Composition Notes)
Composition Notes
本节供技能在多风格融合场景中使用。定义本风格指南中哪些属性是硬约束(即使在混合模式下也不可覆盖),哪些是软约束(可由 Director 根据项目需求调整)。design-director
This section is for theskill to use in multi-style fusion scenarios. Define which attributes in this style guide are hard constraints (cannot be overridden even in mixed modes) and which are soft constraints (can be adjusted by the Director based on project needs).design-director
硬约束 (Hard Constraints — 不可覆盖)
Hard Constraints — Non-overridable
| ID | 属性 | 规范值 | 理由 |
|---|---|---|---|
| E.H1 | 动效引擎 | Framer Motion, Spring Physics 优先 | 影院质感的核心驱动,替换为 CSS transition 将失去全部视觉特征 |
| E.H2 | 暗色画布 | 深色背景作为默认画布(Expressive 区域内) | 光影戏剧感依赖于暗色基底,浅色背景无法实现聚光灯、氛围渐变等核心视觉模式 |
| E.H3 | Token 化 | 禁止硬编码 Hex,组件层使用语义 Token | 跨风格融合的基础设施,所有风格共享此约束 |
| E.H4 | 内容即英雄 | 装饰性元素必须退后于内容(图片、音乐、作品) | 本风格的核心哲学——界面退场,内容登台 |
| E.H5 | 对比度 | WCAG AA (≥4.5:1) | 无障碍强制要求,暗色背景上的浅色文字尤其需要检查 |
| ID | Attribute | Specification Value | Reason |
|---|---|---|---|
| E.H1 | Animation Engine | Framer Motion, Spring Physics preferred | Core driver of cinematic texture. Replacing with CSS transitions will lose all visual characteristics |
| E.H2 | Dark Canvas | Dark background as default canvas (within Expressive areas) | Light and shadow drama relies on dark base. Light backgrounds cannot implement core visual patterns like spotlight and ambient gradient |
| E.H3 | Tokenization | Hardcoded Hex forbidden, semantic tokens used at component layer | Infrastructure for cross-style fusion, shared by all styles |
| E.H4 | Content as Hero | Decorative elements must recede behind content (images, music, works) | Core philosophy of this style — interface recedes, content takes center stage |
| E.H5 | Contrast | WCAG AA (≥4.5:1) | Mandatory accessibility requirement, especially for light text on dark backgrounds |
软约束 (Soft Constraints — 可由 Director 覆盖)
Soft Constraints — Overridable by Director
| ID | 属性 | 默认值 | Director 可调整范围 | 触发条件 |
|---|---|---|---|---|
| E.S1 | 圆角 | | 可降至 | 当 Minimal 为项目主风格,Expressive 仅用于辅助区域时 |
| E.S2 | 动效时长上限 | 0.3–1.5s(完整影院运镜) | 上限可降至 0.8s | 当项目整体节奏偏快,或 Minimal/Swiss 为主风格时 |
| E.S3 | 色彩空间 | HSL | 可转换为 oklch | 混合项目中推荐统一使用 oklch——感知均匀性更好,渐变接缝更自然 |
| E.S4 | 暗色背景明度 | | 可提亮至 | 当需要与 Minimal/Swiss 区域统一暗色模式基准时 |
| E.S5 | 非对称 Bento 网格 | 自由非对称布局 | 可对齐到 8pt 基线网格(列宽和间距为 8px 倍数) | 当 Swiss 为项目中的任一风格,需要全局网格对齐时 |
| E.S6 | Stagger 间隔 | 0.08s | 可缩短至 0.04–0.06s | 当项目整体节奏偏快时 |
| E.S7 | 视差滚动强度 | 0.3–0.5 倍速差 | 可降至 0.1–0.2 倍速差 | 当 Minimal 为主风格,需要更克制的滚动体验时 |
| ID | Attribute | Default Value | Director Adjustable Range | Trigger Condition |
|---|---|---|---|---|
| E.S1 | Border Radius | | Can be reduced to | When Minimal is the main project style and Expressive is only used for auxiliary areas |
| E.S2 | Animation Duration Upper Limit | 0.3–1.5s (complete cinematic camera movement) | Upper limit can be reduced to 0.8s | When the overall project rhythm is fast, or Minimal/Swiss is the main style |
| E.S3 | Color Space | HSL | Can be converted to oklch | Recommended to unify with oklch in mixed projects — better perceptual uniformity, more natural gradient seams |
| E.S4 | Dark Background Lightness | | Can be brightened to | When needing to unify dark mode baseline with Minimal/Swiss areas |
| E.S5 | Asymmetric Bento Grid | Free asymmetric layout | Can be aligned to 8pt baseline grid (column width and spacing are multiples of 8px) | When Swiss is one of the project styles and global grid alignment is required |
| E.S6 | Stagger Interval | 0.08s | Can be shortened to 0.04–0.06s | When the overall project rhythm is fast |
| E.S7 | Parallax Scroll Intensity | 0.3–0.5x speed difference | Can be reduced to 0.1–0.2x speed difference | When Minimal is the main style and a more restrained scrolling experience is needed |