QQ技术网 —— 专注活动线报、绿色软件、网站源码、教程分享与资源导航。 首页按栏目实时聚合最新内容,方便你快速发现所需,也让搜索引擎更懂本站的核心更新。

按钮闪光动画css html源码

按钮闪光动画css html源码

演示

源码

html

[lv]

<div class="btn-animate btn-animate__shiny">
    QQ资源吧m.qqzy8.com
</div>

[/lv]

css

[lv]

.btn-animate {
  position: relative;
  width: 130px;
  height: 40px;
  line-height: 40px;
  border: none;
  border-radius: 5px;
  background: #027efb;
  color: #fff;
  text-align: center;
}

@keyframes shiny-btn {
  0% {
    transform: scale(0) rotate(45deg);
    opacity: 0;
  }
  10% {
    transform: scale(0) rotate(45deg);
    opacity: 0.5;
  }
  21% {
    transform: scale(4) rotate(45deg);
    opacity: 1;
  }
  100% {
    transform: scale(50) rotate(45deg);
    opacity: 0;
  }
}

.btn-animate__shiny {
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: -150%;
    left: 0;
    width: 30px;
    height: 100%;
    background-color: #fff;
  }

  &:hover {
    &::before {
      animation: shiny-btn .8s ease-in-out;
    }
  }
}

[/lv]

评论

昵称
邮箱
主页