码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • CSS3实现动画加载效果


    DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>加载效果title>
        <link rel="stylesheet" href="./style.css" />
      head>
      <body>
      	
        <div class="bouncing-loader">
          <div class="bouncing-loader-item">div>
          <div class="bouncing-loader-item">div>
          <div class="bouncing-loader-item">div>
        div>
    
    	
        <div class="spin-loading">
          <div class="loading">div>
        div>
    
    	
        <span class="dot">正在加载中<span class="dotted">span>span>
      body>
    html>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    /* style.css */
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    
    html,
    body {
      display: flex;
    }
    /* 弹跳加载效果 */
    .bouncing-loader,
    .spin-loading,
    .dot {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 150px;
      border: 1px solid #efefef;
      margin: 3rem;
    }
    .bouncing-loader-item {
      width: 16px;
      height: 16px;
      margin: 3rem 0.2rem;
      background-color: #0b16f1;
      border-radius: 50%;
      animation: bouncingLoader 0.6s infinite alternate;
    }
    .bouncing-loader-item:nth-child(2) {
      animation-delay: 0.2s;
    }
    .bouncing-loader-item:nth-child(3) {
      animation-delay: 0.4s;
    }
    @keyframes bouncingLoader {
      to {
        opacity: 0.1;
        transform: translate3d(0, -10px, 0);
      }
    }
    
    /* 旋转动画效果 */
    .spin-loading .loading {
      width: 100%;
      aspect-ratio: 1;
      border-radius: 100%;
      /* 锥形渐变 */
      background-image: conic-gradient(#0b16f1, 30%, #fff);
      /* 使用蒙版将中间变为透明 */
      -webkit-mask-image: radial-gradient(closest-side, transparent 80%, black 80%);
      /* 开启动画 */
      animation: spin 1s linear infinite reverse;
    }
    
    @keyframes spin {
      from {
        transform: rotate(0deg);
      }
      to {
        transform: rotate(360deg);
      }
    }
    /* ...动画效果 */
    .dotted {
      display: inline-block;
      width: 20px;
    }
    .dotted::after {
      content: '';
      animation: dotted 2s infinite;
    }
    @keyframes dotted {
      0% {
        content: '...';
      }
      25% {
        content: '';
      }
      50% {
        content: '.';
      }
      75% {
        content: '..';
      }
      100% {
        content: '...';
      }
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90

    在这里插入图片描述

  • 相关阅读:
    【Windows Server 2019】DHCP服务器配置与管理——验证DHCP服务 & 备份与恢复DHCP数据(下)
    半导体工厂将应用哪些制造创新技术?
    NEFU数字图像处理(2)图像增强
    Spring反序列化JNDI分析
    HTML静态网页作业——澳门英文旅游网站设计与实现HTML+CSS+JavaScript
    GitHub上整理的一些实用的工具
    OCR技术:解决图片转excel表格的方案与技巧
    H5+Css3文本溢出添加省略号(包括插件)
    《算法导论》18.2 B树上的基本操作(搜索、创建、插入)(包含C++代码)
    机器学习——白板推导系列三——线性回归
  • 原文地址:https://blog.csdn.net/m0_46219714/article/details/133612130
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号