10种动态进度条用css3实现

2023-05-16

用css做的10种动态进度条,喜欢可以直接去用话不多说先看效果图:

在这里插入图片描述

实现上图的,最主要的就是应用了css动画属性@keyframes和animation属性结合应用

下面看看语法:

@keyframes

@keyframes animationname {keyframes-selector {css-styles;}}
animationname必需的。定义animation的名称。
keyframes-selector必需的。动画持续时间的百分比。合法值:0-100%from (和0%相同)to (和100%相同)注意: 您可以用一个动画keyframes-selectors。
css-styles必需的。一个或多个合法的CSS样式属性。

简单的实现示例:

@keyframes mymove
{
0%   {top:0px;}
25%  {top:200px;}
50%  {top:100px;}
75%  {top:200px;}
100% {top:0px;}
}
{
0%   {top:0px;}
25%  {top:200px;}
50%  {top:100px;}
75%  {top:200px;}
100% {top:0px;}
}

animation

animation: name duration timing-function delay iteration-count direction fill-mode play-state;

在这里插入图片描述

下面看看实现的HTML代码:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>jiang</title>
    <link rel="stylesheet" href="sty.css">
</head>

<body>
    <div class="content">
        <div class="one">
            <div class="one1"></div>
            <div class="one2"></div>
            <div class="one3"></div>
            <div class="one4"></div>
            <div class="one5"></div>
            <div class="one6"></div>
            <div class="text">loading...</div>
        </div>
        <div class="two">
            <div class="two1"></div>
            <div class="two2"></div>
            <div class="two3"></div>
            <div class="two4"></div>
            <div class="two5"></div>
            <div class="two6"></div>
            <div class="text">loading...</div>
        </div>
        <div class="there">
            <div class="there1"></div>
            <div class="text3">loading...</div>
            <div class="there2"></div>
            <div class="there3"></div>
        </div>
        <div class="four">
            <div class="text3">loading...</div>
            <div class="four1"></div>
        </div>
        <div class="five">
            <div class="five1"></div>
            <div class="five2"></div>
            <div class="text4">loading...</div>
        </div>
        <div class="six">
            <div class="six1"></div>
            <div class="six2"></div>
            <div class="six3"> </div>
            <div class="text5">loading...</div>
        </div>
        <div class="seven">
            <div class="text6">loading...</div>
            <div class="sevendown">
                <div class="seven1"></div>
                <div class="seven2"></div>
                <div class="seven3"></div>
                <div class="seven4"></div>
                <div class="seven5"></div>
                <div class="seven6"></div>
            </div>
        </div>
        <div class="eigth">
            <div class="text6">loading...</div>
            <div class="eigthdown">
                <div class="eigth1"></div>
                <div class="eigth2"></div>
                <div class="eigth3"></div>
            </div>
        </div>
        <div class="nine">
            <div class="ninedown">
                <div class="nine1"></div>
                <div class="text7">loading...</div>
            </div>
        </div>
        <div class="ten">
            <div class="ten1"></div>
            <div class="ten2"></div>
            <div class="text8">loading...</div>
        </div>



    </div>
</body>

</html>

还有css代码:

.content{
    display: flex;
    flex-wrap: wrap;
}

.one,.two,.there,.four,.five,.six,.seven,.eigth,.nine,.ten{
    width: 150px;
    height: 150px;
    border: 1px solid black;
    margin:5px 10px;
    background-color: #25AD81;

}
.one1,.one2,.one3,.one4,.one5,.one6{
    width: 0px;
    height: 10px;

    margin-top: 3px;
    background-color: white;
   
}
.two{

    background-color:#32CEFF ;
}
.there{
    background-color: red;
}
.four{
     background-color: #FFAD73
}
.five{
    background-color: #60307D;
}
.six{
    background-color: #C3C3C3;
}
.seven{
    background-color: #3E3484;
}
.eigth{
    background-color: #C8EA70;
}
.nine{
    background-color: #1B2324;
}
.ten{
    background-color: #FEE673;
}


