미리보기 안에서 스크롤하거나 마우스를 움직여 모션을 확인하세요.
실행용 통합 HTML · 공식 GSAP 3.15.0
<!doctype html>
<!-- Archived from GSAP Demo Hub / link-to-scroll-progress
Original editor: https://codepen.io/GreenSock/pen/XJmPLEw
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>Link To Scroll Progress</title>
<link rel="stylesheet" href="https://asset.wemashup.com/wp-content/uploads/wm-asset-library/gsap/shared/xxmzBrw.css">
<style>
@font-face {
font-display: block;
font-family: Mori;
font-style: normal;
font-weight: 600;
src: url(https://assets.codepen.io/16327/PPMori-Regular.woff) format("woff");
}
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 200vh;
font-family: "Mori";
color: #fffce1;
background: #0e100f;
}
main {
width: 100%;
height: 200vh;
display: flex;
align-items: center;
justify-content: center;
}
#trigger-container {
position: relative;
display: block;
border-top: dashed 2px grey;
border-bottom: dashed 2px grey;
padding: 4rem;
}
.info {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
width: 300px;
background-color: #191919;
border-radius: 10px;
gap: 1rem;
}
.info h1 {
font-size: 1.2rem;
text-align: center;
}
.info svg {
height: 20px;
}
#windmill {
height: 100%;
width: 100%;
}
#text {
display: inline-block;
width: 200px;
}
.spacer {
height: 100vh;
}
</style></head><body>
<div class="spacer"></div>
<main>
<div id="trigger-container">
<svg id="windmill" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" viewBox="0 0 248 248" aria-hidden="true">
<path fill="url(#paint0_linear_2452_11835)" d="M152.266 123.716h94.275c.802 0 1.459.656 1.459 1.459v121.067c0 .81-.664 1.474-1.474 1.466-67.274-.78-121.669-55.137-122.522-122.387v121.22c0 .803-.657 1.459-1.46 1.459H1.474c-.81 0-1.474-.664-1.467-1.474C.795 178.721 56 124.008 123.996 124H1.459C.657 124 0 123.344 0 122.541V1.474C0 .664.664 0 1.474.008c67.274.78 121.669 55.137 122.522 122.387V1.46c0-.803.657-1.46 1.46-1.46h121.07c.81 0 1.474.664 1.467 1.474-.679 58.224-41.486 106.801-96.055 119.367-1.686.386-1.401 2.875.336 2.875h-.008Z"></path>
<path fill-opacity="0.6" fill="url(#pattern-scroll-trigger-pin-windmill-0)" d="M152.266 123.716h94.275c.802 0 1.459.656 1.459 1.459v121.067c0 .81-.664 1.474-1.474 1.466-67.274-.78-121.669-55.137-122.522-122.387v121.22c0 .803-.657 1.459-1.46 1.459H1.474c-.81 0-1.474-.664-1.467-1.474C.795 178.721 56 124.008 123.996 124H1.459C.657 124 0 123.344 0 122.541V1.474C0 .664.664 0 1.474.008c67.274.78 121.669 55.137 122.522 122.387V1.46c0-.803.657-1.46 1.46-1.46h121.07c.81 0 1.474.664 1.467 1.474-.679 58.224-41.486 106.801-96.055 119.367-1.686.386-1.401 2.875.336 2.875h-.008Z" style="mix-blend-mode:multiply"></path>
<path fill="url(#paint1_linear_2452_11835)" d="M152.266 123.716h94.275c.802 0 1.459.656 1.459 1.459v121.067c0 .81-.664 1.474-1.474 1.466-67.274-.78-121.669-55.137-122.522-122.387v121.22c0 .803-.657 1.459-1.46 1.459H1.474c-.81 0-1.474-.664-1.467-1.474C.795 178.721 56 124.008 123.996 124H1.459C.657 124 0 123.344 0 122.541V1.474C0 .664.664 0 1.474.008c67.274.78 121.669 55.137 122.522 122.387V1.46c0-.803.657-1.46 1.46-1.46h121.07c.81 0 1.474.664 1.467 1.474-.679 58.224-41.486 106.801-96.055 119.367-1.686.386-1.401 2.875.336 2.875h-.008Z"></path>
<path fill-opacity="0.6" fill="url(#pattern-scroll-trigger-pin-windmill-0)" d="M152.266 123.716h94.275c.802 0 1.459.656 1.459 1.459v121.067c0 .81-.664 1.474-1.474 1.466-67.274-.78-121.669-55.137-122.522-122.387v121.22c0 .803-.657 1.459-1.46 1.459H1.474c-.81 0-1.474-.664-1.467-1.474C.795 178.721 56 124.008 123.996 124H1.459C.657 124 0 123.344 0 122.541V1.474C0 .664.664 0 1.474.008c67.274.78 121.669 55.137 122.522 122.387V1.46c0-.803.657-1.46 1.46-1.46h121.07c.81 0 1.474.664 1.467 1.474-.679 58.224-41.486 106.801-96.055 119.367-1.686.386-1.401 2.875.336 2.875h-.008Z" style="mix-blend-mode:multiply"></path>
<defs>
<linearGradient id="paint0_linear_2452_11835" x1="218" x2="-47.283" y1="258" y2="153.706" gradientUnits="userSpaceOnUse">
<stop offset=".27" stop-color="#FFD3FD"></stop>
<stop offset=".838" stop-color="#806EFF"></stop>
</linearGradient>
<linearGradient id="paint1_linear_2452_11835" x1="-21.183" x2="223.712" y1="-7.807" y2="329.472" gradientUnits="userSpaceOnUse">
<stop offset=".27" stop-color="#FEC5FB"></stop>
<stop offset=".838" stop-color="#00BAE2"></stop>
</linearGradient>
<pattern id="pattern-scroll-trigger-pin-windmill-0" width=".403" height=".403" patternContentUnits="objectBoundingBox">
<use xlink:href="#svg-noise" transform="scale(.0008)"></use>
</pattern>
</defs>
</svg>
</div>
</main>
<div class="spacer"></div>
<div class="info">
<h1><span id="text">Scroll down</span></h1>
<svg id="arrow" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 11" aria-hidden="true">
<path fill="#fffce1" d="M4.055 0v7.71l-3-3L0 5.79l4.805 4.804 4.804-4.805-1.054-1.078-3 3V0h-1.5Z"></path>
</svg>
</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>
const tl = gsap
.timeline({
scrollTrigger: {
trigger: "#trigger-container",
start: "top center",
end: "bottom center",
markers: true,
scrub: true,
onUpdate: (self) => {
text.innerText = `progress ${self.progress.toFixed(2)}`
}
}
})
.to(
"#windmill",
{
rotation: 360,
ease: "none",
duration: 4
}
);
// changing the text in the bar
let inZone = false
ScrollTrigger.create({
start: 0,
end: "max",
onUpdate: (self) => {
if (self.direction !== self.prevDirection && !inZone) {
gsap.to("#arrow", {
rotation: self.direction === 1 ? 0 : -180,
duration: 0.2,
});
self.prevDirection = self.direction;
}
}
});
</script>
</body></html>
원본 HTML
<div class="spacer"></div>
<main>
<div id="trigger-container">
<svg id="windmill" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" viewBox="0 0 248 248" aria-hidden="true">
<path fill="url(#paint0_linear_2452_11835)" d="M152.266 123.716h94.275c.802 0 1.459.656 1.459 1.459v121.067c0 .81-.664 1.474-1.474 1.466-67.274-.78-121.669-55.137-122.522-122.387v121.22c0 .803-.657 1.459-1.46 1.459H1.474c-.81 0-1.474-.664-1.467-1.474C.795 178.721 56 124.008 123.996 124H1.459C.657 124 0 123.344 0 122.541V1.474C0 .664.664 0 1.474.008c67.274.78 121.669 55.137 122.522 122.387V1.46c0-.803.657-1.46 1.46-1.46h121.07c.81 0 1.474.664 1.467 1.474-.679 58.224-41.486 106.801-96.055 119.367-1.686.386-1.401 2.875.336 2.875h-.008Z"></path>
<path fill-opacity="0.6" fill="url(#pattern-scroll-trigger-pin-windmill-0)" d="M152.266 123.716h94.275c.802 0 1.459.656 1.459 1.459v121.067c0 .81-.664 1.474-1.474 1.466-67.274-.78-121.669-55.137-122.522-122.387v121.22c0 .803-.657 1.459-1.46 1.459H1.474c-.81 0-1.474-.664-1.467-1.474C.795 178.721 56 124.008 123.996 124H1.459C.657 124 0 123.344 0 122.541V1.474C0 .664.664 0 1.474.008c67.274.78 121.669 55.137 122.522 122.387V1.46c0-.803.657-1.46 1.46-1.46h121.07c.81 0 1.474.664 1.467 1.474-.679 58.224-41.486 106.801-96.055 119.367-1.686.386-1.401 2.875.336 2.875h-.008Z" style="mix-blend-mode:multiply"></path>
<path fill="url(#paint1_linear_2452_11835)" d="M152.266 123.716h94.275c.802 0 1.459.656 1.459 1.459v121.067c0 .81-.664 1.474-1.474 1.466-67.274-.78-121.669-55.137-122.522-122.387v121.22c0 .803-.657 1.459-1.46 1.459H1.474c-.81 0-1.474-.664-1.467-1.474C.795 178.721 56 124.008 123.996 124H1.459C.657 124 0 123.344 0 122.541V1.474C0 .664.664 0 1.474.008c67.274.78 121.669 55.137 122.522 122.387V1.46c0-.803.657-1.46 1.46-1.46h121.07c.81 0 1.474.664 1.467 1.474-.679 58.224-41.486 106.801-96.055 119.367-1.686.386-1.401 2.875.336 2.875h-.008Z"></path>
<path fill-opacity="0.6" fill="url(#pattern-scroll-trigger-pin-windmill-0)" d="M152.266 123.716h94.275c.802 0 1.459.656 1.459 1.459v121.067c0 .81-.664 1.474-1.474 1.466-67.274-.78-121.669-55.137-122.522-122.387v121.22c0 .803-.657 1.459-1.46 1.459H1.474c-.81 0-1.474-.664-1.467-1.474C.795 178.721 56 124.008 123.996 124H1.459C.657 124 0 123.344 0 122.541V1.474C0 .664.664 0 1.474.008c67.274.78 121.669 55.137 122.522 122.387V1.46c0-.803.657-1.46 1.46-1.46h121.07c.81 0 1.474.664 1.467 1.474-.679 58.224-41.486 106.801-96.055 119.367-1.686.386-1.401 2.875.336 2.875h-.008Z" style="mix-blend-mode:multiply"></path>
<defs>
<linearGradient id="paint0_linear_2452_11835" x1="218" x2="-47.283" y1="258" y2="153.706" gradientUnits="userSpaceOnUse">
<stop offset=".27" stop-color="#FFD3FD"></stop>
<stop offset=".838" stop-color="#806EFF"></stop>
</linearGradient>
<linearGradient id="paint1_linear_2452_11835" x1="-21.183" x2="223.712" y1="-7.807" y2="329.472" gradientUnits="userSpaceOnUse">
<stop offset=".27" stop-color="#FEC5FB"></stop>
<stop offset=".838" stop-color="#00BAE2"></stop>
</linearGradient>
<pattern id="pattern-scroll-trigger-pin-windmill-0" width=".403" height=".403" patternContentUnits="objectBoundingBox">
<use xlink:href="#svg-noise" transform="scale(.0008)"></use>
</pattern>
</defs>
</svg>
</div>
</main>
<div class="spacer"></div>
<div class="info">
<h1><span id="text">Scroll down</span></h1>
<svg id="arrow" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 11" aria-hidden="true">
<path fill="#fffce1" d="M4.055 0v7.71l-3-3L0 5.79l4.805 4.804 4.804-4.805-1.054-1.078-3 3V0h-1.5Z"></path>
</svg>
</div>원본 CSS
@font-face {
font-display: block;
font-family: Mori;
font-style: normal;
font-weight: 600;
src: url(https://assets.codepen.io/16327/PPMori-Regular.woff) format("woff");
}
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 200vh;
font-family: "Mori";
color: #fffce1;
background: #0e100f;
}
main {
width: 100%;
height: 200vh;
display: flex;
align-items: center;
justify-content: center;
}
#trigger-container {
position: relative;
display: block;
border-top: dashed 2px grey;
border-bottom: dashed 2px grey;
padding: 4rem;
}
.info {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
width: 300px;
background-color: #191919;
border-radius: 10px;
gap: 1rem;
}
.info h1 {
font-size: 1.2rem;
text-align: center;
}
.info svg {
height: 20px;
}
#windmill {
height: 100%;
width: 100%;
}
#text {
display: inline-block;
width: 200px;
}
.spacer {
height: 100vh;
}원본 JavaScript
const tl = gsap
.timeline({
scrollTrigger: {
trigger: "#trigger-container",
start: "top center",
end: "bottom center",
markers: true,
scrub: true,
onUpdate: (self) => {
text.innerText = `progress ${self.progress.toFixed(2)}`
}
}
})
.to(
"#windmill",
{
rotation: 360,
ease: "none",
duration: 4
}
);
// changing the text in the bar
let inZone = false
ScrollTrigger.create({
start: 0,
end: "max",
onUpdate: (self) => {
if (self.direction !== self.prevDirection && !inZone) {
gsap.to("#arrow", {
rotation: self.direction === 1 ? 0 : -180,
duration: 0.2,
});
self.prevDirection = self.direction;
}
}
});
보관·활용 메모
GSAP Demo Hub의 공개 예제입니다. 원본 HTML·CSS·JavaScript와 설정, 시연 파일을 함께 보관했습니다. 통합 HTML은 공통 스타일과 실행 의존성을 연결한 파일이며 SCSS는 원본 컴파일 결과를 사용합니다.
구형 CodePen 전용 의존성을 그대로 배포하지 않고, 통합 실행에는 공식 GSAP 3.15.0을 연결했습니다. 원본 패널과 원본 설정은 ZIP에 별도로 보존되어 있습니다. 예제의 이미지·폰트 등 외부 소재 요청은 유지됩니다.
보관일 2026-10-26 · 원본 코드·작성자·설정 정보를 보존했습니다. 실제 프로젝트에서 코드와 이미지·폰트의 사용 조건을 확인하세요.