纯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>
相关推荐
谢尔登20 分钟前
【React】React 18 并发特性
前端·react.js·前端框架
Joker`s smile23 分钟前
使用React+ant Table 实现 表格无限循环滚动播放
前端·javascript·react.js
国家不保护废物28 分钟前
🌟 React 魔法学院入学指南:从零构建你的第一个魔法阵(项目)!
前端·react.js·架构
import_random30 分钟前
[机器学习]svm支持向量机(优势在哪里)
前端
国家不保护废物31 分钟前
从刀耕火种到现代框架:DOM编程 vs Vue/React 进化史
前端·vue.js·react.js
陈随易31 分钟前
Univer v0.8.0 发布,开源免费版 Google Sheets
前端·后端·程序员
不怎么爱学习的dan37 分钟前
实现 ECharts 多国地区可视化方案
前端
嘉小华37 分钟前
Android Lifecycle 状态同步与分发机制深度解析
前端
李三岁_foucsli43 分钟前
chrome架构-多进程和进程中的线程
前端·google
阿琳a_1 小时前
前端对WebSocket进行封装,并建立心跳监测
前端·javascript·vue.js·websocket