.there1,.there2,.there3{
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color:white ;

}
.there1{
    margin:3px auto ;
     animation: runyuan1 1s linear alternate infinite;
}
.there2{
    display: inline-block;
    animation: runyuan2 1s linear alternate infinite;

}
.there3{
    display: inline-block;
    animation: runyuan3 1s linear alternate infinite;
}
.four1{
     width: 20px;
     height: 20px;
     background-color: red;
     animation: scla 1s  linear  infinite;

}
.five1{
    margin:auto;
    margin-top:10px ;
    width: 0;
    border-top: 50px solid #DFD6E6 ;
    border-bottom:  50px  solid #DFD6E6;
    border-left:  50px  solid #DFD6E6 ;
    border-right:  50px  solid white ;
    border-radius: 50px;
    animation: rotateyuan 1s linear  infinite;
}
.five2{
    width: 0;
    position: relative;
    top: -95px;
    left: 30px;
    border-top: 45px solid #60307D;
    border-bottom:  45px  solid #60307D;
    border-left:  45px  solid #60307D ;
    border-right:  45px  solid #60307D ;
    border-radius: 45px;

}
.six1{
    margin:auto;
    margin-top:10px ;
    width: 0;
    border-top: 50px solid white ;
    border-bottom:  50px  solid white;
    border-left:  50px  solid white ;
    border-right:  50px  solid white ;
    border-radius: 50px;
    animation: rotateyuan 1s linear  infinite;
}
.six2{
    width: 0;
    position: relative;
    top: -98px;
    left: 27px;
    border-top: 48px solid #C3C3C3;
    border-bottom:  48px  solid #C3C3C3;
    border-left:  48px  solid #C3C3C3 ;
    border-right:  48px  solid #C3C3C3 ;
    border-radius: 48px;
    z-index: 0;

}
.six3{
    width:15px;
    height: 15px;
    border-radius:7.5px;
    position: relative;
    top:-105px;
    left: 74px;
    background-color: white;
    animation: rotateyuan1 1s linear  infinite;
}
.seven1,.seven2,.seven3,.seven4,.seven5,.seven6{
    width: 5px;
    height: 10px;
    display: inline-block;

    margin-right: 2px;
    background-color: #8F80CF;

}
.seven1{
    animation: runs1 1s  0.8s linear alternate infinite;
}
.seven2{
    animation: runs2 1s 0.3s linear alternate infinite;
}
.seven3{
     animation: runs3 1s  0.5s linear alternate infinite;
 }
.seven4{
      animation: runs4 1s 1s linear alternate infinite;
  }
.seven5{
       animation: runs5 1s  0.6s linear alternate infinite;
   }
.seven6{
        animation: runs6 1s 0s linear alternate infinite;
    }
.sevendown{

    display: flex;
    align-content: flex-start;
    justify-content: center;
}
.eigthdown{
    display: flex;
    justify-content: space-evenly;
}
.eigth1, .eigth2, .eigth3{
    width: 30px;
    height: 30px;
    background-color: #4F5548;
}
.eigth1{
    animation: runeigth1 0.8s  linear alternate infinite;
}
.eigth2{
      animation: runeigth1 0.8s 0.7s linear alternate infinite;
}
.eigth3{
        animation: runeigth1 0.8s 1.3s linear alternate infinite;
}
.nine1{
    height: 12px;
    width: 0px;
    margin-top:60px ;
    margin-left: 30px;
    background-color: #B2CD6F;
    animation: runnine1 1.5s  linear  infinite;
}
.ten1{
    margin:auto;
    margin-top:30px ;
    width: 0;
    border-top: 25px solid #FEE673 ;
    border-bottom:  25px  solid #FEE673;
    border-left:  25px  solid #AF9B54 ;
    border-right:  25px  solid #AF9B54 ;
    border-radius: 25px;
    animation: rotateyuan 1s linear  alternate infinite;
}
.ten2{
    width: 0;
    position: relative;
    top: -45px;
    left: 55px;
    border-top: 20px solid #FEE673;
    border-bottom:  20px  solid #FEE673;
    border-left:  20px  solid #FEE673 ;
    border-right:  20px  solid #FEE673 ;
    border-radius: 20px;

}



