水波纹按钮动画

简介: 水波纹按钮动画

生活是种律动,须有光有影,有左有右,有晴有雨。——老舍

代码:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
    <style type="text/css">
      .login {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 200px;
      }
      .button {
        background-color: #ff3539;
        height: 100px;
        width: 100px;
        border-radius: 50px;
        line-height: 100px;
        text-align: center;
        color: #fff;
      }
      @keyframes shockwave {
        0% {
          transform: scale(1);
          box-shadow: 0 0 2px rgba(0, 0, 0, 0.15), inset 0 0 1px rgba(0, 0, 0, 0.15);
        }
        95% {
          box-shadow: 0 0 50px transparent, inset 0 0 30px transparent;
        }
        100% {
          transform: scale(2.25);
        }
      }
      @keyframes shockwaveJump {
        0% {
          transform: scale(1);
        }
        40% {
          transform: scale(1.08);
        }
        50% {
          transform: scale(0.98);
        }
        55% {
          transform: scale(1.02);
        }
        60% {
          transform: scale(0.98);
        }
        100% {
          transform: scale(1);
        }
      }
      .btn--shockwave.is-active {
        z-index: 12;
        animation: shockwaveJump 1s ease-out infinite;
      }
      .btn--shockwave.is-active:after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        border-radius: 50%;
        animation: shockwave 1s .65s ease-out infinite;
      }
      .btn--shockwave.is-active:before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        border-radius: 50%;
        animation: shockwave 1s .5s ease-out infinite;
      }
    </style>
  </head>
  <body>
    <div class="login">
      <div class="button btn--shockwave is-active">点我</div>
    </div>
  </body>
</html>


效果:

image.png

目录
打赏
0
0
0
0
29
分享
相关文章
CSS动画效果(鼠标滑过按钮动画)
CSS动画效果(鼠标滑过按钮动画)
按钮点击效果(水波纹)
近来看到个不错的按钮点击效果,当点击时产生一次水波涟漪效果,挺好玩的,于是简单的实现了下(没考虑低版本浏览器兼容问题) 先看看效果吧,如下图(录制gif软件有点渣,看起来卡卡的...) 这种效果可以由元素内嵌套canves实现,也可以由css3实现。
1367 0
跟随滚动条漂浮的返回顶部按钮效果
比较优秀的一款超过一屏高度才显示的,跟随滚动条漂浮的返回顶部按钮特效代码。 test body{ height:2000px;} .rTop{ width:100px; height:25px; text-align:center; font-size:small; line...
833 0
uwp - 做一个相对炫酷的动画按钮/按钮动画
原文:uwp - 做一个相对炫酷的动画按钮/按钮动画   看腻了系统自带的button animation何不尝试下自定义一个较为炫酷的动画顺便提升用户体验。效果图: 动画分为几个部分,分别是:内圆从中心放大(1)并同时渐隐(2),外圆从中心放大(3)并同时渐隐(4),按钮整体从中心缩小放大(5),非常简单对吧,代码也是。
1123 0
右下角浮窗&动画效果
2015-07-17 11:07:57 CSS 1 #goreg { 2 width: 70px; 3 position: fixed; 4 bottom: 20px; 5 right: 25px; 6 z-index: 100; 7 opacity:0.
1085 0
鼠标拖拽翻页效果
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/w178191520/article/details/84192737 ...
1007 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等