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%;
        }
    }
相关推荐
单片机学习之路几秒前
【Python】输入print函数
开发语言·前端·python
zzginfo8 分钟前
javascript 类定义常见注意事项
开发语言·前端·javascript
程序员小寒14 分钟前
JavaScript设计模式(九):工厂模式实现与应用
开发语言·前端·javascript·设计模式
weixin1997010801629 分钟前
《米思米商品详情页前端性能优化实战》
前端·性能优化·php
清汤饺子34 分钟前
Cursor + Claude Code 组合使用心得:我为什么不只用一个 AI 编程工具
前端·javascript·后端
GISer_Jing1 小时前
2026年前端AI开发终极指南
前端·人工智能
攀登的牵牛花1 小时前
2026年最危险的,不是不会写代码,而是不会设计 Agent 工作流
前端·agent
LanceJiang1 小时前
设计模式在前端的简易实现与作用
前端·设计模式
代码煮茶1 小时前
Vue3 虚拟列表实战 | 解决长列表性能问题(十万条数据流畅渲染,附原理)
前端·javascript·vue.js
雨季mo浅忆1 小时前
前端如何实现长连接之使用WebSocket长连接
前端·websocket