.two1, .two2, .two3, .two4, .two5, .two6{
    width: 0px;
    height: 10px;
    margin-top: 3px;
    background-color: #007BAE;
}
.one1, .two1{
    margin-top: 13px;
    animation: run1 1s linear alternate infinite;
}
.one2, .two2{
    animation: run2 1s 1.4s linear alternate infinite;
}
.one3, .two3{
    animation: run3 1s 0.7s linear alternate infinite;
}
.one4, .two4{
    animation: run4 1s 1.2s linear alternate infinite;
}
.one5, .two5{
    animation: run5 1s  0.5s linear alternate infinite;
}
.one6, .two6{
    animation: run6 1s 2s linear alternate infinite;
}
.text{
    text-align: center;
    color: white;
    margin-top: 10px;
}
.text3{
   position:relative;
   left:20%;
    color: white;
    top: 40px;

}
.text4{

    margin-top: -90px;
    text-align: center;
    color: white;
}
.text5{
     position: relative;
     top:-175px ;
    text-align: center;
    font-size: 20px;
    color: white;
}
.text6{
    text-align: center;
    color: black;
    margin-top: 30px;
}
.text7{
       text-align: center;
       color: #1B2324;
       font-size: 5px;
       margin-top: -13px;
}
.text8{
    text-align: center;
    color: #1B2324;
    font-size: 20px;
    margin-top: -13px;
}
@keyframes run1 {
    0%{
        width: 0;
    }
    100%{
        width: 80px;
    }
}
@keyframes run2 {
    0% {
        width: 0;
    }
    100% {
        width: 98px;
    }
}
@keyframes run3 {
    0% {
        width: 0;
    }
    100% {
        width: 110px;
    }
}
@keyframes run4 {
    0% {
        width: 0;
    }
    100% {
        width: 123px;
    }
}
@keyframes run5 {
    0% {
        width: 0;
    }
    100% {
        width: 60px;
    }
}
@keyframes run6 {
    0%{
        width: 0;
    }
    100%{
        width: 120px;
    }
}
@keyframes runyuan1{
   0%{
      transform: translate(0,0);
   }
   100%{
        transform: translate(0,40px);
   }
}
 @keyframes runyuan2{
    0%{
      transform: translate(10px,70px);
    }
    100%{
        transform: translate(55px,30px);
   }

}
@keyframes runyuan3{
    0%{
      transform: translate(120px,70px);
    }
    100%{
        transform: translate(65px,30px);
   }

} 
@keyframes scla{
    0%{
      transform:  translate(10px,50px) ;
      border-radius:10px;
      opacity: 0;
    }
    50%{
        opacity: 1;
    }
    100%{
        transform: translate(110px,50px);
        border-radius:10px;
        opacity: 0;
   }

}
@keyframes  rotateyuan{
    0%{
        transform: rotate(0deg);
    }
    100%{
        transform: rotate(360deg);
    }
}
@keyframes rotateyuan1 {
    0%{
        transform-origin: 0px -40px;
        transform: rotate(0deg);

       
    }
    100%{
        transform-origin: 0px -40px;
        transform: rotate(360deg);
    }
    
}
@keyframes runs1 {
    0%{
        height: 0;
    }
    100%{
        height: 80px;
    }
}
@keyframes runs2 {
    0% {
        height: 0;
    }
    100% {
        height: 83px;
    }
}
@keyframes runs3 {
    0% {
        height: 0;
    }
    100% {
        height: 79px;
    }
}
@keyframes runs4 {
    0% {
        height: 0;
    }
    100% {
        height: 86px;
    }
}
@keyframes runs5 {
    0% {
        height: 0;
    }
    100% {
        height: 75px;
    }
}
@keyframes runs6 {
    0%{
        height: 0;
    }
    100%{
        height: 90px;
    }
}
@keyframes runeigth1 {
    0%{
        opacity: 1;
        border-radius: 0;
    }
    100%{
        opacity: 0;
        border-radius: 15px;
    }
}
@keyframes runnine1 {
    0%{
       width: 10px;
    }
    100%{
      width: 100px;
    }
}

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

