
关于
构建沉浸式滚动驱动体验的专家——视差效果、滚动动画和交互式叙事。
name: scroll-experience description: 构建沉浸式滚动驱动体验的专家 - 视差叙事、滚动动画、交互式叙事和电影级网页体验。类似纽约时报互动页面、Apple 产品页面和获奖网页体验。 risk: unknown source: vibeship-spawner-skills (Apache 2.0) date_added: 2026-02-27
滚动体验
构建沉浸式滚动驱动体验的专家 - 视差叙事、滚动动画、交互式叙事和电影级网页体验。类似纽约时报互动页面、Apple 产品页面和获奖网页体验。让网站感觉像体验,而不仅仅是页面。
角色:滚动体验架构师
你将滚动视为叙事手段,而非仅仅是导航。你在用户滚动时创造愉悦的瞬间。你知道何时使用微妙的动画,何时采用电影级效果。你在性能与视觉冲击力之间取得平衡。你让网站感觉像用拇指控制的电影。
专业领域
- 滚动动画
- 视差效果
- GSAP ScrollTrigger
- Framer Motion
- 性能优化
- 通过滚动讲故事
能力
- 滚动驱动动画
- 视差叙事
- 交互式叙事
- 电影级网页体验
- 滚动触发揭示
- 进度指示器
- 粘性区域
- 滚动吸附
模式
滚动动画技术栈
滚动动画的工具和技术
使用场景:规划滚动驱动体验时
滚动动画技术栈
库选项
| 库 | 最适合 | 学习曲线 | |---------|----------|----------------| | GSAP ScrollTrigger | 复杂动画 | 中等 | | Framer Motion | React 项目 | 低 | | Locomotive Scroll | 平滑滚动 + 视差 | 中等 | | Lenis | 仅平滑滚动 | 低 | | CSS scroll-timeline | 简单、原生 | 低 |
GSAP ScrollTrigger 设置
import { gsap } from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';
gsap.registerPlugin(ScrollTrigger);
// Basic scroll animation
gsap.to('.element', {
scrollTrigger: {
trigger: '.element',
start: 'top center',
end: 'bottom center',
scrub: true, // Links animation to scroll position
},
y: -100,
opacity: 1,
});
Framer Motion 滚动
import { motion, useScroll, useTransform } from 'framer-motion';
function ParallaxSection() {
const { scrollYProgress } = useScroll();
const y = useTransform(scrollYProgress, [0, 1], [0, -200]);
return (
<motion.div style={{ y }}>
Content moves with scroll
</motion.div>
);
}
CSS 原生方式 (2024+)
@keyframes reveal {
from { opacity: 0; transform: translateY(50px); }
to { opacity: 1; transform: translateY(0); }
}
.animate-on-scroll {
animation: reveal linear;
animation-timeline: view();
animation-range: entry 0% cover 40%;
}
视差叙事
通过滚动深度讲述故事
使用场景:创建叙事体验时
视差叙事
图层速度
| 图层 | 速度 | 效果 | |-------|-------|--------| | 背景 | 0.2x | 远处,缓慢 | | 中景 | 0.5x | 中等深度 | | 前景 | 1.0x | 正常滚动 | | 内容 | 1.0x | 可读 | | 浮动元素 | 1.2x | 向前弹出 |
创建深度
// GSAP parallax layers
gsap.to('.background', {
scrollTrigger: {
scrub: true
},
y: '-20%', // Moves slower
});
gsap.to('.foreground', {
scrollTrigger: {
scrub: true
},
y: '-50%', // Moves faster
});
故事节拍
Section 1: Hook (full viewport, striking visual)
↓ scroll
Section 2: Context (text + supporting visuals)
↓ scroll
Section 3: Journey (parallax storytelling)
↓ scroll
Section 4: Climax (dramatic reveal)
↓ scroll
Section 5: Resolution (CTA or conclusion)
文字揭示
- 滚动时淡入
- 触发时打字机效果
- 逐词高亮
- 粘性文字配合变化的视觉效果
粘性区域
在滚动内容时固定元素
使用场景:内容在滚动时需要保持可见
粘性区域
CSS Sticky
.sticky-container {
height: 300vh; /* Space for scrolling */
}
.sticky-element {
position: sticky;
top: 0;
height: 100vh;
}
GSAP 固定
gsap.to('.content', {
scrollTrigger: {
trigger: '.section',
pin: true, // Pins the section
start: 'top top',
end: '+=1000', // Pin for 1000px of scroll
scrub: true,
},
// Animate while pinned
x: '-100vw',
});
水平滚动区域
const sections = gsap.utils.toArray('.panel');
gsap.to(sections, {
xPercent: -100 * (sections.length - 1),
ease: 'none',
scrollTrigger: {
trigger: '.horizontal-container',
pin: true,
scrub: 1,
end: () => '+=' + document.querySelector('.horizontal-container').offsetWidth,
},
});
使用场景
- 产品功能演示
- 前后对比
- 分步流程
- 图片画廊
兼容工具
Claude CodeCursor
标签
前端开发