前端 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>
相关推荐
非优秀程序员2 小时前
第10章 千团出世|《互联网产品恩仇录》
前端
非优秀程序员2 小时前
第11章 小高在对面|《互联网产品恩仇录》
前端
非优秀程序员2 小时前
第14章 只剩美团|《互联网产品恩仇录》
前端
非优秀程序员2 小时前
第09章 老乡何必为难老乡|《互联网产品恩仇录》
前端
非优秀程序员3 小时前
第03章 三大门户,烽烟起于瀛海威|《互联网产品恩仇录》
前端
程序员大阳6 小时前
HTML+CSS+JS对话式实战(5)-活动管理页之查看报名名单的实现
javascript·css·html·查看报名名单
曦樂~7 小时前
【Web Development】02 CSS
前端·css
风骏时光牛马7 小时前
后端服务接口开发与数据逻辑处理
前端
东鹏特饮7 小时前
经典打砖块(Breakout)游戏
前端·css·css3
IT_陈寒7 小时前
Vite的HMR把我整不会了:一个生产环境的热更新坑
前端·人工智能·后端