返回风格库
布局风格expressive

视差杂志

Parallax Editorial

有物理纵深的杂志排版。暖纸底色上,前景文字与背景层以不同速率滚动,制造真实的层叠景深;sticky 图文交错、章节编号、首字下沉,把长内容读成一场有节奏的翻页。

视差杂志视觉预览
主色#1A1712
次色#F5F0E6
强调色 1#B3401F
强调色 2#2E2A22
强调色 3#C9BBA0

AI 实现规则

你是一个视差杂志(Parallax Editorial)风格的前端开发专家。生成的所有代码必须严格遵守以下约束:

## 绝对禁止

- 在 scroll 事件里直接改 top / margin / height(重排卡顿)——视差只用 transform: translate3d
- 一屏超过 3 个视差速率层级
- 让视差压过可读性:正文永远不是视差主体,测度不超 75 字符
- 移动端保留强视差(性能 + 眩晕)
- 多个强调色;把砖红铺成大面积底色
- 冷色 / 纯白背景(失去暖纸质感)
- 省略 prefers-reduced-motion 降级

## 必须遵守

### 纸面与油墨
- 背景 #F5F0E6(暖纸),深纸 #EBE3D3
- 正文 #1A1712(近黑墨),次要 rgba(26,23,18,0.7)
- 唯一强调 #B3401F(砖红):首字下沉、章节号、引文、链接
- 沙色 #C9BBA0 作分隔 / 次要装饰

### 字体
衬线展示字体做标题(推荐 Fraunces 或 Playfair Display):
<link rel="stylesheet" href="https://fonts.loli.net/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..700;1,9..144,300..600&display=swap" />
标题 font-family: "Fraunces", Georgia, serif;正文可同族或搭配一款人文无衬线

### 视差引擎(招牌,rAF 节流)
每个视差层加 data-parallax="速率"(0.1-0.5),JS 单一 rAF 循环统一更新:
let ticking = false;
function onScroll() {
  if (ticking) return; ticking = true;
  requestAnimationFrame(() => {
    const y = window.scrollY;
    document.querySelectorAll('[data-parallax]').forEach(el => {
      const rate = parseFloat(el.dataset.parallax);
      el.style.setProperty('--pe-y', `${-y * rate}px`);   // 或按元素相对视口位置计算
    });
    ticking = false;
  });
}
window.addEventListener('scroll', onScroll, { passive: true });
CSS: [data-parallax] { transform: translate3d(0, var(--pe-y,0), 0); will-change: transform; }
背景层 rate 小(0.1-0.2),前景层 rate 大(0.35-0.5)

### sticky 图文交错
外层 grid 两栏;图像列 position: sticky; top: 0; height: 100vh,文字列正常流动,形成钉住-滚动咬合

### 编辑排版语法
- 章节:大号衬线编号(text-4xl+)+ 完整细边框 border
- 首字下沉:段落加 .pe-dropcap,::first-letter float 放大 3-4 行、砖红
- 测度:正文 max-width 65-75ch,行高 1.6-1.75
- 引文:大号斜体衬线 + 完整砖红细边框

### GSAP 配方(可选,项目已有 gsap 时优先)
import gsap from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
gsap.registerPlugin(ScrollTrigger);
gsap.utils.toArray("[data-parallax]").forEach((el) => {
  gsap.to(el, {
    yPercent: () => -30 * parseFloat(el.dataset.parallax) * 5,
    ease: "none",
    scrollTrigger: { trigger: el, start: "top bottom", end: "bottom top", scrub: true },
  });
});

### 无障碍
@media (prefers-reduced-motion: reduce) { [data-parallax] { transform: none !important; } }
所有层归零速差,变普通静态版面,阅读顺序不变

## 自检

1. 背景是暖纸、正文是墨黑、唯一砖红强调?
2. 视差只用 transform: translate3d + rAF 节流?
3. 一屏不超过 3 个速率层级?
4. 正文测度 65-75 字符、有衬线标题 / 章节号 / 首字下沉?
5. 有 sticky 图文交错?
6. 有 prefers-reduced-motion 归零降级?
7. 移动端削弱 / 关闭了视差?

组件预览与实现

