½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
¸¶¿ì½º ¿À¹ö ¹öư È¿°ú  Minimalist Button Hover Effect : happycgi
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > CSS > ¹öư > ¸¶¿ì½º ¿À¹ö ¹öư È¿°ú Minimalist Button Hover Effect »ó¼¼Á¤º¸
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
Javascript
php
html
CSS
ASP
API
mysql
jquery
image
slide
Mobile
¸Þ´º
°Ô½ÃÆÇ
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
¸¶¿ì½º ¿À¹ö ¹öư È¿°ú Minimalist Button Hover Effect
¼Ò½ºÅë°èÁ¤º¸ ¿À·ù½Å°í ¹× ¹®ÀÇ
ÇØÇÇÆÀ
³×ƼÁð
Æ®À§ÅÍ·Î º¸³»±â ÆäÀ̽ººÏÀ¸·Î º¸³»±â
¼Ò½ººÐ·ù ¹öư
´Ù¿î·Îµå Ƚ¼ö 0 ȸ
°£´Ü¼³¸í ¸¶¿ì½º¸¦ ¿Ã¸®¸é µðÀÚÀÎÀÌ º¯°æµÇ´Â ±ò²ûÇÏ°í ½ÉÇÃÇÑ ´À³¦ÀÇ ¹öư È¿°úÀÔ´Ï´Ù.
Æò°¡Çϱâ ÈǸ¢ÇÔ ¸Å¿ìÁÁÀ½ ÁÁÀ½ ±¦ÂúÀ½ º¸Åë º°·Î
ȨÆäÀÌÁö¹Ù·Î°¡±â ¼Ò½º´Ù¿î·Îµå µ¥¸ð ¹Ì¸®º¸±â ½ºÅ©·¦Çϱâ
 


¸¶¿ì½º¸¦ ¿Ã¸®¸é µðÀÚÀÎÀÌ º¯°æµÇ´Â ±ò²ûÇÏ°í ½ÉÇÃÇÑ ´À³¦ÀÇ ¹öư È¿°úÀÔ´Ï´Ù.

ÀÀ¿ëÇÏ¿© ´Ù¾çÇÏ°Ô È°¿ë °¡´ÉÇÕ´Ï´Ù.


HTML ±¸Á¶

<div class="container">

  <div id="cursor">

    <div class="cursor__inner"></div>

  </div>

  <a href="#" class="button" cursor-class="overlay">

    <span class="button-text">Hover</span>

    <span class="button-text foreground-text">Swipe</span>

  </a>

</div>



CSS ¼Ò½º

* {

  margin: 0;

  padding: 0;

  border-sizing: border-box;

}


html, body {

  width: 100%;

  height: 100%;

  border: none;

  outline: none;

}


body {

  display: flex;

  align-items: center;

  justify-content: center;

  background-color: #d2f7d3;

}


#cursor {

  position: fixed;

  z-index: 100;

  left: 0;

  top: 0;

  pointer-events: none;

  will-transfrm: transform;

}


.cursor__inner {

  width: 4rem;

  height: 4rem;

  border-radius: 50%;

  transform: translate(-50%, -50%);

  border: 1px solid #9e57d9;

  transition: all .6s cubic-bezier(0.16, 1, 0.3, 1),

              opacity .3s cubic-bezier(0.16, 1, 0.3, 1);

}


.hide .cursor__inner {

  opacity: 0;

  width: 2.5vw;

  height: 2.5vw;

}


#cursor.overlay {

  z-index: 1;

}


.overlay .cursor__inner {

  width: 3rem;

  height: 3rem;

  background-color: #c185f230;

  border-color: transparent;

}


.button {

  display: flex;

  align-items: center;

  justify-content: center;

  width: 200px;

  height: 200px;

  text-decoration: none;

  border-radius: 50%;

  border: 1px solid #c185f2;

  text-align: center;

  color: #9e57d9;

  font-family: "Venn-extended", sans-serif;

  text-transform: uppercase;

  font-weight: bolder;

  transition: all .3s cubic-bezier(0.16, 1, 0.3, 1);

}


.button .button-text {

  position: absolute;

}


.button .foreground-text {

  opacity: 0;

  z-index: 1;

  color: #f7f7f7;

}


.button::after {

  content: "";

  position: relative;

  z-index: 0;

  width: 0;

  height: 0;

  border-radius: 50%;

  background-color: #ffffff;

  transition: all .6s cubic-bezier(0.16, 1, 0.3, 1);

}


@media (hover: hover) and (pointer: fine) {

  .button:hover {

    border-color: transparent;

  }

  

  .button:hover::after {

    width: 100%;

    height: 100%;

  }

  

  .button:hover .button-text.foreground-text {

    opacity: 1;

    color: #9e57d9;

  }

}


JS ¼Ò½º

const cursor = document.querySelector("#cursor")


let mouse = { x: -100, y: -100 }

let pos = { x: 0, y: 0 }

const speed = 0.1


const updateCoordinates = (e) => {

  mouse.x = e.clientX

  mouse.y = e.clientY

}


window.addEventListener("mousemove", updateCoordinates)


const updatePosition = () => {

  pos.x += (mouse.x - pos.x) * speed

  pos.y += (mouse.y - pos.y) * speed

  cursor.style.transform =

    "translate3d(" + pos.x + "px ," + pos.y + "px, 0)"

}


const loop = () => {

  updatePosition()

  requestAnimationFrame(loop)

}


requestAnimationFrame(loop)


const cursorModifiers = document.querySelectorAll("[cursor-class]")


cursorModifiers.forEach((cursorModifier) => {

  cursorModifier.addEventListener("mouseenter", function () {

    let attribute = this.getAttribute("cursor-class")

    cursor.classList.add(attribute)

  })

  

  cursorModifier.addEventListener("mouseleave", function () {

    let attribute = this.getAttribute("cursor-class")

    cursor.classList.remove(attribute)

  })

})


ÇØ´ç »çÀÌÆ®·Î À̵¿Çؼ­ Àüü ¼Ò½º¸¦ È®ÀÎÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.



³×ƼÁð ÀÇ°ß   ÀÌ¿ëÇϽŠÀÚ·áÀÇ Èı⸦ ÀÚÀ¯·Ó°Ô ÀÛ¼ºÇϼ¼¿ä. (»ó¾÷ÀûÀÎ ±¤°í ¹× µµ¹è¼º ±Û µîÀº »çÀüÅ뺸¾øÀÌ »èÁ¦µÉ ¼ö ÀÖ½À´Ï´Ù.)
³»¿ë ¾ÆÀ̵ð Àǰ߳²±â±â
µî·ÏµÈ ÀǰßÀÌ ¾ø½À´Ï´Ù.
1
À̸§
³»¿ë
:³×¸Â¾Æ¿ä: :È­³ª´Â±º¿ä: :Àá¿Í: :¿ì¿ïÇØ: :À̰ǾƳÄ: :¿ÕÇÏÇÏ: ¿Õ¿ôÀ½~ ³î·¥~
Æò°¡Çϱâ ÈǸ¢ÇÔ ¸Å¿ìÁÁÀ½ ÁÁÀ½ ±¦ÂúÀ½ º¸Åë º°·Î
µµ¹è¹æÁöŰ
 65614256 º¸ÀÌ´Â µµ¹è¹æÁö۸¦ ÀÔ·ÂÇϼ¼¿ä.