CSS加载动画1

3个圈圈加载的动画

CSS结构

javascript 复制代码
  #app-loading {
        position: relative;
        top: 45vh;
        margin: 0 auto;
        color: #409eff;
        font-size: 12px;
      }

      #app-loading,
      #app-loading::before,
      #app-loading::after {
        width: 2em;
        height: 2em;
        border-radius: 50%;
        animation: 2s ease-in-out infinite app-loading-animation;
      }

      #app-loading::before,
      #app-loading::after {
        content: '';
        position: absolute;
      }

      #app-loading::before {
        left: -4em;
        animation-delay: -0.2s;
      }

      #app-loading::after {
        left: 4em;
        animation-delay: 0.2s;
      }

      @keyframes app-loading-animation {
        0%,
        80%,
        100% {
          box-shadow: 0 2em 0 -2em;
        }
        40% {
          box-shadow: 0 2em 0 0;
        }
      }

html结构

javascript 复制代码
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" href="/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="/public/app-loading.css" />
    <title>Vite App</title>
  </head>
  <body>
    <div id="app">
      <div id="app-loading">
        <script>
          debugger
        </script>
      </div>
    </div>
    <script type="module" src="/src/main.ts"></script>
  </body>
</html>

box-shadow

  • 0:水平偏移量为 0,即阴影不水平偏移。
  • 2em:垂直偏移量为 2em,即阴影向下偏移 2em。
  • 0:模糊半径为 0,即阴影不具备模糊效果。
  • -2em:阴影扩展为 -2em,表示阴影的尺寸为负值,实际上会向内缩小阴影的大小。

用控制内阴影的方法使得圆形消失出现

相关推荐
计算机魔术师30 分钟前
NVIDIA 以 129.3 亿美元收购 Hugging Face
前端
平头哥技术团队31 分钟前
Day 01 | 用 HTML 写第一个网页:双击就能在浏览器打开
前端
计算机魔术师1 小时前
两年翻45倍!英伟达靠买买买建成千亿投资帝国
前端
paopaokaka_luck1 小时前
基于springboot3+vue3的精准扶贫管理系统(AI 问答、ECharts 图形化分析)
前端·人工智能·echarts
l1m0_2 小时前
智能电动自行车管理后台实战:AI生成页面与React组件化技巧
前端·react.js·ui·ai·设计
Patrick_Wilson2 小时前
为什么gitlab的MR会默认有一个merge commit
前端·git·gitlab
en.en..2 小时前
Linux mmap 内存映射深度解析:基于帧缓冲 /dev/fb0
java·服务器·前端
Z兽兽2 小时前
行内块元素在垂直方向上对齐问题
css·html·css3
后台模板学习3 小时前
从0到1用Vite构建电商订单系统前端性能优化方案
前端
Wang's Blog3 小时前
Vibe Coding一人即团队系列58: HTML演示文稿自动生成
前端·人工智能·html