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%;
        }
    }
相关推荐
行走的陀螺仪4 分钟前
Sass 详细指南
前端·css·rust·sass
爱吃土豆的马铃薯ㅤㅤㅤㅤㅤㅤㅤㅤㅤ9 分钟前
React 怎么区分导入的是组件还是函数,或者是对象
前端·react.js·前端框架
LYFlied23 分钟前
【每日算法】LeetCode 136. 只出现一次的数字
前端·算法·leetcode·面试·职场和发展
子春一224 分钟前
Flutter 2025 国际化与本地化工程体系:从多语言支持到文化适配,打造真正全球化的应用
前端·flutter
QT 小鲜肉38 分钟前
【Linux命令大全】001.文件管理之file命令(实操篇)
linux·运维·前端·网络·chrome·笔记
羽沢311 小时前
ECharts 学习
前端·学习·echarts
LYFlied1 小时前
WebAssembly (Wasm) 跨端方案深度解析
前端·职场和发展·wasm·跨端
七月丶1 小时前
实战复盘:我为什么把 TypeScript 写的 CLI 工具用 Rust 重写了一遍?
前端·后端·rust
over6972 小时前
《闭包、RAG与AI面试官:一个前端程序员的奇幻LangChain之旅》
前端·面试·langchain