前端 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>
相关推荐
李惟7 分钟前
开源本地通信库,纯客户端 RPC,像聊天一样通信
前端
YAwu1110 分钟前
深入解析 React 炫彩鼠标跟随标题组件:从坐标定位到动画性能
前端·react.js
GuWenyue15 分钟前
排序效率低?5分钟吃透快速排序,性能飙升至O(nlogn)
前端·javascript·面试
OpenTiny社区18 分钟前
🎨 看完 GenUI SDK 源码我悟了!
前端·vue.js·github
叁两21 分钟前
前端转型AI Agent该如何学习?(前置篇)
前端·人工智能·node.js
何时梦醒25 分钟前
深入理解递归与快速排序 —— 从基础入门到手写实现
前端·javascript
爱勇宝27 分钟前
淡泊名利之前,先承认我们都很焦虑
前端·后端·程序员
bonechips36 分钟前
LLM 的无状态:从 HTTP 协议到对话上下文工程
前端·javascript
杨利杰YJlio37 分钟前
Codex桌面客户端上手:项目、插件与自动化实战
前端·后端
胡志辉37 分钟前
从 prototype 到 V8,看懂 JavaScript 原型链
前端·javascript