前端 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>
相关推荐
郑州光合科技余经理1 小时前
海外O2O系统源码剖析:多语言、多货币架构设计与二次开发实践
java·开发语言·前端·小程序·系统架构·uni-app·php
arvin_xiaoting6 小时前
OpenClaw学习总结_I_核心架构_8:SessionPruning详解
前端·chrome·学习·系统架构·ai agent·openclaw·sessionpruning
工程师老罗8 小时前
Image(图像)的用法
java·前端·javascript
swipe9 小时前
把 JavaScript 原型讲透:从 `[[Prototype]]`、`prototype` 到 `constructor` 的完整心智模型
前端·javascript·面试
问道飞鱼9 小时前
【前端知识】React 组件生命周期:从底层原理到实践场景
前端·react.js·前端框架·生命周期
CHU7290359 小时前
定制专属美丽时刻:美容预约商城小程序的贴心设计
前端·小程序
浩~~10 小时前
反射型XSS注入
前端·xss
AwesomeDevin10 小时前
AI时代,我们的任务不应沉溺于与 AI 聊天,🤔 从“对话式编程”迈向“数字软件工厂”
前端·后端·架构
harrain10 小时前
antvG2折线图和区间range标记同时绘制
前端·javascript·vue.js·antv·g2
德育处主任Pro10 小时前
从重复搭建到高效生产,RollCode的H5开发新范式
前端