GSAP 원본
Cursor-driven perspective tilt
포인터 · MIT (public Pen panels); GSAP Standard No Charge License
갤러리 안에서는 화면을 벗어나거나 움직임을 멈추면 예제도 닫힙니다. 다시 재생할 때는 처음부터 시작해요.
저장한 HTML에서는 갤러리의 재생 설정이 적용되지 않아요.
SOURCE FILES
원본 코드 읽기
수집한 원본 소스와 실행 안내를 함께 제공합니다. 실행 HTML에는 미리보기를 위한 실행 환경이 들어 있습니다.
vendor/gsap-previews/sources/gsap-04d3c860a861/index.html
<main>
<div class="logo-outer">
<svg class="logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 623 231">
<path fill="#0e100f" d="m182 108-8 36c-1 2-3 3-5 3h-10l-2 2c-9 31-21 52-37 65a82 82 0 0 1-54 16c-21 0-35-6-47-19-15-18-21-46-18-81C8 66 42 1 105 1c20 0 35 6 46 18s16 32 16 57c0 2-1 4-4 4h-46c-2 0-4-2-4-3 0-18-5-26-15-26-18 0-29 24-34 38-8 19-12 40-11 60 0 10 2 23 11 29 8 5 19 2 26-4 7-5 12-15 15-23v-3l-2-1H91l-4-1v-3l8-36c0-2 2-3 4-3h79c2 0 4 2 4 4Z M317 67c0 2-2 4-4 4h-43c-3 0-5-3-5-5 0-13-4-19-13-19s-15 5-15 15c0 11 6 20 23 37 22 21 31 40 31 65-1 41-28 67-69 67-22 0-38-6-48-17-11-11-16-28-15-50 0-2 2-4 4-4h44l4 2v3c0 7 1 13 4 16 2 3 5 4 8 4 9 0 13-6 14-16 0-9-3-17-18-33-20-19-37-39-36-70 0-18 7-35 20-47s31-19 52-19c22 0 38 6 48 18 10 11 15 28 14 49Zm134 156V8a4 4 0 0 0-4-4h-67c-2 0-3 2-4 3l-96 215c-1 3 1 6 4 6h46c3 0 4-1 5-3l10-22c1-3 1-3 4-3h45c3 0 3 0 3 3l-1 21a4 4 0 0 0 4 4h47l3-2a4 4 0 0 0 1-3Zm-83-71h-1a1 1 0 0 1-1-2l1-1 33-83 1-3h1l-3 85c-1 4-1 4-4 4h-27ZM545 4h-35c-2 0-4 1-4 3l-50 216a3 3 0 0 0 1 3l3 2h45c2 0 4-2 4-4l5-24c1-2 0-3-2-4l-2-2-8-4-7-4-3-1a1 1 0 0 1-1-1 2 2 0 0 1 2-2h24c7 0 14 0 21-2 51-9 84-50 85-105 1-47-25-71-77-71h-1Zm-12 129h-1l-2-1 14-62-1-3-22-12a1 1 0 0 1 0-1 2 2 0 0 1 1-2h32c10 0 16 10 16 25-1 27-13 55-37 56Zm48 95c8 0 13-6 13-13 0-8-5-14-13-14-7 0-13 6-13 14 0 7 6 13 13 13Zm-10-14c0-6 4-10 10-10s10 4 10 10c0 7-3 11-10 11s-10-4-10-11Zm5 7h4v-5h1c3 0 2 5 3 5h4c-1 0 0-6-3-6 1-1 3-2 3-4s-2-4-6-4h-6v14Zm4-8v-3h1c2 0 2 0 2 2l-2 1h-1Z"/>
</svg>
</div>
</main>vendor/gsap-previews/sources/gsap-04d3c860a861/style.css
html,
body {
margin: 0;
padding: 0;
}
main {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100vh;
background: #0e100f;
background-blend-mode: color-dodge;
}
.logo-outer {
width: 50%;
height: 50%;
background: radial-gradient(89.08% 84.62% at 16.54% 78.46%,#fbfefa 0%,#c9f6b4 39.58%,#abff84 77.6%,#2fee65 100%),
url("https://assets.codepen.io/16327/noise-e82662fe.png");
border-radius: 3rem;
display: flex;
align-items: center;
justify-content: center;
}
svg.logo {
width: 66%;
max-height: 66%;
}
함께 쓰는 파일 4개 보기
vendor/gsap-previews/sources/gsap-04d3c860a861/script.js
const main = document.querySelector("main");
gsap.set("main", { perspective: 650 });
const outerRX = gsap.quickTo(".logo-outer", "rotationX", { ease: "power3" });
const outerRY = gsap.quickTo(".logo-outer", "rotationY", { ease: "power3" });
const innerX = gsap.quickTo(".logo", "x", { ease: "power3" });
const innerY = gsap.quickTo(".logo", "y", { ease: "power3" });
main.addEventListener("pointermove", (e) => {
outerRX(gsap.utils.interpolate(15, -15, e.y / window.innerHeight));
outerRY(gsap.utils.interpolate(-15, 15, e.x / window.innerWidth));
innerX(gsap.utils.interpolate(-30, 30, e.x / window.innerWidth));
innerY(gsap.utils.interpolate(-30, 30, e.y / window.innerHeight));
});
main.addEventListener("pointerleave", (e) => {
outerRX(0);
outerRY(0);
innerX(0);
innerY(0);
});
vendor/gsap-previews/sources/gsap-04d3c860a861/adapters/host.css실행 안내·자료
/* StyleGallery host styles: independent replacement for unavailable shared Pen CSS. */
:root{--color-just-black:#111522;--color-surface-white:#f7f3ec;--color-surface75:#cfccc6;--color-surface50:#898e9f;--color-surface25:#414859;--color-shockingly-green:#95efd2;--color-lt-green:#b5f4da;--color-pink:#fbadce;--color-purple:#897dff;--color-lilac:#b5a1ff;--color-orangey:#ffd28c;--color-blue:#75d8ed;--color-ui-gradient:linear-gradient(135deg,#fbadce,#897dff);--light:#f7f3ec;--dark:#111522;--mid:#898e9f}
*{box-sizing:border-box}body{background:#111522;color:#f7f3ec;font-family:system-ui,sans-serif;margin:0;min-height:100vh;width:100%}button,input{font:inherit}button,.button{background:#111522;border:1px solid #898e9f;border-radius:.55rem;color:#f7f3ec;cursor:pointer;padding:.65rem 1rem}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #95efd2;outline-offset:4px}h1,h2,h3,h4{line-height:1.15}h4{font-weight:500}code{font-family:ui-monospace,monospace}.heading-l{font-size:clamp(2rem,6vw,5rem)}.heading-text{font-size:clamp(1.5rem,4vw,3rem)}.box{background:#95efd2;border-radius:14px;height:clamp(38px,12vw,80px);width:clamp(38px,12vw,80px)}.green{background:#95efd2}.purple{background:#897dff}.orange{background:#ffd28c}.gradient-pink{background:linear-gradient(140deg,#fbadce,#fc7f8e)}.gradient-purple{background:linear-gradient(140deg,#b5a1ff,#537ff7)}.center{align-items:center;display:flex;justify-content:center}.text-center{text-align:center}.panel{min-height:100vh;width:100%}.flair:not(img){background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNDgiIGhlaWdodD0iMjQ4IiB2aWV3Qm94PSIwIDAgMjQ4IDI0OCI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJnIiB4Mj0iMSIgeTI9IjEiPjxzdG9wIHN0b3AtY29sb3I9IiNiNWExZmYiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM3NWQ4ZWQiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48ZyBmaWxsPSJ1cmwoI2cpIj48cGF0aCBkPSJNODcgMjBoNzR2NjdoNjd2NzRoLTY3djY3SDg3di02N0gyMFY4N2g2N1oiLz48L2c+PC9zdmc+");background-position:center;background-repeat:no-repeat;background-size:contain;height:80px;width:80px}.flair--3:not(img){background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNDgiIGhlaWdodD0iMjQ4IiB2aWV3Qm94PSIwIDAgMjQ4IDI0OCI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJnIiB4Mj0iMSIgeTI9IjEiPjxzdG9wIHN0b3AtY29sb3I9IiM5NWVmZDIiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM1MzdmZjciLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48ZyBmaWxsPSJ1cmwoI2cpIj48Y2lyY2xlIGN4PSIxMjQiIGN5PSIxMjQiIHI9Ijg4IiBmaWxsPSJub25lIiBzdHJva2U9InVybCgjZykiIHN0cm9rZS13aWR0aD0iNDgiLz48Y2lyY2xlIGN4PSIxODMiIGN5PSI2MCIgcj0iMjMiIGZpbGw9IiNmNmYzZWIiLz48L2c+PC9zdmc+")}.braces{font-size:1rem}img{max-width:100%}
/* External font programs are omitted; preserve readable fallback typography. */
body,button,input,h1,h2,h3,h4,p,span,div{font-family:inherit}body{font-family:system-ui,sans-serif}code,pre{font-family:ui-monospace,monospace}
vendor/gsap-previews/sources/gsap-04d3c860a861/adapters/script.js실행 안내·자료
window.__STYLEGALLERY_ASSETS__={};
const main = document.querySelector("main");
gsap.set("main", { perspective: 650 });
const outerRX = gsap.quickTo(".logo-outer", "rotationX", { ease: "power3" });
const outerRY = gsap.quickTo(".logo-outer", "rotationY", { ease: "power3" });
const innerX = gsap.quickTo(".logo", "x", { ease: "power3" });
const innerY = gsap.quickTo(".logo", "y", { ease: "power3" });
main.addEventListener("pointermove", (e) => {
outerRX(gsap.utils.interpolate(15, -15, e.y / window.innerHeight));
outerRY(gsap.utils.interpolate(-15, 15, e.x / window.innerWidth));
innerX(gsap.utils.interpolate(-30, 30, e.x / window.innerWidth));
innerY(gsap.utils.interpolate(-30, 30, e.y / window.innerHeight));
});
main.addEventListener("pointerleave", (e) => {
outerRX(0);
outerRY(0);
innerX(0);
innerY(0);
});
LICENSE실행 안내·자료
<!--
Copyright (c) 2024 - GreenSock - https://codepen.io/GreenSock/pen/qBzaNQy
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall
be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
-->
GSAP 3.15.0
Copyright 2026, GreenSock. All rights reserved.
Subject to the Standard No Charge License: https://gsap.com/standard-license.
The full notice in each original GSAP library file is preserved.
StyleGallery host adapter and replacement SVG subjects: locally authored.
BEHIND THE EXAMPLE
이 장면을 만드는 원리
서로 다른 속성의 최신 목표
겹치는 표현은 각 속성의 소유자를 나누고 입력 종료 시 정착점을 정의합니다.
- 이 예제에서는
- 네 quickTo가 바깥 rotationX·rotationY와 안쪽 x·y를 각각 소유합니다. 화면 비율을 회전 ±15도와 내부 이동 ±30으로 보간하고 pointerleave에서는 네 목표를 0으로 되돌립니다. 좌표 기준은 카드 경계가 아니라 프리뷰의 전체 window 크기입니다.
