按钮动画

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>按钮动画</title>
    <style type="text/css">
        *{
            margin:0;
            padding:0;
            box-sizing: border-box;
            font-family: sans-serif;
        }
        body{
            background: #fcfcfc;
        }
        #btn-grp{
            max-width: 768px;
            margin:auto;
        }
        h1,h2,h3,h4{
            text-align: center;
            margin-bottom: 25px;
            color: #7f8c8d;
        }
        p{
            color: #7f8c8d;
            text-align: center;
        }
        .btn{
            margin: 25px auto;
            position: relative;
            font-size: 25px;
            color: #fff;
            padding: 20px;
            width: 200px;
            overflow: hidden;
            text-align: center;
            cursor: pointer;
            text-transform: uppercase;
        }
        .btn:nth-of-type(1){
            background-color: #2ecc71;
        }
        .btn:nth-of-type(2){
            background-color:#3498db;
        }
        .btn:nth-of-type(3){
            background-color: #e74c3c;
        }
        .btn.left:after{
            left: 0;
        }
        .btn.wave:after{
            content: "";
            background: #fff;
            display: block;
            position: absolute;
            width: 200%;
            height: 200%;
            top:-5%;
            border-radius: 50px;
            margin-left: -30%;
            opacity: 0;
            transition: all 0.75s ease-in-out;
        }
        .btn.wave:active:after{
            width: 0px;
            opacity: 1;
            transition: 0s;
        }
        .btn.half-stroke:after{
            content: "";
            background:#fff;
            display: block;
            position: absolute;
            width: 100%;
            height: 100%;
            top:0;
            opacity: 0;
            transition: all 0.75s ease-in-out
        }
        .btn.half-stroke:active:after{
            width: 0px;
            opacity: 1;
            transition: 0s;
        }
        .btn.bubble:after{
            content: "";
            background: #fff;
            position: absolute;
            width: 200px;
            height: 200px;
            left: 0;
            top:0;
            right: 0;
            bottom:0;
            opacity: 0;
            margin:auto;
            border-radius: 50%;
            transform: scale(1);
            transition: all 0.75s ease-in-out;
        }
        .btn.bubble:active:after{
            transform: scale(0);
            opacity: 1;
            transition: 0s;
        }
    </style>
</head>
<body>
<p>水波动画</p>
<div class="btn wave left">Click</div>
<p>缓慢的笔刷动画</p>
<div class="btn half-stroke left">Click</div>
<p>气泡动画</p>
<div class="btn bubble left">Click</div>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值