前端 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>
相关推荐
SEO_juper17 分钟前
Node.js Product 结构化数据生成器:给产品页一键生成 JSON-LD
开发语言·前端·javascript·人工智能·node.js·json·1024程序员节
Mh8 小时前
基于踩过的坑,浅聊一下vh、svh、lvh、dvh
前端·css·设计模式
刘小灰8 小时前
返璞归真,我开始更新博客了
前端·后端
圆心角9 小时前
Agent 上下文原理:为什么“记住”比“推理”更难
前端·面试·agent
杜子不疼.12 小时前
从 Apache HTTP Server 到 CivetWeb:在鸿蒙 PC 的 3.1 MiB HAP 里嵌入 Web 服务器
前端·apache·harmonyos
kyriewen13 小时前
AI 生成率进了 KPI,最慌的是写代码最快的人
前端·javascript·程序员
SoaringHeart13 小时前
Flutter组件封装:聊天气包图片组件NChatBubble
前端·flutter
狗头大军之江苏分军14 小时前
三个月的电商心得
前端·后端
勤恳的马龙17 小时前
给 1088 个工具页批量注入 FAQ 和结构化数据:一次幂等的 SEO 工程
前端·javascript
htzyl20617 小时前
javaScript中,让你全面了解动态import()的四个真实用途,及与静态import的区别
前端·javascript