티스토리 뷰

function mousemove(e){
   let positionSlow = (e.pageX - (window.innerWidth/2)) * 0.1;
   let positionFast = (e.pageX - (window.innerWidth/2)) * 0.2;

   gsap.to(".spanSlow", {duration: 0.4, x: positionSlow})
   gsap.to(".spanFast", {duration: 0.4, x: -positionFast})
   gsap.to(".cursor", {duration: 0.3, left: e.pageX, top: e.pageY})
}

document.addEventListener("mousemove", mousemove)

'Script Sample > Mouse Effect' 카테고리의 다른 글

Mouse Effect07 - 이미지 오버  (0) 2022.04.15
Mouse Effect05 - 이미지효과2  (0) 2022.02.25
Mouse Effect04 - 이미지효과  (0) 2022.02.25
Mouse Effect03 - 조명효과  (0) 2022.02.25
Mouse Effect02 - 따라다니기2  (0) 2022.02.25
댓글
© 2018 webstoryboy