Posts
Q&A
ģ§ė¬ø ģģµėė¤~!
ģ ė§ ź°ģ¬ķ©ėė¤!! ź°ģ¬ķ©ėė¤~ģ¤ė ķ루ė ģ¦ź±°ģ“ ķ루 ėģøģ„!!!!!
- 0
- 5
- 400
Q&A
ģ§ė¬ø ģģµėė¤~!
ģ§ģ§ ģ£ģ”ķė°ģ ģ ź° ģ“ė ź² ķźø°ģ²ė¼ ģ½ė넼 ģ§°ėė°ģ ķ¹ģ ė“ģ£¼ģ¤ ģ ģģź¹ģ? let btn; let cursorItem; let circle; let x=0, y = 0; let mx=0, my = 0; let scrollTop = 0; let bar; window.onload = function(){ function first(){ btn = document.querySelector(".btn"); cursorItem = document.querySelector(".cursorItem"); circle = cursorItem.querySelector(".circle"); btn.addEventListener("mouseover", function(e){ circle.style.transform = "scale(.3)"; }) btn.addEventListener("mouseout", function(e){ circle.style.transform = "scale(1)"; }) window.addEventListener("mousemove", function(e){ x = e.clientX; y = e.clientY; }); loop(); } function second() { bar = document.getElementsByClassName("bar")[0]; window.addEventListener("scroll", function(e){ scrollTop = document.documentElement.scrollTop; let per = Math.round((scrollTop / (document.documentElement.scrollHeight - window.innerHeight)) * 100); bar.style.height = per + "%"; }, false) } } function loop(){ mx += (x - mx ) * .09; my += (y - my ) * .09; cursorItem.style.transform = "translate("+ mx +"px, "+ my + "px )"; requestAnimationFrame(loop); }
- 0
- 5
- 400
Q&A
ģ§ė¬ø ģģµėė¤~!
ė¹ ė„ø ėµė³ ź°ģ¬ķ©ėė¤~! ź·¼ė° ģ§ģ§ ģ£ģ”ķė°ģ ģ“ķ“ź° ģėģ ć ģ“ź² loop문ģ ķźø°ģ ģė¤ź±°ģ¼ ķėź±“ź°ģ?? window.onload = function(){ ė²ķ¼ ģ“ė²¤ķø ģ¤ķ¬ė”¤ģ“ė²¤ķø ė±ė±ė± ģ ė¶ ģ¬źø°ģ ė£ģ¼ė©“ ė©ėė¤. }
- 0
- 5
- 400