10种动态进度条用css3实现 的相关文章

  • 自旋锁的实现及优化

    自旋锁也是一种互斥锁 xff0c 和mutex锁相比 xff0c 它的特点是不会阻塞 xff0c 如果申请不到锁 xff0c 就会不断地循环检测锁变量的状态 xff0c 也就是自旋 自旋锁的实现算法大多使用TAS算法或者CAS算法 TAS算
  • C语言----详解字符串相关的库函数(建议收藏)

    文章目录 系列文章目录前言一 C语言相关字符串库函数一览表 二 strlen函数 三 strcpy函数四 strcat函数 五 strcmp函数 六 strncpy函数 七 strncat函数 八 strncmp函数 九 strstr函数
  • C/C++头文件与变量的声明和定义

    C C 43 43 头文件与变量的声明和定义 最近遇到了变量重复包含的问题 xff0c 才发现自己有好多知识已经模糊了 xff0c 真惭愧 首先说下头文件 xff0c 其实头文件对计算机而言没什么作用 xff0c 她只是在预编译时在 inc
  • C语言寄存器变量register

    用register声明的变量是寄存器变量 xff0c 是存放在CPU的寄存器里的 而我们平时声明的变量是存放在内存中的 虽说内存的速度已经很快了 xff0c 不过跟寄存器比起来还是差得远 寄存器变量和普通变量比起来速度上的差异很大 xff0
  • Curl(C++)使用教程

    1 Curl简介 2 Easy interface 3 Multi interface 1 Curl简介 libcurl作为是一个多协议的便于客户端使用的URL传输库 xff0c 基于C语言 xff0c 提供C语言的API接口 xff0c
  • GPS原始RMC数据解析之DDMM.MMMM

    环境 GPS BD 定位模块 1 模块输出数据如下 GNRMC 100756 000 V 4000 0005 N 11559 9745 E 6 21 223 00 050313 N 68 2 了解换算规则 ddmm mmmm规则和dd dd
  • VINS-Mono代码阅读笔记(三):vins_estimator中main函数分析

    在VINS Mono代码阅读笔记 xff08 一 xff09 xff1a 从Euroc数据集的运行开始 中我们已经初步知道了vins estimator中订阅和发布的topic xff0c 那么 xff0c 在研究vins estimato
  • VINS-Mono代码阅读笔记(十三):posegraph中四自由度位姿优化

    本篇笔记紧接着VINS Mono代码阅读笔记 xff08 十二 xff09 xff1a 将关键帧加入位姿图当中 xff0c 来学习pose graph当中的紧耦合优化部分 在重定位完成之后 xff0c 进行位姿图优化是为了将已经产生的所有位
  • VINS-Mono代码阅读笔记(十四):posegraph的存储和加载

    本篇笔记紧接着VINS Mono代码阅读笔记 xff08 十三 xff09 xff1a posegraph中四自由度位姿优化 xff0c 来分析位姿图的存储和加载 完整 xff08 也是理想的 xff09 的SLAM的使用应该是这样的 xf
  • Visual Studio中设置opencv环境

    图像处理的项目中 xff0c 每建立一个新的项目 xff0c 需要对环境重新设置 xff0c 本文记录一下自己在VS中设置环境的步骤 xff0c 也分享给相同的入门小白 本文侧重说明VS中调用opencv的环境设置步骤 xff0c open
  • STM32学习笔记(1)---工程创建

    文章目录 前言一 新建工程步骤1 点击Project gt New uVision Project2 选择芯片3 创建文件夹4 放入必要文件4 头文件关联 总结问题 前言 这是我第一次写博客 xff0c 而且对于STM32也只是初学 xff
  • 乌班图安装 Kalibr

    安装ROS Melodic 1 Installation 1 1 Configure your Ubuntu repositories http www 360doc com content 18 0417 15 54525756 7463
  • ubuntu16.04 安装 php7.0-curl

    sudo apt add repository ppa ondrej php 添加这个源 sudo apt get update sudo apt get install php7 0 curl 这时成功安装php7 0 curl
  • string、char *、char[] 相互转换转换

    点击打开原文链接 一 string 转 char 主要有三种方法可以将 str 转换为 char 类型 xff0c 分别是 xff1a data c str copy 1 data 方法 xff1a string str 61 34 hel
  • STM32F103标准库开发---Uart串口通信实验---函数发送和中断接收

    STM32F103标准库开发 目录 文章目录 一 Uart串口通信 函数发送 1 Uart串口发送 标准库 函数 单字节发送 2 Uart串口检测标志 标准库 函数 3 Uart串口函数发送具体程序 二 Uart串口通信 中断接收 1 Ua
  • Keil5----新建项目文件( .c文件 和 .h文件)

    前言 在使用 Keil5 编辑程序的时候 xff0c 一定需要新建几个文件 xff08 c文件 和 h文件 xff09 xff0c 在其中编写不同功能的程序 例如 xff1a 新建LED c和LED h文件 xff0c 实现LED灯闪烁的功
  • 编码和串口通信

    先了解字符串和bytes xff08 字节 xff09 字符串 xff1a python里的字符串就是文本 xff0c 用于与人类交互 xff0c 像这样 xff1a 阿拉伯数字 xff1a a 61 1234566454 英语 xff1a
  • vscode终端不显示,闪退问题解决(完整步骤)

    1 以管理员身份运行此程序 步骤 xff1a 1 1 找到该文件目录的文件图标 1 2 右键属性选择兼容性 1 3 选择更改所有用户的设置然后勾选以管理员身份运行此程序后重新打开vscode 2 在vscode修改配置文件 2 1 打开vs
  • Vue项目启动报错 error:cannot find module xxx

    原因 xff1a 无法找到项目依赖的某个模块 解决办法 xff1a 1 删掉存放模块的文件夹node module xff1b 2 执行清除缓存命令 npm cache clean xff1b 如果报错 xff0c 使用强制清除npm ca
  • OkHttp-(一)HttpUrl了解

    1 xff0c git地址 xff1a https github com square okhttp 2 xff0c 官网地址 xff1a https square github io okhttp Http作为现代应用程序的常用联网方式