group inline-flex items-center gap-2 font-serif rounded-none transition-colors duration-300 ease-out active:opacity-80 bg-[#1A1712] text-[#F5F0E6] px-6 py-3 hover:bg-[#B3401F]
button

Button

Editorial link-button with brick underline sweep

<button className="group relative inline-flex items-center gap-2
  font-serif text-[#1A1712] text-lg
  transition-colors duration-300
  hover:text-[#B3401F]
">
  <span>Read the chapter</span>
  <span className="inline-block w-8 h-px bg-[#B3401F] origin-left scale-x-100 group-hover:scale-x-150 transition-transform duration-300" />
</button>
card

Card

Chapter card with serif number and complete hairline frame

<article className="border border-[#1A1712]/20 pt-5">
  <span className="font-serif text-4xl text-[#B3401F] leading-none">03</span>
  <h3 className="font-serif text-2xl text-[#1A1712] mt-3 mb-2">The Register Shift</h3>
  <p className="text-[#1A1712]/70 leading-relaxed max-w-prose">
    When foreground and background slide out of register, the page gains the thickness of paper.
  </p>
</article>
input

Input

Underline field on paper with brick focus rule

<label className="block">
  <span className="block font-serif text-sm text-[#1A1712]/60 mb-1.5 italic">Your email</span>
  <input type="email" placeholder="reader@paper.press"
    className="w-full bg-transparent py-2.5 text-lg text-[#1A1712] placeholder-[#1A1712]/30
      border border-[#1A1712]/25
      focus:outline-none focus:border-[#B3401F]
      transition-colors duration-300" />
</label>
nav

Navigation

Masthead nav with serif wordmark and rule

<nav className="border border-[#1A1712]/15 bg-[#F5F0E6]/90 backdrop-blur-sm">
  <div className="max-w-5xl mx-auto px-6 h-16 flex items-center justify-between">
    <span className="font-serif text-xl text-[#1A1712] tracking-tight">The Paper Press</span>
    <div className="flex items-center gap-6 font-serif text-sm">
      <a href="#features" className="text-[#1A1712]/70 hover:text-[#B3401F] transition-colors duration-300">Features</a>
      <a href="#archive" className="text-[#1A1712]/70 hover:text-[#B3401F] transition-colors duration-300">Archive</a>
    </div>
  </div>
</nav>
hero

Hero

Layered parallax masthead over paper

<section className="relative min-h-screen overflow-hidden bg-[#F5F0E6] flex items-center">
  {/* Background layer (slow) */}
  <div data-parallax="0.15" className="absolute inset-0 will-change-transform">
    <span className="absolute top-24 left-8 font-serif text-[22vw] leading-none text-[#1A1712]/[0.04] select-none">1892</span>
  </div>
  {/* Midground rule (medium) */}
  <div data-parallax="0.4" className="absolute right-10 top-1/3 w-px h-64 bg-[#B3401F]/40 will-change-transform" />
  {/* Foreground text (fast, or static) */}
  <div className="relative max-w-3xl mx-auto px-6 text-center">
    <p className="font-serif italic text-[#B3401F] mb-4">Issue 001</p>
    <h1 className="font-serif text-6xl md:text-8xl text-[#1A1712] leading-[0.95]">Depth on Paper</h1>
    <p className="mt-6 text-[#1A1712]/70 text-lg max-w-xl mx-auto">Scroll, and the layers slide out of register.</p>
  </div>
</section>

交互展示

适用范围与设计理念

应用场景

editorialportfoliomarketing

视觉关键词

parallaxeditorialmagazinescrolldepthdrop capsticky视差杂志编辑排版景深滚动

视差杂志的信条:滚动是翻页,深度是版面的第四维。当前景与背景以不同速率移动,平面的网页第一次有了纸张的厚度——读者不是划过屏幕,而是穿过一叠正在错位滑动的版面。

核心理念:

- 深度即层次:背景层慢、前景层快,速差本身就是视觉层级。近的先走、远的滞后,眼睛自然读出主次

- 排版先于视差:视差是舞台不是主角。字体、栏宽、行高必须先立得住——衬线大标题、舒适的正文测度(65-75 字符/行)、清晰的章节结构

- sticky 交错:图像 sticky 钉住,文字在其上继续滚动;或反之。图文咬合像杂志的对开跨页

- 编辑信号:章节编号、首字下沉(drop cap)、悬挂标点、栏间竖线——这些是杂志的语法,不是装饰

- 克制的强调:砖红 #B3401F 只用于首字下沉、章节号、关键引文和链接,正文永远是近黑墨

- 节奏留白:大段留白是呼吸口。视差段落之间必须有安静的纯文字段落,否则晕

设计原则:

- 性能红线:视差只用 transform: translate3d(合成器层),rAF 节流,绝不在 scroll 事件里改 top/margin

- 无障碍红线:prefers-reduced-motion 下所有视差层归零速差、变成普通静态版面,阅读顺序不变

- 景深纪律:一屏最多 3 个视差速率层级,超过就浑浊

- 响应式:移动端大幅削弱或关闭视差(性能 + 眩晕),保留排版与 sticky 结构

应该这样做

  • 暖纸底色 #F5F0E6,正文近黑墨 #1A1712,营造印刷纸感
  • 衬线展示字体做大标题(如 Fraunces / Playfair),无衬线或同族做正文
  • 视差层用 transform: translate3d(0, scrollProgress * rate, 0),背景 rate 小、前景 rate 大
  • sticky 图文交错:position: sticky 钉住图像层,文字在侧栏继续滚动
  • 章节以大号衬线编号 + 完整细边框包围,建立杂志式结构
  • 首字下沉 drop cap:段落首字母 float、放大 3-4 行高、砖红 #B3401F
  • 正文测度控制在 65-75 字符/行,行高 1.6-1.75
  • 砖红 #B3401F 只用于首字、章节号、引文、链接;其余保持墨黑
  • 所有视差用 rAF 节流,写 prefers-reduced-motion 归零降级

避免这样做

  • 禁止在 scroll 事件里直接改 top / margin / height(触发重排卡顿)——视差只用 transform
  • 禁止一屏超过 3 个视差速率层级(景深浑浊)
  • 禁止让视差压过可读性:正文永远不做视差主体,测度不超 75 字符
  • 禁止移动端保留强视差(性能差 + 眩晕),应削弱或关闭
  • 禁止多个强调色,禁止把砖红铺成大面积底色
  • 禁止省略 prefers-reduced-motion 降级
  • 禁止用冷色/纯白背景(失去暖纸质感)

全局 CSS

/* Parallax Editorial Global Styles */

:root {
  --pe-ink: #1A1712;
  --pe-ink-soft: rgba(26, 23, 18, 0.7);
  --pe-paper: #F5F0E6;
  --pe-paper-deep: #EBE3D3;
  --pe-brick: #B3401F;
  --pe-sand: #C9BBA0;
  --pe-measure: 68ch;
}

body {
  background: var(--pe-paper);
  color: var(--pe-ink);
}

/* Parallax layers: JS sets --pe-y from scroll progress * rate; transform-only */
[data-parallax] {
  transform: translate3d(0, var(--pe-y, 0), 0);
  will-change: transform;
}

/* Drop cap */
.pe-dropcap::first-letter {
  float: left;
  font-family: var(--font-serif), Georgia, serif;
  font-size: 3.6em;
  line-height: 0.82;
  padding: 0.05em 0.12em 0 0;
  color: var(--pe-brick);
  font-weight: 600;
}

/* Comfortable measure for body copy */
.pe-measure {
  max-width: var(--pe-measure);
}

/* Column rule between text blocks */
.pe-rule {
  border: 1px solid rgba(26, 23, 18, 0.2);
}

@media (prefers-reduced-motion: reduce) {
  [data-parallax] {
    transform: none !important;
  }
}

布局、色板与 Tokens

主色#1A1712
次色#F5F0E6
强调色 1#B3401F
强调色 2#2E2A22
强调色 3#C9BBA0
{
  "border": {
    "width": "border",
    "color": "border-[#1A1712]/20",
    "radius": "rounded-none",
    "style": "border-solid"
  },
  "shadow": {
    "sm": "shadow-none",
    "md": "shadow-none",
    "lg": "shadow-[0_24px_60px_rgba(26,23,18,0.12)]",
    "none": "shadow-none",
    "hover": "hover:shadow-[0_30px_70px_rgba(26,23,18,0.16)]",
    "focus": "focus:shadow-none",
    "colored": {}
  },
  "interaction": {
    "transition": "transition-colors duration-300 ease-out",
    "active": "active:opacity-80",
    "hoverOpacity": "hover:text-[#B3401F]"
  },
  "typography": {
    "heading": "font-serif text-[#1A1712]",
    "body": "text-[#1A1712]/75 leading-relaxed",
    "mono": "font-mono text-[#1A1712]/55",
    "sizes": {
      "hero": "text-6xl md:text-8xl",
      "h1": "text-4xl md:text-6xl",
      "h2": "text-3xl md:text-4xl",
      "h3": "text-2xl md:text-3xl",
      "body": "text-base md:text-lg",
      "small": "text-sm"
    }
  },
  "spacing": {
    "section": "py-20 md:py-32",
    "container": "px-6 md:px-8",
    "card": "pt-5",
    "gap": {
      "sm": "gap-4",
      "md": "gap-8",
      "lg": "gap-12"
    }
  },
  "colors": {
    "background": {
      "primary": "bg-[#F5F0E6]",
      "secondary": "bg-[#EBE3D3]",
      "accent": [
        "bg-[#1A1712]"
      ]
    },
    "text": {
      "primary": "text-[#1A1712]",
      "secondary": "text-[#1A1712]/75",
      "muted": "text-[#1A1712]/50"
    },
    "button": {
      "primary": "bg-[#1A1712] text-[#F5F0E6]",
      "secondary": "bg-transparent text-[#1A1712] border border-[#1A1712]/30"
    }
  },
  "forbidden": {
    "classes": [
      "rounded-lg",
      "rounded-xl",
      "rounded-2xl",
      "rounded-full",
      "bg-white",
      "bg-black",
      "bg-slate-900",
      "bg-gray-900",
      "bg-gradient-to-r",
      "from-indigo-600",
      "via-purple-600",
      "to-pink-500",
      "font-sans"
    ],
    "patterns": [
      "^rounded-(lg|xl|2xl|3xl|full)$",
      "^bg-(white|black)$",
      "^bg-gradient-",
      "^bg-(slate|gray|zinc|blue|indigo)-(800|900)$"
    ],
    "reasons": {
      "rounded-full": "Editorial layout uses sharp printed edges, not pills",
      "bg-white": "Use warm paper #F5F0E6, never sterile pure white",
      "bg-black": "Use warm ink #1A1712 on paper, not flat black surfaces",
      "bg-gradient-to-r": "Depth comes from parallax layers, not gradients",
      "from-indigo-600": "No AI-cliche gradients; warm paper, ink and one brick-red accent",
      "font-sans": "Headings and structure lean on a serif display face"
    }
  },
  "required": {
    "button": [
      "font-serif",
      "transition-colors duration-300",
      "hover:text-[#B3401F]"
    ],
    "card": [
      "border border-[#1A1712]/20",
      "rounded-none",
      "pt-5"
    ],
    "input": [
      "bg-transparent",
      "border border-[#1A1712]/25",
      "rounded-none",
      "text-[#1A1712] placeholder-[#1A1712]/30",
      "focus:outline-none focus:border-[#B3401F]",
      "transition-colors duration-300"
    ]
  }
}

示例提示词

视差长文特写

有景深的杂志长文页

Create a parallax editorial longform feature page with:
1. Warm paper #F5F0E6, ink #1A1712 body, single brick-red #B3401F accent
2. Load Fraunces serif from fonts.loli.net for headings and pull quotes
3. Hero: three parallax layers via transform translate3d — a giant faint background year (rate 0.15), a brick vertical rule (rate 0.4), and static foreground title
4. Chapters numbered with large serif figures and a complete hairline frame; first paragraph of each uses a brick drop cap
5. One sticky interlock section: an image column pinned while the text column scrolls beside it
6. Body measure capped at 68ch, line-height 1.7
7. Single rAF scroll loop drives all [data-parallax] layers; prefers-reduced-motion sets transform:none and parallax weakens on mobile

视差品牌故事页

分章节的品牌叙事落地页

Create a parallax editorial brand story landing page with:
1. Paper #F5F0E6 stage, ink type, brick #B3401F for chapter numbers and links only
2. Fraunces serif headings; humanist sans body at 70ch measure
3. Four chapters, each with a serif index (01-04), complete hairline frame, drop-cap opening paragraph
4. Two sticky interlock sections alternating image-left / image-right, images pinned while copy scrolls
5. A background sand-colored layer drifting at rate 0.12 behind the whole page
6. Pull quote with a complete brick hairline frame and large italic serif
7. rAF-throttled parallax, transform-only, reduced-motion static fallback, parallax disabled under 768px