神奇的css(动态水滴)

当看到你的时候,哇哦,这感觉来了!好神奇的css吖


效果(是动态的水滴,这里只是一帧图片)

在这里插入图片描述

水滴样式网址


代码

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Water</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body{
            width: 100vw;
            height: 100vh;
            display: flex;
            justify-content: center;
            background-color: #00a8ff;
        }
        #water{
            margin-top: 200px;
            width: 300px;
            height: 300px;
            /* border: 1px solid #000; */
            border-radius: 47% 53% 56% 44% / 30% 28% 72% 70% ;
            /* 内层阴影  左上为正值,右下为负值*/
            box-shadow: inset 10px 20px 30px rgba(0, 0, 0, 0.5),
            10px 10px 20px rgba(0, 0, 0, 0.3),
            15px 15px 30px rgba(0, 0, 0, 0.05),
            inset -10px -10px 15px rgba(255, 255, 255, 0.8);
            /*调用函数*/
            animation: action 3s linear infinite alternate;
            
        }
        #water::after{
            content: '';
            width: 20px;
            height: 20px;
            position: absolute;
            top: 240px;
            left: 48%;
            background-color: rgba(255, 255, 255, 0.8);
            border-radius: 43% 57% 53% 47% / 40% 42% 58% 60% ;
        }
        #water::before{
            content: '';
            width: 10px;
            height: 10px;
            position: absolute;
            top: 260px;
            left: 45%;
            background-color: rgba(255, 255, 255, 0.8);
            border-radius: 43% 57% 53% 47% / 40% 42% 58% 60% ;
        }
        /*实现动态的效果,就是改变其状态*/
        @keyframes action{
            25%{
                border-radius: 46% 54% 48% 52% / 41% 31% 69% 59% ;
            }
            50%{
                border-radius: 43% 57% 53% 47% / 40% 42% 58% 60%  ;
            }
            75%{
                border-radius: 43% 57% 56% 44% / 40% 47% 53% 60%  ;
            }
            100%{
                border-radius: 43% 57% 42% 58% / 40% 57% 43% 60%  ;
            }
        }
    </style>
</head>
<body>
    <div id="water"></div>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值