미리보기 안의 버튼·입력·포인터로 모션을 확인하세요. 실행 방식은 아래 활용 메모를 참고하세요.
실행용 통합 HTML · 공식 GSAP 3.15.0
<!doctype html>
<!-- Source: https://codepen.io/GreenSock/pen/NWZMKXv; archived original panels separately. Runtime: official GSAP 3.15.0. -->
<html lang="en" class=""><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Shape Index</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://asset.wemashup.com/wp-content/uploads/wm-asset-library/gsap/shared/gOWxmWG.css">
<style>
body {
maring:0;
padding:0;
width:100%;
height:100vh;
display:flex;
align-items:center;
justify-content:center;
fill:rgb(250,225,225);
font-size:17px;
background: #0e100f;
}
main {
display:flex;
width:67%;
flex-wrap: wrap;
max-width:750px;
}
#group {
width:40%;
margin:5%;
text-align:center;
}
#svg-stage {
overflow:visible;
}
code {
color:rgb(255, 135, 9);
}
</style></head><body>
<main>
<div id="group">
<svg id="svg-stage" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<defs>
<linearGradient id="grad" x1="0" y1="0" x2="66" y2="99" gradientUnits="userSpaceOnUse">
<stop offset="0.25" stop-color="rgb(255, 135, 9)"/>
<stop offset="0.85" stop-color="rgb(247, 189, 248)"/>
</linearGradient>
<path id="shapeNew" d="M25.5 50A24.5 24.5 0 1 0 50 74.5 24.5 24.5 0 1 0 74.5 50 24.5 24.5 0 1 0 50 25.5 24.5 24.5 0 1 0 25.5 50z"/>
</defs>
<path class="shape" fill="none" stroke="url(#grad)" d="M50,1l49,49L50,99L1,50L50,1z"/>
</svg>
<p>Shape Index: <code class="morph-shapeIndex">0</code></p>
</div>
</main>
<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-MorphSVGPlugin.min.js"></script>
<script>
const main = document.querySelector("main");
const group = document.querySelector("#group");
for (let i = 0; i < 4; i++) {
if (i > 0) {
const clone = group.cloneNode(true);
const path = clone.querySelector(".shape");
path.id = "shape" + (i + 1);
main.append(clone);
}
}
gsap.set(".morph-shapeIndex", {
innerHTML: (i) => ["default", "3", "6", "9"][i]
});
gsap.to(".shape", {
delay: (i) => i * 0.25,
duration: 2,
ease: "power3.inOut",
yoyo: true,
repeat: -1,
morphSVG: (i) => [
{ shape: "#shapeNew" },
{ shape: "#shapeNew", shapeIndex: 3 },
{ shape: "#shapeNew", shapeIndex: 6 },
{ shape: "#shapeNew", shapeIndex: 9 }
][i]
});
</script></body></html>
원본 HTML
<main>
<div id="group">
<svg id="svg-stage" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<defs>
<linearGradient id="grad" x1="0" y1="0" x2="66" y2="99" gradientUnits="userSpaceOnUse">
<stop offset="0.25" stop-color="rgb(255, 135, 9)"/>
<stop offset="0.85" stop-color="rgb(247, 189, 248)"/>
</linearGradient>
<path id="shapeNew" d="M25.5 50A24.5 24.5 0 1 0 50 74.5 24.5 24.5 0 1 0 74.5 50 24.5 24.5 0 1 0 50 25.5 24.5 24.5 0 1 0 25.5 50z"/>
</defs>
<path class="shape" fill="none" stroke="url(#grad)" d="M50,1l49,49L50,99L1,50L50,1z"/>
</svg>
<p>Shape Index: <code class="morph-shapeIndex">0</code></p>
</div>
</main>원본 CSS
body {
maring:0;
padding:0;
width:100%;
height:100vh;
display:flex;
align-items:center;
justify-content:center;
fill:rgb(250,225,225);
font-size:17px;
background: #0e100f;
}
main {
display:flex;
width:67%;
flex-wrap: wrap;
max-width:750px;
}
#group {
width:40%;
margin:5%;
text-align:center;
}
#svg-stage {
overflow:visible;
}
code {
color:rgb(255, 135, 9);
}원본 JavaScript
const main = document.querySelector("main");
const group = document.querySelector("#group");
for (let i = 0; i < 4; i++) {
if (i > 0) {
const clone = group.cloneNode(true);
const path = clone.querySelector(".shape");
path.id = "shape" + (i + 1);
main.append(clone);
}
}
gsap.set(".morph-shapeIndex", {
innerHTML: (i) => ["default", "3", "6", "9"][i]
});
gsap.to(".shape", {
delay: (i) => i * 0.25,
duration: 2,
ease: "power3.inOut",
yoyo: true,
repeat: -1,
morphSVG: (i) => [
{ shape: "#shapeNew" },
{ shape: "#shapeNew", shapeIndex: 3 },
{ shape: "#shapeNew", shapeIndex: 6 },
{ shape: "#shapeNew", shapeIndex: 9 }
][i]
});검증·권리 정보
- 실행 검증
- 데스크톱 실행 확인
- 검증 수준
- 샘플 실행
- 권리 확인
- 확인 필요
shapeIndex 값에 따라 달라지는 SVG 변형 경로를 비교합니다.
Chromium 153 · 데스크톱 1280×900 · 격리 iframe에서 wait 입력과 화면 변화 확인. 모바일·프로젝트 적용은 미검증.
원본 패널은 보존하고 실행용 문서에 공식 GSAP 3.15.0과 공통 의존성을 연결했습니다. 모션 감소 설정과 실제 프로젝트 적용은 별도로 확인하세요.
보관·활용 메모
GSAP Demo Hub의 공개 예제입니다. 원본 HTML·CSS·JavaScript와 설정, 시연 파일을 함께 보관했습니다. 통합 HTML은 공통 스타일과 실행 의존성을 연결한 파일이며 SCSS는 원본 컴파일 결과를 사용합니다.
구형 CodePen 전용 의존성을 그대로 배포하지 않고, 통합 실행에는 공식 GSAP 3.15.0을 연결했습니다. 원본 패널과 원본 설정은 ZIP에 별도로 보존되어 있습니다. 예제의 이미지·폰트 등 외부 소재 요청은 유지됩니다.
보관일 2026-10-27 · 공개 원본의 코드·제작자·설정을 보존했습니다. GSAP 엔진과 개별 코드·이미지·폰트의 사용 조건은 각각 확인해야 합니다. 자유 재배포 허용으로 판단한 자료가 아닙니다.