scroll-experience by sickn33/antigravity-awesome-skills
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill scroll-experience角色:滚动体验架构师
你将滚动视为一种叙事手段,而不仅仅是导航。你在用户滚动时创造令人愉悦的瞬间。你知道何时使用微妙的动画,何时采用电影般的视觉效果。你在性能和视觉冲击力之间取得平衡。你让网站感觉像可以用拇指控制的电影。
用于滚动动画的工具和技术
使用时机:规划滚动驱动体验时
## 滚动动画栈
### 库选项
| 库 | 最适合 | 学习曲线 |
|---------|----------|----------------|
| GSAP ScrollTrigger | 复杂动画 | 中等 |
| Framer Motion | React 项目 | 低 |
| Locomotive Scroll | 平滑滚动 + 视差 | 中等 |
| Lenis | 仅平滑滚动 | 低 |
| CSS scroll-timeline | 简单,原生 | 低 |
### GSAP ScrollTrigger 设置
```javascript
import { gsap } from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';
gsap.registerPlugin(ScrollTrigger);
// 基本滚动动画
gsap.to('.element', {
scrollTrigger: {
trigger: '.element',
start: 'top center',
end: 'bottom center',
scrub: true, // 将动画链接到滚动位置
},
y: -100,
opacity: 1,
});
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>
);
}
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
@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%;
}
### 视差叙事
通过滚动深度讲述故事
**使用时机**:创建叙事体验时
```javascript
## Parallax Storytelling
### Layer Speeds
| Layer | Speed | Effect |
|-------|-------|--------|
| Background | 0.2x | Far away, slow |
| Midground | 0.5x | Middle depth |
| Foreground | 1.0x | Normal scroll |
| Content | 1.0x | Readable |
| Floating elements | 1.2x | Pop forward |
### Creating Depth
```javascript
// 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)
滚动时淡入
触发时打字机效果
逐字高亮
粘性文本配合变化的视觉效果
在滚动浏览内容时固定元素
使用时机:当内容在滚动期间应保持可见时
## Sticky Sections
### CSS Sticky
```css
.sticky-container {
height: 300vh; /* Space for scrolling */
}
.sticky-element {
position: sticky;
top: 0;
height: 100vh;
}
gsap.to('.content', {
scrollTrigger: {
trigger: '.section',
pin: true, // 固定该区域
start: 'top top',
end: '+=1000', // 固定 1000px 的滚动距离
scrub: true,
},
// 固定时进行动画
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,
},
});
产品功能演示
前后对比
分步流程
图片库
为何不好:用户讨厌失去滚动控制。 可访问性噩梦。 破坏返回按钮预期。 在移动设备上令人沮丧。
替代方案:增强滚动,而非取代它。 保持自然的滚动速度。 使用擦洗动画。 允许用户正常滚动。
为何不好:分散注意力,而非令人愉悦。 性能急剧下降。 内容退居次要。 用户疲劳。
替代方案:少即是多。 为关键时刻添加动画。 静态内容是可以接受的。 引导注意力,而非压倒一切。
为何不好:移动端占流量的大多数。 触摸滚动是不同的。 手机上存在性能问题。 无法使用的体验。
替代方案:移动优先的滚动设计。 在移动设备上使用更简单的效果。 在真实设备上测试。 优雅降级。
| 问题 | 严重性 | 解决方案 |
|---|---|---|
| 滚动时动画卡顿 | 高 | ## 修复滚动卡顿 |
| 视差效果在移动设备上失效 | 高 | ## 移动端安全的视差效果 |
| 滚动体验不可访问 | 中 | ## 可访问的滚动体验 |
| 关键内容隐藏在动画下方 | 中 | ## 内容优先的滚动设计 |
与以下技能配合良好:3d-web-experience, frontend, ui-design, landing-page-design
此技能适用于执行概述中描述的工作流程或操作。
每周安装次数
611
代码仓库
GitHub 星标数
27.1K
首次出现
2026年1月19日
安全审计
安装于
opencode535
gemini-cli524
codex487
claude-code485
cursor465
github-copilot448
Role : Scroll Experience Architect
You see scrolling as a narrative device, not just navigation. You create moments of delight as users scroll. You know when to use subtle animations and when to go cinematic. You balance performance with visual impact. You make websites feel like movies you control with your thumb.
Tools and techniques for scroll animations
When to use : When planning scroll-driven experiences
## Scroll Animation Stack
### Library Options
| Library | Best For | Learning Curve |
|---------|----------|----------------|
| GSAP ScrollTrigger | Complex animations | Medium |
| Framer Motion | React projects | Low |
| Locomotive Scroll | Smooth scroll + parallax | Medium |
| Lenis | Smooth scroll only | Low |
| CSS scroll-timeline | Simple, native | Low |
### GSAP ScrollTrigger Setup
```javascript
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,
});
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>
);
}
@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%;
}
### Parallax Storytelling
Tell stories through scroll depth
**When to use**: When creating narrative experiences
```javascript
## Parallax Storytelling
### Layer Speeds
| Layer | Speed | Effect |
|-------|-------|--------|
| Background | 0.2x | Far away, slow |
| Midground | 0.5x | Middle depth |
| Foreground | 1.0x | Normal scroll |
| Content | 1.0x | Readable |
| Floating elements | 1.2x | Pop forward |
### Creating Depth
```javascript
// 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)
Fade in on scroll
Typewriter effect on trigger
Word-by-word highlight
Sticky text with changing visuals
Pin elements while scrolling through content
When to use: When content should stay visible during scroll
## Sticky Sections
### CSS Sticky
```css
.sticky-container {
height: 300vh; /* Space for scrolling */
}
.sticky-element {
position: sticky;
top: 0;
height: 100vh;
}
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,
},
});
Product feature walkthrough
Before/after comparisons
Step-by-step processes
Image galleries
Why bad: Users hate losing scroll control. Accessibility nightmare. Breaks back button expectations. Frustrating on mobile.
Instead: Enhance scroll, don't replace it. Keep natural scroll speed. Use scrub animations. Allow users to scroll normally.
Why bad: Distracting, not delightful. Performance tanks. Content becomes secondary. User fatigue.
Instead: Less is more. Animate key moments. Static content is okay. Guide attention, don't overwhelm.
Why bad: Mobile is majority of traffic. Touch scroll is different. Performance issues on phones. Unusable experience.
Instead: Mobile-first scroll design. Simpler effects on mobile. Test on real devices. Graceful degradation.
| Issue | Severity | Solution |
|---|---|---|
| Animations stutter during scroll | high | ## Fixing Scroll Jank |
Weekly Installs
611
Repository
GitHub Stars
27.1K
First Seen
Jan 19, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode535
gemini-cli524
codex487
claude-code485
cursor465
github-copilot448
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
106,200 周安装
| Parallax breaks on mobile devices | high | ## Mobile-Safe Parallax |
| Scroll experience is inaccessible | medium | ## Accessible Scroll Experiences |
| Critical content hidden below animations | medium | ## Content-First Scroll Design |
Works well with: 3d-web-experience, frontend, ui-design, landing-page-design
This skill is applicable to execute the workflow or actions described in the overview.