# 패럴랙스 (Parallax scrolling)

분류: 모션 > 스크롤 효과 (Motion > Scroll effects)
주소: https://ui-glossary-xi.vercel.app/motion/parallax
다른 이름: 패럴렉스, 시차 스크롤, 시차 효과, 패럴랙스 스크롤, 깊이감 스크롤, parallax, parallax scrolling, parallax effect

스크롤할 때 배경이 글보다 느리게 움직여 깊이감. 스크롤하면 앞의 글·사진은 보통 빠르기로, 뒤의 배경은 더 느리게 움직여 멀리 있는 것처럼 보이게 하는 효과. 기차 창밖의 먼 산이 가까운 전봇대보다 느리게 지나가는 '시차'에서 이름이 왔다. 원래 2D 게임에서 여러 겹의 배경을 다른 빠르기로 흘린 기법이다. 닐슨 노먼 그룹(Katie Sherwin)은 눈길은 끌지만 글이 읽기 어려워지거나 내용이 늦게 뜨는 문제를 자주 만든다고 했고, 움직임에 예민한 사람에게는 어지럼을 줄 수 있다(WCAG 2.3.3).

## 용도
- 히어로·브랜드 소개처럼 글이 적고 분위기가 중요한 첫 화면의 배경에만.
- 속도 차이는 작게(배경이 글의 50~80% 빠르기). 차이가 크면 어지럽다. 글·버튼이 있는 층은 움직이지 않는다.
- 움직임 줄이기 설정이면 끈다 — WCAG 2.3.3의 대표 예가 패럴랙스다. 휴대폰에서는 성능 때문에 빼기도 한다.

## 헷갈릴 수 있는 UI
- 움직임 줄이기 (Reduced motion (prefers-reduced-motion), https://ui-glossary-xi.vercel.app/md/reduced-motion.md): 움직임 줄이기는 기기 설정(prefers-reduced-motion)을 따라 움직임을 빼거나 바꾸는 것이다. 패럴랙스는 WCAG 2.3.3 이해 문서·web.dev가 전정 장애를 일으킬 수 있는 예로 들어 먼저 끌 대상이다.
- 스크롤 연동 애니메이션 (Scroll-driven animation, https://ui-glossary-xi.vercel.app/md/scroll-driven-animation.md): 스크롤 연동 애니메이션은 스크롤 진행에 아무 효과(진행 막대·나타나기·회전)를 묶는 기술 전반이다. 패럴랙스는 그중 '층마다 빠르기를 다르게 해 깊이감'을 내는 한 가지다.
- 히어로 (Hero section, https://ui-glossary-xi.vercel.app/md/hero.md): 히어로는 첫 화면의 큰 구역(자리)이다. 패럴랙스는 그 배경을 스크롤에 따라 느리게 움직이는 연출로, '패럴랙스 히어로'처럼 함께 쓴다.

## AI에게 이렇게 말하세요
- 한국어: 히어로 배경 그림에 패럴랙스를 넣어 줘. 스크롤하면 배경이 글보다 절반 빠르기로 움직이게, CSS animation-timeline: scroll()로 transform만 쓰고 미지원 브라우저에서는 그냥 고정 배경. 제목·버튼 층은 움직이지 않고, 움직임 줄이기 설정이면 패럴랙스를 끄게.
- English: Add a parallax effect to the hero background: as the page scrolls, the background moves at half the speed of the text. Use CSS animation-timeline: scroll() on transform only, falling back to a static background where unsupported. Keep the heading and button layer still, and disable the parallax under prefers-reduced-motion.

이렇게 말하면 엉뚱한 게 나와요:
- "스크롤하면 움직이게 해 줘" — 무엇이 어떻게 움직일지 몰라 아무 스크롤 효과가 붙는다. 배경이 느리게 움직이는 깊이감이면 '패럴랙스'라고 말한다. (대신 나오는 것: 스크롤 연동 애니메이션)
- "배경을 고정해 줘" — background-attachment: fixed로 배경이 전혀 안 움직인다. 느리게라도 움직여야 패럴랙스다.

## 핵심 구조 요점
### 태그
- CSS: 배경 층에 animation: 이름 linear both; animation-timeline: scroll(); @keyframes에서 translateY만 바꾼다(글보다 덜 올라가게 아래로 밀어 준다).
- @supports (animation-timeline: scroll())로 감싸고, 미지원 브라우저는 정지 배경 또는 scroll 이벤트 + requestAnimationFrame으로 transform을 맞춘다.
- transform·opacity만 움직인다(top·background-position을 움직이면 끊긴다).

### 접근성 속성
- 배경 층은 장식이라 aria-hidden 또는 CSS 배경. 정보는 앞 층의 글에만 둔다.
- @media (prefers-reduced-motion: reduce)에서 animation: none(WCAG 2.3.3).

### 키보드
- 키 조작은 없다. 키보드 스크롤(Space·Page Down·화살표)로도 같은 효과가 나고, 스크롤을 가로채지 않는다.

## 출처
- [Nielsen Norman Group — Parallax Scrolling: Attention Getter or Headache?](https://www.nngroup.com/articles/parallax-usability/)
- [MDN — CSS scroll-driven animations](https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Scroll-driven_animations)
- [WCAG 2.2 — Understanding 2.3.3 Animation from Interactions](https://www.w3.org/WAI/WCAG22/Understanding/animation-from-interactions.html)
