CDN์ผ๋ก ๊ฐ์ ธ์ค๊ธฐ
https://greensock.com/docs/v3/Installation?checked=core,scrollTrigger
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.4/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.4/ScrollTrigger.min.js"></script>
gsap์ ์คํฌ๋กค ์ด๋ฒคํธ๋ฅผ ์ ์ฉํ ๋ ScrollTrigger์ ํจ๊ป ์ฐ์ธ๋ค.
๊ทธ๋ฌ๋ฏ๋ก ๊ฐ์ด cdn์ผ๋ก ๊ฐ์ ธ์๋ค.
๊ณต์ ๋ฌธ์ ์ฝ๊ธฐ
https://greensock.com/get-started/
Getting Started with GSAP
Welcome! In this article we’re going to cover GSAP's core fundamentals and animate some HTML elements. If that’s not your end goal, don’t worry. Whatever you plan to animate, whichever framework you use - the techniques and principles covered here wi
greensock.com
See the Pen GSAP Basic Tween by GreenSock (@GreenSock) on CodePen.
- to()
- from()
- fromTo()
๊ธฐ๋ณธ์์ฑ
to()
์ ๋๋ฉ์ด์ ์ด ๋๋๋ ์ง์ ์ฆ ์ข ๋ฃ๋ ๋ ์์ฑ์ ์ง์ ํฉ๋๋ค.
gsap.to(".element ", {
duration: 0.6,
opacity: 0,
x: 100
});
ํ๊ฒ element ์ 0.6s๋์ ๊ฐ๋ก x 100๋งํผ opacity 0 ์ํ๋ก ๋๋๋ ์ ๋๋ฉ์ด์ ์ด ์ ์ฉ๋ฉ๋๋ค.
from()
์ ๋๋ฉ์ด์ ์ด ์์๋๋ ์์ฑ์ ์ง์ ํฉ๋๋ค.
gsap.from(".element ", {
duration: 0.6,
opacity: 0,
x: 100
});
to()์ ๋ฐ๋๋์ด ์์๋๋ ์ ๋๋ฉ์ด์ ์ผ๋ก ์ ์ฉ๋ฉ๋๋ค.
fromTo()
ํ๊ฒ ์๋ฆฌ๋จผํธ์ ์์๊ณผ ๋์ ํจ๊ป ์ง์ ํด์ฃผ๋ ์์ฑ์ด๋ค.
gsap.fromTo(".element", {
opacity: 0,
}, {
opacity: 1,
y: 20
});
opacity:0 ์ธ ์๋ฆฌ๋จผํธ ํด๋์ค์์ opacity 1๊ณผ ์ธ๋ก 20๋ฐฉํฅ์ผ๋ก ์ด๋ํ๋ ์ ๋๋ฉ์ด์ ์ด๋ค.
์์๊ฐ => ์ข ๋ฃ๊ฐ
codepen
GreenSock on CodePen
Makers of GSAP (GreenSock Animation Platform)
codepen.io
ease
ease ์ต์ ์ ์ ์ฉํ๋ฉด ์๋๋ณํ๋ฅผ ์ ์ฉํ์ฌ ๋ค์ํ ๋๋์ ์ ๋๋ฉ์ด์ ์ ์ด์ฉ ํ ์ ์๋ค.
https://greensock.com/ease-visualizer
Ease Visualizer
Visually explore various easing options for HTML5 animations in GSAP with this interactive tool from GreenSock.
greensock.com
https://greensock.com/forums/topic/24946-scrolltrigger-vs-scrollmagic-repeated-section-elements-animation/https://www.reddit.com/r/webdev/comments/heqc2x/scrollmagic_vs_scrolltrigger/
'study' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ํผ์จ๊ธ]์ปดํจํ ์ฌ๊ณ ์ ๊ฐ๋ฐ ์ค๋ ฅ ๋๋ฆฌ๋ ๊ณต๋ถ๋ฒ (0) | 2023.04.03 |
---|---|
๋ค์ด๋ฒ ๊ตญ์ ๊ฐ์์ง์ ๋ ์ฌ์ดํธ ์ดํด๋ณด๊ธฐ (0) | 2023.03.27 |
Sql ๋ฐ์ดํฐ ์ ๊ทํ ์ดํดํ๊ธฐ (0) | 2023.03.14 |
ChatGPT์ ์ธ๊ณต์ง๋ฅ AI ์๋น์ค ๊ด๋ จ ๊ธฐ์ฌ ์คํฌ๋ฉ (0) | 2023.02.08 |
gulp ์ค์นํ๊ธฐ (0) | 2023.01.08 |