- [gsap] gsap 사용하는 법 / cdn으로 사용하기2023년 08월 22일
- KIMJAVAN
- 작성자
- 2023.08.22.:21
728x901. cdn 가져오는 법 https://greensock.com/docs/v3/Installation
(1) 제일 상단 메뉴 docs > installation 섹션에 들어간다
(2) 필요한 효과를 체크 한 후 Browser code부분에 있는 script 코드를 헤더부분에 붙여넣는다.
https://cdnjs.com/libraries/gsap
gsap - Libraries - cdnjs - The #1 free and open source CDN built to make life easier for developers
GSAP is a JavaScript library for building high-performance animations that work in **every** major browser. Animate CSS, SVG, canvas, React, Vue, WebGL, colors, strings, motion paths, generic objects...anything JavaScript can touch! No other library delive
cdnjs.com
혹은 이 사이트에서 cdn을 가져와도 무방하다.
2. 기본 애니메이션 gsap.to()
gsap.to("타겟",{
rotation : 360,
x : 100,
duration : 1
});해당 애니메이션을 실행하면 타겟이 1동안 x만큼 100으로 이동하면서 360도 회전한다.
gsap.to("타겟",{
scrollTrigger : {
}
})gsap.to(".class", { scrollTrigger: { trigger: ".class", markers: false, start: "300px center", end: "300px center", scrub: true, }, top : '15px', });
'자바스크립트 > JS Library' 카테고리의 다른 글
[GSAP] scrub true / 0.5 차이 (1) 2024.06.07 [GSAP] gsap 예시 (0) 2024.01.24 [Swiper Slide] Uncaught SyntaxError: Identifier 'swiper' has already been declared (오류해결) (0) 2023.10.25 [Swiper Slide] 스와이퍼 슬라이드 slides per view + loop 오류 (0) 2023.10.16 [gsap] 애니메이션이 초기화 될 때 (0) 2023.08.07 다음글이전글이전 글이 없습니다.댓글