前端 CSS 经典:水波进度样式

前言:简单实现水波进度样式,简单好看。

效果图:

代码实现:

html 复制代码
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta
      name="viewport"
      content="initial-scale=1.0, user-scalable=no, width=device-width"
    />
    <title>document</title>
    <style>
      body {
        background: #000;
      }
      .indicator {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 3em;
        margin: 200px auto;
        width: 100px;
        height: 100px;
        border-radius: 50%;
        border: 2px solid #fff;
        position: relative;
        overflow: hidden;
        color: #fff;
      }
      .indicator span {
        position: absolute;
        z-index: 999;
      }
      .indicator::after {
        content: "";
        width: 200px;
        height: 200px;
        border-radius: 60px;
        position: absolute;
        left: -50%;
        top: 50px;
        background: blue;
        animation: rotate 5s linear 0s infinite;
      }
      @keyframes rotate {
        from {
          transform: rotateZ(0deg);
        }
        to {
          transform: rotateZ(359deg);
        }
      }
    </style>
  </head>
  <body>
    <div>
      <div class="indicator">
        <span>50</span>
      </div>
    </div>
    <script></script>
  </body>
</html>
相关推荐
Tkto1 分钟前
我用 WebGL 从「画个点」一路画到「贪吃蛇」
前端
xiaobaoyu8 分钟前
前端代码常用规范
前端
xiaobaoyu17 分钟前
img,word,excel,pdf文件在线预览
前端
lichenyang45318 分钟前
从 H5 到 HarmonyOS:我做了一个 npm + OHPM 双端发布的 ArkWeb JSBridge 框架
前端
用户842981424181018 分钟前
AI时代,JS混淆加密还有用吗?
前端·javascript
xiaobaoyu21 分钟前
如何理解前端项目中的绝对路径和相对路径
前端
xiaobaoyu25 分钟前
vue3+vite+vant4项目实战总结
前端
咖啡星人k39 分钟前
【无标题】
前端·ai·github
颜进强1 小时前
LangChain 从入门到实践:用最小案例理解 RAG 的 5 个核心抽象
前端·后端·ai编程
颜进强1 小时前
MCP 从入门到实践:用 TypeScript 实现第一个 MCP Server
前端·后端·ai编程