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,表示阴影的尺寸为负值,实际上会向内缩小阴影的大小。

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

相关推荐
理人综艺好会11 分钟前
Web学习之用户认证
前端·学习
We་ct28 分钟前
LeetCode 36. 有效的数独:Set实现哈希表最优解
前端·算法·leetcode·typescript·散列表
weixin_3954489139 分钟前
main.c_cursor_0129
前端·网络·算法
2401_859049081 小时前
git submodule update --init --recursive无法拉取解决
前端·chrome·git
这是个栗子2 小时前
【Vue代码分析】前端动态路由传参与可选参数标记:实现“添加/查看”模式的灵活路由配置
前端·javascript·vue.js
刘一说2 小时前
Vue 动态路由参数丢失问题详解:为什么 `:id` 拿不到值?
前端·javascript·vue.js
熊猫钓鱼>_>2 小时前
动态网站发布部署核心问题详解
前端·nginx·容器化·网页开发·云服务器·静态部署
方也_arkling2 小时前
elementPlus按需导入配置
前端·javascript·vue.js
我的xiaodoujiao2 小时前
使用 Python 语言 从 0 到 1 搭建完整 Web UI自动化测试学习系列 44--将自动化测试结果自动推送至钉钉工作群聊
前端·python·测试工具·ui·pytest
沛沛老爹3 小时前
Web开发者转型AI:多模态Agent视频分析技能开发实战
前端·人工智能·音视频