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%;
        }
    }
相关推荐
GISer_Jing16 分钟前
AI驱动营销:业务技术栈实战(From AIGC,待总结)
前端·人工智能·aigc·reactjs
GIS之路2 小时前
GDAL 实现影像裁剪
前端·python·arcgis·信息可视化
AGMTI2 小时前
webSock动态注册消息回调函数功能实现
开发语言·前端·javascript
不会Android的潘潘2 小时前
受限系统环境下的 WebView 能力演进:车载平台 Web 渲染异常的根因分析与优化实践
android·java·前端·aosp
建军啊2 小时前
java web常见lou洞
android·java·前端
阳无2 小时前
宝塔部署的前后端项目从IP访问改成自定义域名访问
java·前端·部署
Galloping-Vijay2 小时前
解决 WSL2 + Windows Hosts + 开启 VPN 后无法访问本地 Web 服务的问题
前端·windows
wuhen_n3 小时前
TypeScript的对象类型:interface vs type
前端·javascript·typescript
见路不走!3 小时前
后端返回Blob文件流,前端实现导出
前端
lindd9119113 小时前
4G模块应用,内网穿透,前端网页的制作第七讲(智能头盔数据上传至网页端)
前端·后端·零基础·rt-thread·实时操作系统·项目复刻