애니메이션 속성을 조금 더 디테일하게 사용하게끔 도와주는 라이브러리 / 플러그인
gsap.to('.image-2',{
x:200
})
gsap.to('.image-3',{
x:300
})
gsap.to('.image-4',{
x:400
})
gsap.to('.image-2',{
xPercent:200
})
gsap.to('.image-3',{
xPercent:300
})
gsap.to('.image-4',{
xPercent:400
})
textmotion1.from('.sc-intro .desc .line',{opacity:0},'a')
circleMotion = gsap.timeline({})
circleMotion.to('.image-2',{
x:200
})
circleMotion.to('.image-3',{
x:300
})
circleMotion.to('.image-4',{
x:400
})
라벨
을 붙이면 됨.circleMotion = gsap.timeline({})
circleMotion.to('.image-2',{
x:200
},'a')
circleMotion.to('.image-3',{
x:300
},'a')
circleMotion.to('.image-4',{
x:400
},'a')
<p>
<span class="line">1</span>
<span class="line">2</span>
<span class="line">3</span>
</p>
textMotion1.from('.sc-intro .desc .line',{opacity:0, stagger:0.1})
data-
를 사용하자!<div>
<p>
<span class="line" data-motion="text">1</span>
<span class="line" data-motion="text">2</span>
<span class="line" data-motion="text">3</span>
</p>
</div>
<a data-motion="text">444</a>
textMotion1.from('.sc-intro [data-motion="text"]',{opacity:0, stagger:0.1})
시작지점을 잡아줄 때 GSAP과 연계해서 사용하는 라이브러리 / 플러그인
circleMotion = gsap.timeline({
scrollTrigger:{
trigger:".sc-history .image"
}
})
circleMotion = gsap.timeline({
scrollTrigger:{
trigger:".sc-history .image",
start:"0% 50%",
end:"100% 50%",
markers:true,
}
})
circleMotion = gsap.timeline({
scrollTrigger:{
trigger:".sc-history .image",
start:"0% 50%",
end:"100% 50%",
markers:true,
toggleActions:"play none none reverse",
}
})
ScrollTrigger.create({
trigger:".sc-history .image",
start:"0% 50%",
end:"100% 50%",
markers:true,
toggleClass:"active",
})
ScrollTrigger.create({
trigger:".sc-history .image",
start:"0% 50%",
end:"100% 50%",
markers:true,
onEnter:function(){
$('.sc-history .image').addClass('active');
},
onLeave:function(){
},
onEnterBack:function(){
},
onLeaveBack:function(){
$('.sc-history .image').removeClass('active');
}
})