纯css html 真实水滴效果

惯例,不多说直接上图

遵循开源精神,源码就直接放下面了,

html 复制代码
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8" />
  <title>whater</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      background: #edeeed;
    }

    body>div {
      position: relative;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    body>div>div {
      position: absolute;
      width: 150px;
      height: 150px;
      background: transparent;
      border-radius: 57% 43% 37% 63% / 45% 52% 48% 55%;
      box-shadow: inset 10px 10px 10px rgba(0, 0, 0, 0.05),
        15px 25px 10px rgba(0, 0, 0, 0.1), 15px 20px 20px rgba(0, 0, 0, 0.05),
        inset -10px -10px 15px rgba(255, 255, 255, 0.9);
    }

    body>div>div::before {
      content: "";
      position: absolute;
      top: 25px;
      left: 35px;
      background: #fff;
      width: 20px;
      height: 20px;
      border-radius: 42% 58% 37% 63% / 40% 43% 57% 60%;
    }

    body>div>div::after {
      content: "";
      position: absolute;
      top: 25px;
      left: 65px;
      background: #fff;
      width: 10px;
      height: 10px;
      border-radius: 57% 43% 37% 63% / 48% 37% 63% 52%;
    }

    body>div>div:nth-child(2) {
      transform: scale(0.5) translate(-200px, 180px);
      border-radius: 64% 36% 42% 58% / 42% 37% 63% 58%;
    }

    body>div>div:nth-child(3) {
      transform: scale(0.5) translate(280px, 10px);
      border-radius: 49% 51% 42% 58% / 56% 47% 53% 44%;
    }

    body>div>div:nth-child(4) {
      transform: scale(0.5) translate(120px, -350px);
      border-radius: 39% 61% 63% 37% / 77% 47% 53% 23%;
    }

    body>div>div:nth-child(5) {
      transform: scale(0.3) translate(20px, -350px);
      border-radius: 37% 63% 64% 36% / 53% 65% 35% 47%;
    }

    body>div>div:nth-child(6) {
      transform: scale(0.7) translate(-150px, -200px);
      border-radius: 37% 63% 64% 36% / 53% 65% 35% 47%;
    }

    body>div>div:nth-child(7) {
      transform: scale(0.4) translate(-400px, -100px);
      border-radius: 37% 63% 64% 36% / 53% 65% 35% 47%;
    }
  </style>
</head>

<body>
  <div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
  </div>
</body>

</html>
相关推荐
风兮w1 分钟前
插件架构实践
前端·javascript·架构
天天扭码12 分钟前
一分钟解决 | 高频面试算法题——最长连续序列(哈希表)
前端·javascript·算法
WEI_Gaot28 分钟前
3 使用工厂模式 和 构造函数 优化创建对象
前端·javascript
程序员小续32 分钟前
useContext 用法全解析:3 个实战案例带你上手!
前端·react.js·面试
1024小神33 分钟前
我使用github api同步文件到仓库后,立即触发工作流,这个时候工作流执行actions/checkout@v4,此时工作流中拿到的代码是最新的吗
前端·javascript
Factor安全1 小时前
Chrome漏洞可窃取数据并获得未经授权的访问权限
前端·chrome·web安全·网络安全·安全威胁分析·安全性测试
齐尹秦1 小时前
CSS 文本样式学习笔记
前端
程序员皮蛋鸽鸽1 小时前
从零配置 Linux 与 Windows 互通的开发环境
前端·后端
kovli1 小时前
红宝书第十二讲:详解JavaScript中的工厂模式与原型模式等各种设计模式
前端·javascript
凯哥19701 小时前
Sciter.js 指南-核心概念:GUI应用程序项目结构、视图切换与组件化
前端