前端 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>
相关推荐
yuki_uix5 分钟前
CSS 里的"结界":BFC 与层叠上下文的渲染隔离逻辑
前端·面试
说实话起个名字真难啊11 分钟前
2026数字中国创新大赛数字安全赛道writeup之web题目一
java·前端·安全
jerrywus27 分钟前
Claude Code 真正的用法:skill / agent / hooks / worktree 一篇全搞定
前端·agent·claude
陈健平31 分钟前
AI漫剧工具复刻实战:用 React Flow 搭一个前端的无限画布,复刻 TapNow / LiblibTV 的核心交互
前端·人工智能·react.js
huangql52044 分钟前
CSS布局(五):Flex——让布局更灵活
前端·css
ZC跨境爬虫1 小时前
3D 地球卫星轨道可视化平台开发 Day6(SEC数据接口扩展实现)
前端·microsoft·3d·html·json·交互
qq_12084093711 小时前
Three.js 工程向:EffectComposer 后处理链路与色彩管理
开发语言·前端·javascript
|晴 天|1 小时前
评论系统与情感分析
前端·ai·typescript
沉默中爆发的IT男1 小时前
BGP基础配置实验总结
linux·服务器·前端