모션·인터랙션 / GSAP / ScrollSmoother · ScrollTrigger
Horizontal scrolling gallery
세로 스크롤로 가로 갤러리를 탐색합니다.
미리보기 안의 버튼·입력·포인터로 모션을 확인하세요. 실행 방식은 아래 활용 메모를 참고하세요.
실행용 통합 HTML · 공식 GSAP 3.15.0
<!doctype html>
<!-- Archived from GSAP Demo Hub / horizontal-scrolling-gallery
Original editor: https://codepen.io/GreenSock/pen/dydpJzY
HTML/CSS/JS source panels are preserved separately. Runtime GSAP: 3.15.0 official distribution. -->
<html lang="en" class=""><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Horizontal scrolling gallery</title>
<link href='//fonts.googleapis.com/css?family=Signika+Negative:300,400,600' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://asset.wemashup.com/wp-content/uploads/wm-asset-library/gsap/shared/normalize-5.0.0.min.css">
<link rel="stylesheet" href="https://asset.wemashup.com/wp-content/uploads/wm-asset-library/gsap/shared/xxmzBrw.css">
<style>
body {
overflow-x: hidden;
margin: 0;
}
.row,
.section,
section {
position: relative;
overflow: hidden;
}
.section,
section {
text-align: center;
}
.container-fluid {
width: 100%;
padding-right: 0;
padding-left: 0;
margin-right: auto;
margin-left: auto;
}
.horiz-gallery-strip,
.horiz-gallery-wrapper {
display: flex;
flex-wrap: nowrap;
will-change: transform;
position: relative;
}
.project-wrap {
width: 33vw;
padding: 2rem;
box-sizing: content-box;
}
.project-wrap img {
width: 100%;
aspect-ratio: 1/1;
object-fit: cover;
}
</style></head><body>
<div id="smooth-wrapper">
<div id="smooth-content">
<section class="panel plain">
<h3>Scroll down for the Gallery</h3>
</section>
<section id="portfolio">
<div class="container-fluid">
<div class="horiz-gallery-wrapper">
<div class="horiz-gallery-strip">
<div class="project-wrap">
<img src="https://assets.codepen.io/16327/portrait-image-1.jpg" alt="" />
</div>
<div class="project-wrap">
<img src="https://assets.codepen.io/16327/portrait-image-2.jpg" alt="" />
</div>
<div class="project-wrap">
<img src="https://assets.codepen.io/16327/portrait-image-3.jpg" alt="" />
</div>
<div class="project-wrap">
<img src="https://assets.codepen.io/16327/portrait-image-4.jpg" alt="" />
</div>
<div class="project-wrap">
<img src="https://assets.codepen.io/16327/portrait-image-5.jpg" alt="" />
</div>
<div class="project-wrap">
<img src="https://assets.codepen.io/16327/portrait-image-6.jpg" alt="" />
</div>
<div class="project-wrap">
<img src="https://assets.codepen.io/16327/portrait-image-7.jpg" alt="" />
</div>
<div class="project-wrap">
<img src="https://assets.codepen.io/16327/portrait-image-8.jpg" alt="" />
</div>
</div>
</div>
</div>
</section>
<section class="panel plain">
<h3>That's it!</h3>
</section>
</div>
</div>
<script src="https://asset.wemashup.com/wp-content/uploads/wm-asset-library/gsap/shared/gsap-3.15.0-gsap.min.js"></script>
<script src="https://asset.wemashup.com/wp-content/uploads/wm-asset-library/gsap/shared/gsap-3.15.0-ScrollTrigger.min.js"></script>
<script src="https://asset.wemashup.com/wp-content/uploads/wm-asset-library/gsap/shared/gsap-3.15.0-ScrollSmoother.min.js"></script>
<script>
gsap.registerPlugin(ScrollTrigger, ScrollSmoother);
const smoother = ScrollSmoother.create({
wrapper: "#smooth-wrapper",
content: "#smooth-content",
smooth: 2,
normalizeScroll: true,
ignoreMobileResize: true,
preventDefault: true
});
//Horizontal Scroll Galleries
if (document.getElementById("portfolio")) {
const horizontalSections = gsap.utils.toArray(".horiz-gallery-wrapper");
horizontalSections.forEach(function (sec, i) {
const pinWrap = sec.querySelector(".horiz-gallery-strip");
let pinWrapWidth;
let horizontalScrollLength;
function refresh() {
pinWrapWidth = pinWrap.scrollWidth;
horizontalScrollLength = pinWrapWidth - window.innerWidth;
}
refresh();
// Pinning and horizontal scrolling
gsap.to(pinWrap, {
scrollTrigger: {
scrub: true,
trigger: sec,
pin: sec,
start: "center center",
end: () => `+=${pinWrapWidth}`,
invalidateOnRefresh: true
},
x: () => -horizontalScrollLength,
ease: "none"
});
ScrollTrigger.addEventListener("refreshInit", refresh);
});
}
</script>
</body></html>
원본 HTML
<div id="smooth-wrapper">
<div id="smooth-content">
<section class="panel plain">
<h3>Scroll down for the Gallery</h3>
</section>
<section id="portfolio">
<div class="container-fluid">
<div class="horiz-gallery-wrapper">
<div class="horiz-gallery-strip">
<div class="project-wrap">
<img src="https://assets.codepen.io/16327/portrait-image-1.jpg" alt="" />
</div>
<div class="project-wrap">
<img src="https://assets.codepen.io/16327/portrait-image-2.jpg" alt="" />
</div>
<div class="project-wrap">
<img src="https://assets.codepen.io/16327/portrait-image-3.jpg" alt="" />
</div>
<div class="project-wrap">
<img src="https://assets.codepen.io/16327/portrait-image-4.jpg" alt="" />
</div>
<div class="project-wrap">
<img src="https://assets.codepen.io/16327/portrait-image-5.jpg" alt="" />
</div>
<div class="project-wrap">
<img src="https://assets.codepen.io/16327/portrait-image-6.jpg" alt="" />
</div>
<div class="project-wrap">
<img src="https://assets.codepen.io/16327/portrait-image-7.jpg" alt="" />
</div>
<div class="project-wrap">
<img src="https://assets.codepen.io/16327/portrait-image-8.jpg" alt="" />
</div>
</div>
</div>
</div>
</section>
<section class="panel plain">
<h3>That's it!</h3>
</section>
</div>
</div>원본 CSS
body {
overflow-x: hidden;
margin: 0;
}
.row,
.section,
section {
position: relative;
overflow: hidden;
}
.section,
section {
text-align: center;
}
.container-fluid {
width: 100%;
padding-right: 0;
padding-left: 0;
margin-right: auto;
margin-left: auto;
}
.horiz-gallery-strip,
.horiz-gallery-wrapper {
display: flex;
flex-wrap: nowrap;
will-change: transform;
position: relative;
}
.project-wrap {
width: 33vw;
padding: 2rem;
box-sizing: content-box;
}
.project-wrap img {
width: 100%;
aspect-ratio: 1/1;
object-fit: cover;
}
원본 JavaScript
gsap.registerPlugin(ScrollTrigger, ScrollSmoother);
const smoother = ScrollSmoother.create({
wrapper: "#smooth-wrapper",
content: "#smooth-content",
smooth: 2,
normalizeScroll: true,
ignoreMobileResize: true,
preventDefault: true
});
//Horizontal Scroll Galleries
if (document.getElementById("portfolio")) {
const horizontalSections = gsap.utils.toArray(".horiz-gallery-wrapper");
horizontalSections.forEach(function (sec, i) {
const pinWrap = sec.querySelector(".horiz-gallery-strip");
let pinWrapWidth;
let horizontalScrollLength;
function refresh() {
pinWrapWidth = pinWrap.scrollWidth;
horizontalScrollLength = pinWrapWidth - window.innerWidth;
}
refresh();
// Pinning and horizontal scrolling
gsap.to(pinWrap, {
scrollTrigger: {
scrub: true,
trigger: sec,
pin: sec,
start: "center center",
end: () => `+=${pinWrapWidth}`,
invalidateOnRefresh: true
},
x: () => -horizontalScrollLength,
ease: "none"
});
ScrollTrigger.addEventListener("refreshInit", refresh);
});
}
검증·권리 정보
- 실행 검증
- 데스크톱 실행 확인
- 검증 수준
- 샘플 실행
- 권리 확인
- 확인 필요
세로 스크롤로 가로 갤러리를 탐색합니다.
Chromium 153 · 데스크톱 1280×900 · 격리 iframe에서 스크롤 입력과 화면 변화 확인. 모바일·프로젝트 적용은 미검증.
원본 패널과 통합 실행 파일은 분리해 보관했습니다. 원본의 구형 전용 라이브러리 대신 통합 실행은 공식 GSAP 3.15.0을 사용합니다.
보관·활용 메모
GSAP Demo Hub의 공개 예제입니다. 원본 HTML·CSS·JavaScript와 설정, 시연 파일을 함께 보관했습니다. 통합 HTML은 공통 스타일과 실행 의존성을 연결한 파일이며 SCSS는 원본 컴파일 결과를 사용합니다.
구형 CodePen 전용 의존성을 그대로 배포하지 않고, 통합 실행에는 공식 GSAP 3.15.0을 연결했습니다. 원본 패널과 원본 설정은 ZIP에 별도로 보존되어 있습니다. 예제의 이미지·폰트 등 외부 소재 요청은 유지됩니다.
보관일 2026-10-26 · 원본 코드·작성자·설정 정보를 보존했습니다. 실제 프로젝트에서 코드와 이미지·폰트의 사용 조건을 확인하세요.