Welcome 您好!

    

悬停按钮效果 纯css按钮悬停动画

悬停按钮效果.jpg


引入JS:<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
HTML

<div class="container">
    <a href="http://www.yqsqu.cn"><button class="btn-pill">
        <span>亿七代刷网</span>
      </button></a>
    <a href="http://www.17daigua.cn"><button class="btn-shine">
        <span>亿七代挂网</span>
      </button></a>
    <a href="http://www.aisyq.cn"><button class="btn-slide-line">
        <span>亿七官网</span>
      </button></a>
    <button class="btn-slide-line center">
        <span>Line Center</span>
      </button>
</div>

<script>
</script>

CSS

<style>
body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #232323; 
}

.container {
  width: 80%;
  height: 450px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

button {
  position: relative;
  margin: 0;
  padding: 5px 12px;
  height: 60px;
  width: 150px;
  outline: none;
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  text-transform: uppercase;
  background-color: #ffffff;
  border: 1px solid rgba(22, 76, 167, 0.6);
  border-radius: 10px;
  color: #1d89ff;
  font-weight: 400;
  font-size: 20px;
  font-family: inherit;
  z-index: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.02, 0.01, 0.47, 1);
}
button span {
  color: #164ca7;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.7px;
}
button:hover {
  animation: rotate 0.7s ease-in-out both;
}
button:hover span {
  animation: storm 0.7s ease-in-out both;
  animation-delay: 0.06s;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg) translate3d(0, 0, 0);
  }
  25% {
    transform: rotate(3deg) translate3d(0, 0, 0);
  }
  50% {
    transform: rotate(-3deg) translate3d(0, 0, 0);
  }
  75% {
    transform: rotate(1deg) translate3d(0, 0, 0);
  }
  100% {
    transform: rotate(0deg) translate3d(0, 0, 0);
  }
}
@keyframes storm {
  0% {
    transform: translate3d(0, 0, 0) translateZ(0);
  }
  25% {
    transform: translate3d(4px, 0, 0) translateZ(0);
  }
  50% {
    transform: translate3d(-3px, 0, 0) translateZ(0);
  }
  75% {
    transform: translate3d(2px, 0, 0) translateZ(0);
  }
  100% {
    transform: translate3d(0, 0, 0) translateZ(0);
  }
}
.btn-pill:before, .btn-pill:after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #1d89ff;
  content: '';
  opacity: 0;
  transition: transform 0.15s cubic-bezier(0.02, 0.01, 0.47, 1), opacity 0.15s cubic-bezier(0.02, 0.01, 0.47, 1);
  z-index: -1;
  transform: translate(100%, -25%) translate3d(0, 0, 0);
}
.btn-pill:hover:before, .btn-pill:hover:after {
  opacity: 0.15;
  transition: transform 0.2s cubic-bezier(0.02, 0.01, 0.47, 1), opacity 0.2s cubic-bezier(0.02, 0.01, 0.47, 1);
}
.btn-pill:hover:before {
  transform: translate3d(50%, 0, 0) scale(0.9);
}
.btn-pill:hover:after {
  transform: translate(50%, 0) scale(1.1);
}

.btn-shine {
  border: 1px solid;
  overflow: hidden;
  position: relative;
}
.btn-shine span {
  z-index: 20;
}
.btn-shine:after {
  background: #38ef7d;
  content: "";
  height: 155px;
  left: -75px;
  opacity: .4;
  position: absolute;
  top: -50px;
  transform: rotate(35deg);
  transition: all 550ms cubic-bezier(0.19, 1, 0.22, 1);
  width: 50px;
  z-index: -10;
}
.btn-shine:hover:after {
  left: 120%;
  transition: all 550ms cubic-bezier(0.19, 1, 0.22, 1);
}

.btn-slide-line.center:after {
  left: 50%;
}
.btn-slide-line:after {
  position: absolute;
  right: 0;
  left: auto;
  transition: .3s;
  content: '';
  width: 0;
  bottom: 0;
  height: 3px;
  background: #164ca7;
}
.btn-slide-line:hover {
  cursor: pointer;
}
.btn-slide-line:hover:after {
  width: 100%;
  left: 0;
}
</style>

亿七Seven

添加新评论

快乐地过是一天,不快乐地过也是一天,我为什么不快快乐乐地过每一天呢?

岂能尽随人愿,但求无愧我心。

在你内心深处,还有无穷的潜力,有一天当你回首看时,你就会知道这绝对是真的。

活在当下,别在怀念过去或者憧憬未来中浪费掉你现在的生活。

挫折时,要像大树一样,被砍了,还能再长;也要像杂草一样,虽让人践踏,但还能勇敢地活下去。