CSS仿真水滴

xml 复制代码
    <div class="water"></div>
css 复制代码
    body {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        background-color: deepskyblue;
    }
    .water {
        position: relative;
        width: 200px;
        height: 200px;
        box-shadow: 10px 15px 20px rgba(0, 0, 0, 0.3),
            15px 20px 30px rgba(0, 0, 0, 0.1), inset 15px 20px 25px rgba(0, 0, 0, 0.5), inset -15px -20px 25px rgba(225, 225, 225, 0.5);
        /*设计水滴圆角 https://9elements.github.io/fancy-border-radius/ */
        border-radius: 31% 69% 57% 43%/46% 26% 74% 54%;
        animation: action 10s linear infinite;
        &::after {
            content: "";
            position: absolute;
            height: 10px;
            width: 10px;
            top: 60px;
            left: 60px;
            background-color: rgba(225, 225, 225, 0.8);
            border-radius: 63% 37% 70% 30% / 52% 60% 40% 48%;
            box-shadow: 0px 0px 6px 6px rgba(225, 225, 225, 0.8);
        }
    }
    @keyframes action {
        25% {
            border-radius: 46% 54% 65% 35% / 32% 44% 56% 68%;
        }
        50% {
            border-radius: 55% 45% 49% 51% / 50% 28% 72% 50%;
        }
        75% {
            border-radius: 42% 58% 39% 61% / 35% 45% 55% 65%;
        }
        100% {
            border-radius: 52% 48% 57% 43% / 56% 48% 52% 44%;
        }
    }
相关推荐
钛态5 小时前
前端安全防线:CSRF 攻击链路与双重 Token 校验的工程实现
前端·vue·react·web
张拭心6 小时前
技术管理笔记:让我“燃尽”的一天
前端
不好听6137 小时前
BFF 架构实战:从前端直调 API 到加入中间层
前端·架构
不好听6137 小时前
前端跨域完全指南:从为什么报错到三种解决方案
前端
三8447 小时前
路由策略/控制 配置双点双向路由重发布
服务器·前端·javascript
Qimooidea7 小时前
祁木 CAD Translator 工程图纸出海实战指南
服务器·前端·安全
小林ixn7 小时前
从BFF到SSE:我在Vue项目里藏了个“AI翻译官”
前端·vue.js·vite
元气少女小圆丶8 小时前
unity发布web嵌入到前端页面的接受参数
前端·unity·webgl
工业HMI实战笔记9 小时前
【拯救HMI】:低碳制造:自动化技术如何助力企业节能降耗
运维·前端·自动化·交互·制造
不简说10 小时前
JS 代码技巧 vol.4 — 10 个异步并发控制,Promise.all 这帮兄弟的踩坑实录
前端·javascript·面试