随机推荐

  • 学习网络编程第一步,安装NetAssist网络调试助手

    x1f4d6 摘要 今天分享下 遇到 Request header is too large xff0c 如何解决 xff0c 欢迎关注 xff01 x1f91e 简单介绍 NetAssist 是一款免安装的网络调试助手工具 今天给大家带来
  • 初学STM32之串口通信

    文章目录 一 背景知识1 处理器与外部通信的两种方式2 串行通信的三种传输方式3 串行通信的通信方式 二 串口通信基础1 STM32的串口通信接口2 UART异步通信引脚连接方法3 UART异步通信方式特点4 串口异步通信需要定义的参数 三
  • 前端架构图解

  • Ubuntu 18.04快捷安装ROS Melodic及rosdep update time out的问题解决

    1 ROS快捷安装 以下安装指令汇总针对Ubuntu18 04的ROS Melodic版本 xff1a 强烈建议复制以下指令到新建的xxx sh文件中 xff0c 保存后给xxx sh权限 xff0c 然后执行脚本一路输入y等候安装完成 e
  • NVIDIA Jetson AGX Xavier学习笔记3——环境配置(pytorch、torchvision、cv2)

    最近研究中需要使用NVIDIA Jetson AGX Xavier人工智能开发组件 由于也是第一次接触相关硬件设备 xff0c 遇到了很多困难 在这里记录整个Jetson AGX Xavier组件的学习过程 其中很多内容网上有比较详细的教程
  • Linux网络编程——tcp实例

    题目 1 通过TCP协议实现多个client端可以并发连接到server xff0c client可获得server指定目录下的文件列表 span class hljs comment client c Created on 2016年11
  • A星寻路算法的学习总结(详解)

    目录 1 理论基础 1 1A星寻路是用来解决什么问题的 1 2A星寻路的基本原理 2 代码实现 2 1每个格子的信息 2 2A星寻路管理器 2 3测试代码 3 实例演示 1 理论基础 1 1A星寻路是用来解决什么问题的 A星寻路是用来计算玩
  • C语言单片机栈、堆、堆栈的区别(仅供参考)

    计算机C语言中各个变量的存放区域 xff1a 代码区 xff08 CODE xff09 xff1a 存放函数代码 xff1b 静态数据区 xff08 DATA xff09 xff1a 存放全局变量 静态变量 xff1b 堆区 xff08 H
  • 用c语言写链表

    链表是数据结构的一种 xff0c 是其他三个数据结构栈 xff0c 树 xff0c 图的基础 xff0c 只有将链表这一数据结构弄懂 xff0c 才能理解其他三种数据结构 举一个例子 xff0c 老师让你设计一个联系人系统 xff0c 其中
  • Fiddler抓包工具详解

    Fiddler的详细介绍 一 Fiddler与其他抓包工具的区别 1 Firebug虽然可以抓包 xff0c 但是对于分析http请求的详细信息 xff0c 不够强大 模拟http请求的功能也不够 xff0c 且firebug常常是需要 无
  • python 解析Json对象之jsonpath_rw用法

    jsonpath rw xff1a 一个可以像写xpath一样写json的Python第三方库 首先安装 xff1a pip install jsonpath rw 实例 xff1a from jsonpath rw import json
  • selenium之xpath使用

    XPath即XML路径语言 xff0c 支持从xml或html中查找元素节点 xff0c 使用XPath完全可以替代其他定位放式 xff0c 如 xff1a find element by xpath 39 64 id 61 34 34 3
  • Python-面向对象之多态

    当子类和父类都存在相同的run 方法时 xff0c 我们说 xff0c 子类的run 覆盖了父类的run xff0c 在代码运行的时候 xff0c 总是会调用子类的run 这样 xff0c 我们就获得了继承的另一个好处 xff1a 多态 c
  • 使用Ubuntu帐户创建SFTP

    提供sftp服务的有vsftpd和internal sftp xff0c 这里用的是系统自带的internal sftp xff0c 操作步骤如下 xff1a 1 创建用户 testenv xff0c 并禁止ssh登录 xff0c 不创建家
  • flask数据分页paginate的使用(flask学习)

    Flask的数据分页示例 1 xff0c 首先写数据获取的视图函数 xff0c 就像这样 xff1a 64 app route 39 39 64 login required def index page 61 request args g
  • Python __dict__属性详解

    我们都知道Python一切皆对象 xff0c 那么Python究竟是怎么管理对象的呢 xff1f 1 无处不在的 dict 首先看一下类的 dict 属性和类对象的 dict 属性 coding utf 8 class A object 3
  • Flask-SQLAlchemy 中的 relationship & backref

    今天重看 Flask 时 xff0c 发现对backref仍然没有理解透彻 查阅文档后发现 xff0c 以前试图孤立地理解backref是问题之源 xff0c backref是与relationship配合使用的 一对多关系 db rela
  • Django HttpResponse与JsonResponse

    我们编写一些接口函数的时候 xff0c 经常需要给调用者返回json格式的数据 xff0c 那么如何返回可直接解析的json格式的数据呢 xff1f 首先先来第一种方式 xff1a from django shortcuts import
  • Ubuntu安装mysql

    首先执行下面三条命令 xff1a sudo apt get install mysql server sudo apt install mysql client sudo apt install libmysqlclient dev 安装成
  • 10种动态进度条用css3实现

    用css做的10种动态进度条 xff0c 喜欢可以直接去用话不多说先看效果图 xff1a 实现上图的 xff0c 最主要的就是应用了css动画属性 64 keyframes和animation属性结合应用 下面看看语法 xff1a 64 k