GSAP 원본
Radial Menu
탐색 · MIT (public Pen panels); GSAP Standard No Charge License
갤러리 안에서는 화면을 벗어나거나 움직임을 멈추면 예제도 닫힙니다. 다시 재생할 때는 처음부터 시작해요.
저장한 HTML에서는 갤러리의 재생 설정이 적용되지 않아요.
SOURCE FILES
원본 코드 읽기
수집한 원본 소스와 실행 안내를 함께 제공합니다. 실행 HTML에는 미리보기를 위한 실행 환경이 들어 있습니다.
vendor/gsap-previews/sources/gsap-f424ccf93719/index.html
<div class="header">
<h1>Radial Menu</h1>
<p>Menu items spring out with <code>elastic.out(1, 0.5)</code>. Toggle <code>easeReverse</code> and choose an ease type and speed to see how they affect the reverse animation.</p>
<div class="controls-row">
<div class="toggle-bar">
<label class="toggle" for="easeToggle">
<input type="checkbox" id="easeToggle" role="switch" aria-label="Toggle easeReverse">
<span class="toggle-track"></span>
<span class="toggle-thumb"></span>
</label>
<span class="toggle-label" id="toggleLabel">easeReverse :</span>
</div>
<div class="control-group">
<label for="easeSelect"></label>
<select id="easeSelect" disabled>
<option value="true" selected>true (mirror entrance)</option>
<option value="power3.out">power3.out</option>
<option value="power3.in">power3.in</option>
<option value="expo.in">expo.in</option>
<option value="expo.out">expo.out</option>
<option value="back.in(1.7)">back.in</option>
<option value="back.out(1.7)">back.out</option>
<option value="none">none (linear)</option>
</select>
</div>
<div class="control-group">
<label for="speedSlider">speed</label>
<input type="range" id="speedSlider" min="1" max="3" step="0.1" value="1" />
<span class="speed-val" id="speedVal">1x</span>
</div>
</div>
<div class="status" id="status"></div>
</div>
<div class="fab-wrap" id="fabWrap">
<button class="fab-item" aria-label="Search">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
<circle cx="11" cy="11" r="8" />
<path d="m21 21-4.35-4.35" />
</svg>
</button>
<button class="fab-item" aria-label="Edit">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
<path d="M17 3a2.83 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z" />
</svg>
</button>
<button class="fab-item" aria-label="Upload">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
<polyline points="17 8 12 3 7 8" />
<line x1="12" y1="3" x2="12" y2="15" />
</svg>
</button>
<button class="fab-item" aria-label="Share">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
<circle cx="18" cy="5" r="3" />
<circle cx="6" cy="12" r="3" />
<circle cx="18" cy="19" r="3" />
<line x1="8.59" y1="13.51" x2="15.42" y2="17.49" />
<line x1="15.41" y1="6.51" x2="8.59" y2="10.49" />
</svg>
</button>
<button class="fab" id="fabBtn" aria-label="Toggle actions menu" aria-expanded="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
<line x1="12" y1="5" x2="12" y2="19" />
<line x1="5" y1="12" x2="19" y2="12" />
</svg>
</button>
</div>vendor/gsap-previews/sources/gsap-f424ccf93719/style.css
@font-face {
font-display: block;
font-family: Mori;
font-weight: 400;
src: url(https://assets.codepen.io/16327/PPMori-Regular.woff) format("woff");
}
@font-face {
font-display: block;
font-family: Mori;
font-weight: 600;
src: url(https://assets.codepen.io/16327/PPMori-SemiBold.woff) format("woff");
}
@font-face {
font-display: block;
font-family: Fraktion Mono;
font-weight: 400;
src: url(https://assets.codepen.io/16327/PPFraktionMono-Bold.woff)
format("woff");
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
:root {
--green: #0ae448;
--lt: #abff84;
--black: #0e100f;
--white: #fffce1;
--s75: #bbbaa6;
--s50: #7c7c6f;
--s25: #42433d;
}
html,
body {
width: 100%;
height: 100%;
overflow: hidden;
font-family: Mori, sans-serif;
background: var(--black);
color: var(--white);
display: flex;
flex-direction: column;
align-items: center;
}
.header {
text-align: center;
padding: 40px 24px 0;
max-width: 520px;
}
.header h1 {
font-size: 1.4rem;
font-weight: 600;
margin-bottom: 8px;
}
.header p {
font-size: 0.82rem;
color: var(--s50);
line-height: 1.5;
margin-bottom: 20px;
}
code {
font-family: Fraktion Mono, monospace;
font-size: 0.72rem;
background: rgba(10, 228, 72, 0.08);
color: var(--green);
padding: 2px 6px;
border-radius: 3px;
}
.controls-row {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 20px;
margin-bottom: 16px;
}
.control-group {
display: flex;
align-items: center;
gap: 8px;
font-size: 0.72rem;
color: var(--color-surface50);
}
.toggle-bar {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
}
.toggle {
position: relative;
display: inline-block;
width: 44px;
height: 24px;
cursor: pointer;
}
.toggle input {
opacity: 0;
width: 0;
height: 0;
position: absolute;
cursor: pointer;
z-index: 1;
width: 100%;
height: 100%;
margin: 0;
}
.toggle-track {
position: absolute;
inset: 0;
background: var(--color-surface25);
border-radius: 99px;
}
.toggle-thumb {
position: absolute;
top: 3px;
left: 3px;
width: 18px;
height: 18px;
background: var(--dark);
border-radius: 99px;
pointer-events: none;
}
.toggle input:checked ~ .toggle-track {
background: var(--green);
}
.toggle input:checked ~ .toggle-thumb {
transform: translateX(20px);
}
.toggle input:focus-visible ~ .toggle-track {
outline: 2px solid var(--green);
outline-offset: 2px;
}
.toggle-label {
font-family: Fraktion Mono, monospace;
font-size: 0.78rem;
color: var(--color-surface50);
cursor: pointer;
user-select: none;
}
.toggle-label.is-active {
color: var(--green);
}
select {
font-family: Fraktion Mono, monospace;
font-size: 0.7rem;
background: var(--color-surface25);
color: var(--color-surface-white);
border: 1px solid var(--color-surface50);
border-radius: 6px;
padding: 4px 8px;
cursor: pointer;
outline: none;
}
select:focus {
border-color: var(--green);
}
select:disabled {
opacity: 0.3;
cursor: not-allowed;
}
input[type="range"] {
width: 80px;
accent-color: var(--green);
}
.speed-val {
font-family: Fraktion Mono, monospace;
font-size: 0.66rem;
min-width: 2.5em;
color: var(--color-surface-white);
}
.status {
font-family: Fraktion Mono, monospace;
font-size: 0.7rem;
color: var(--green);
min-height: 1.4em;
opacity: 0;
margin-top: 12px;
}
/* ─── FAB ─── */
.fab-wrap {
position: fixed;
bottom: 40px;
right: 40px;
z-index: 50;
}
.fab {
width: 80px;
height: 80px;
border-radius: 99px;
border: none;
background: var(--gradient-macha),
url("https://assets.codepen.io/16327/noise-e82662fe.png");
background-blend-mode: color-dodge;
color: var(--dark);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
position: relative;
z-index: 2;
box-shadow: 0 8px 32px rgba(10, 228, 72, 0.2);
}
.fab:focus-visible {
outline: 2px solid var(--light);
outline-offset: 3px;
}
.fab svg {
width: 26px;
height: 26px;
}
.fab-item {
position: absolute;
bottom: 10px;
right: 10px;
width: 45px;
height: 45px;
border-radius: 99px;
border: 1px solid var(--color-surface25);
background: var(--color-grey-dark);
color: var(--color-surface75);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
scale: 0;
padding: 0;
z-index: 1;
}
.fab-item:focus-visible {
outline: 2px solid var(--green);
outline-offset: 2px;
}
.fab-item svg {
width: 18px;
height: 18px;
pointer-events: none;
}
/* ─── Status label ─── */
.status {
display: block;
text-align: center;
font-family: Fraktion Mono, monospace;
font-size: 0.75rem;
color: var(--color-surface25);
pointer-events: none;
opacity: 0;
}
/* ─── GSAP logo ─── */
.gsap-logo {
width: 20vw;
max-width: 90px;
position: fixed;
bottom: 15px;
left: 15px;
mix-blend-mode: difference;
z-index: 9999;
}
.gsap-logo img {
width: 100%;
}
함께 쓰는 파일 4개 보기
vendor/gsap-previews/sources/gsap-f424ccf93719/script.js
const items = gsap.utils.toArray(".fab-item");
const radius = 120;
const startAngle = 180;
const endAngle = 270;
const angleStep = (endAngle - startAngle) / (items.length - 1);
let tl,
isOpen = false;
const easeToggle = document.querySelector("#easeToggle");
const easeSelect = document.querySelector("#easeSelect");
const speedSlider = document.querySelector("#speedSlider");
const speedVal = document.querySelector("#speedVal");
speedSlider.addEventListener("input", () => {
speedVal.textContent = parseFloat(speedSlider.value).toFixed(1) + "x";
});
easeToggle.addEventListener("change", (e) => {
const on = e.target.checked;
document.querySelector("#toggleLabel").classList.toggle("is-active", on);
easeSelect.disabled = !on;
buildTimeline();
});
easeSelect.addEventListener("change", () => {
buildTimeline();
});
function getEaseReverse() {
if (!easeToggle.checked) return false;
const val = easeSelect.value;
return val === "true" ? true : val;
}
function buildTimeline() {
if (tl) tl.kill();
gsap.set(".fab-item", { x: 0, y: 0, scale: 0, opacity: 0 });
const erVal = getEaseReverse();
tl = gsap.timeline({ paused: true });
items.forEach((item, i) => {
const angle = (startAngle + angleStep * i) * (Math.PI / 180);
const tx = Math.cos(angle) * radius;
const ty = Math.sin(angle) * radius;
tl.to(
item,
{
x: tx,
y: ty,
scale: 1,
opacity: 1,
duration: 0.6,
ease: "elastic.out(1, 0.5)",
easeReverse: erVal
},
i * 0.05
);
});
tl.to(
"#fabBtn svg",
{
rotation: 135,
duration: 0.35,
ease: "back.out(1.7)",
easeReverse: erVal
},
0
);
tl.to("#status", { opacity: 1, duration: 0.2 }, 0);
isOpen = false;
document.querySelector("#fabBtn").setAttribute("aria-expanded", "false");
}
buildTimeline();
function toggle() {
const speed = parseFloat(speedSlider.value);
if (isOpen) {
const erVal = getEaseReverse();
tl.timeScale(speed).reverse();
document.querySelector("#fabBtn").setAttribute("aria-expanded", "false");
} else {
const erVal = getEaseReverse();
tl.timeScale(1).play();
document.querySelector("#fabBtn").setAttribute("aria-expanded", "true");
}
isOpen = !isOpen;
}
document.querySelector("#fabBtn").addEventListener("click", toggle);
document.addEventListener("keydown", (e) => {
if (e.key === "Escape" && isOpen) toggle();
});
vendor/gsap-previews/sources/gsap-f424ccf93719/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);--color-ui-gradient-background:linear-gradient(135deg,#fbadce,#897dff);--color-text-gradient:linear-gradient(135deg,#fbadce,#897dff);--gradient-summer-fair:linear-gradient(135deg,#ffd28c,#fbadce);--gradient-lipstick:linear-gradient(135deg,#fbadce,#fc7f8e);--gradient-macha:linear-gradient(135deg,#b5f4da,#75d8ed);--color-grey:#898e9f;--color-grey-dark:#414859;--color-scroll-pink-lt:#fbadce;--color-text-purple:#b5a1ff;--surface50:#898e9f;--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-f424ccf93719/adapters/script.js실행 안내·자료
window.__STYLEGALLERY_ASSETS__={};
const items = gsap.utils.toArray(".fab-item");
const radius = 120;
const startAngle = 180;
const endAngle = 270;
const angleStep = (endAngle - startAngle) / (items.length - 1);
let tl, isOpen = false;
const easeToggle = document.querySelector("#easeToggle");
const easeSelect = document.querySelector("#easeSelect");
const speedSlider = document.querySelector("#speedSlider");
const speedVal = document.querySelector("#speedVal");
speedSlider.addEventListener("input", () => {
speedVal.textContent = parseFloat(speedSlider.value).toFixed(1) + "x";
});
easeToggle.addEventListener("change", (e) => {
const on = e.target.checked;
document.querySelector("#toggleLabel").classList.toggle("is-active", on);
easeSelect.disabled = !on;
buildTimeline();
});
easeSelect.addEventListener("change", () => {
buildTimeline();
});
function getEaseReverse() {
if (!easeToggle.checked) return false;
const val = easeSelect.value;
return val === "true" ? true : val;
}
function buildTimeline() {
if (tl) tl.kill();
gsap.set(".fab-item", { x: 0, y: 0, scale: 0, opacity: 0 });
const erVal = getEaseReverse();
tl = gsap.timeline({ paused: true });
items.forEach((item, i) => {
const angle = (startAngle + angleStep * i) * (Math.PI / 180);
const tx = Math.cos(angle) * radius;
const ty = Math.sin(angle) * radius;
tl.to(
item,
{
x: tx,
y: ty,
scale: 1,
opacity: 1,
duration: 0.6,
ease: "elastic.out(1, 0.5)",
easeReverse: erVal
},
i * 0.05
);
});
tl.to(
"#fabBtn svg",
{
rotation: 135,
duration: 0.35,
ease: "back.out(1.7)",
easeReverse: erVal
},
0
);
tl.to("#status", { opacity: 1, duration: 0.2 }, 0);
isOpen = false;
document.querySelector("#fabBtn").setAttribute("aria-expanded", "false");
}
buildTimeline();
function toggle() {
const speed = parseFloat(speedSlider.value);
if (isOpen) {
const erVal = getEaseReverse();
tl.timeScale(speed).reverse();
document.querySelector("#fabBtn").setAttribute("aria-expanded", "false");
} else {
const erVal = getEaseReverse();
tl.timeScale(1).play();
document.querySelector("#fabBtn").setAttribute("aria-expanded", "true");
}
isOpen = !isOpen;
}
document.querySelector("#fabBtn").addEventListener("click", toggle);
document.addEventListener("keydown", (e) => {
if (e.key === "Escape" && isOpen) toggle();
});
LICENSE실행 안내·자료
<!--
Copyright (c) 2026 - GreenSock - https://codepen.io/GreenSock/pen/gbwvbgQ
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
이 장면을 만드는 원리
시각적 닫힘과 실제 조작 가능 상태
opacity·scale로 숨기는 표현과 초점·입력 가능 여부를 별도로 관리합니다.
- 이 예제에서는
- buildTimeline은 반지름 120의 180…270도 호에 네 항목을 놓고 펼침 타임라인을 만듭니다. 토글은 aria-expanded와 isOpen을 바꾸며 Escape도 닫습니다. 원본은 닫힌 항목의 opacity·scale만 0으로 만들고 tabindex·inert를 바꾸지 않아, 시각적 닫힘만으로 키보드 메뉴 계약을 충족하지 않습니다.
코드와 함께 확인하기
코드에서 찾기
buildTimelinescript.js기존 타임라인을 제거하고 새 호 좌표와 역재생 설정을 만듭니다.
aria-expanded="false"index.html토글 버튼이 가지는 명시적 상태 속성입니다.
직접 해보기
닫힌 상태에서 Tab으로 이동합니다.
살펴볼 변화숨겨진 액션에 초점이 가는지 확인하고 시각적 숨김과 입력 숨김을 구분합니다.
열린 상태에서 곡선 설정을 바꾸고 다시 엽니다.
살펴볼 변화isOpen·aria-expanded·아이콘 회전이 함께 초기화되는지 확인합니다.
