永发信息网

如何使用css3实现不是百分比的动态进度条

答案:1  悬赏:70  手机版
解决时间 2021-04-09 12:56
如何使用css3实现不是百分比的动态进度条
最佳答案
<div class="wrapper">
  <div class="load-bar">
    <div class="load-bar-inner" data-loading="0"> <span id="counter"></span> </div>
  </div>
  <h1>Loading</h1>
  <p>Please wait...</p>
</div>

* {
box-sizing: border-box;
}
html {
height: 100%;
}
body {
background: #efeeea;
background: linear-gradient(#f9f9f9, #cecbc4);
background: -moz-linear-gradient(#f9f9f9, #cecbc4);
background: -webkit-linear-gradient(#f9f9f9, #cecbc4);
background: -o-linear-gradient(#f9f9f9, #cecbc4);
color: #757575;
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
text-align: center;
}
h1, p {
padding:0; margin:0;
}
.wrapper {
width: 350px;
margin: 200px auto;
}
.wrapper p a {color:#757575; text-decoration:none;}
.wrapper .load-bar {
width: 100%;
height: 25px;
border-radius: 30px;
background: #dcdbd7;
position: relative;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8),  inset 0 2px 3px rgba(0, 0, 0, 0.2);
}
.wrapper .load-bar:hover .load-bar-inner, .wrapper .load-bar:hover #counter {
animation-play-state: paused;
-moz-animation-play-state: paused;
-o-animation-play-state: paused;
-webkit-animation-play-state: paused;
}
.wrapper .load-bar-inner {
height: 99%;
width: 0%;
border-radius: inherit;
position: relative;
background: #c2d7ac;
background: linear-gradient(#e0f6c8, #98ad84);
background: -moz-linear-gradient(#e0f6c8, #98ad84);
background: -webkit-linear-gradient(#e0f6c8, #98ad84);
background: -o-linear-gradient(#e0f6c8, #98ad84);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1),  0 1px 5px rgba(0, 0, 0, 0.3),  0 4px 5px rgba(0, 0, 0, 0.3);
animation: loader 10s linear infinite;
-moz-animation: loader 10s linear infinite;
-webkit-animation: loader 10s linear infinite;
-o-animation: loader 10s linear infinite;
}
.wrapper #counter {
position: absolute;
background: #eeeff3;
background: linear-gradient(#eeeff3, #cbcbd3);
background: -moz-linear-gradient(#eeeff3, #cbcbd3);
background: -webkit-linear-gradient(#eeeff3, #cbcbd3);
background: -o-linear-gradient(#eeeff3, #cbcbd3);
padding: 5px 10px;
border-radius: 0.4em;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1),  0 2px 4px 1px rgba(0, 0, 0, 0.2),  0 1px 3px 1px rgba(0, 0, 0, 0.1);
left: -25px;
top: -50px;
font-size: 12px;
font-weight: bold;
width: 44px;
animation: counter 10s linear infinite;
-moz-animation: counter 10s linear infinite;
-webkit-animation: counter 10s linear infinite;
-o-animation: counter 10s linear infinite;
}
.wrapper #counter:after {
content: "";
position: absolute;
width: 8px;
height: 8px;
background: #cbcbd3;
transform: rotate(45deg);
-moz-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-o-transform: rotate(45deg);
left: 50%;
margin-left: -4px;
bottom: -4px;
box-shadow:  3px 3px 4px rgba(0, 0, 0, 0.2),  1px 1px 1px 1px rgba(0, 0, 0, 0.1);
border-radius: 0 0 3px 0;
}
.wrapper h1 {
font-size: 28px;
padding: 20px 0 8px 0;
}
.wrapper p {
font-size: 13px;
}
 @keyframes loader {
 from {
width: 0%;
}
to {
width: 100%;
}
}
 @-moz-keyframes loader {
 from {
width: 0%;
}
to {
width: 100%;
}
}
 @-webkit-keyframes loader {
 from {
width: 0%;
}
to {
width: 100%;
}
}
 @-o-keyframes loader {
 from {
width: 0%;
}
to {
width: 100%;
}
}

 @keyframes counter {
 from {
left: -25px;
}
to {
left: 323px;
}
}
 @-moz-keyframes counter {
 from {
left: -25px;
}
to {
left: 323px;
}
}
 @-webkit-keyframes counter {
 from {
left: -25px;
}
to {
left: 323px;
}
}
 @-o-keyframes counter {
 from {
left: -25px;
}
to {
left: 323px;
}
}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
(a)在“研究水的沸腾”的实验中,得到了如
给生病的老人祝福语,老人病后,希望快点好的祝
大中御城负一层停车场这个地址在什么地方,我
surface3鼠标连不上
单位宣传工作的口号,陶渊明在归去来兮辞中,
将如图Rt△ABC绕直角边AC旋转一周,所得几何
蒸汽流量计补偿系数如何计算
不详之刃台词,求英雄联盟里不详之刃说的话。
地震虽然是一种严重的自然灾害,但通过对地震
我想开炒货店有知道什么地方喜欢吃炒货的地方
恶魔猎手练什么专业好,魔兽世界恶魔猎手练什
宁波徽甬空调安装售后服务部这个地址在什么地
我想做打字员,不用交保证金,会员费,什么钱
在自然界的物质循环中,细菌和真菌把动植物的
沪教版三年级语文名言,哪里有三年级语文下册
推荐资讯
秀杰透明的誓言
梦见我暗恋的人和我牵手。
玩DNF的时候电脑的任务管理器可以关那些
为什么感冒了要喝姜汤
大虎岚村我想知道这个在什么地方
湖塍新村B1~B3座西三门(人行门)地址在什么地
①据统计,我国汉族人口是十一亿三千七百三十
北京jeep2500怎么样
每组加点的词意义和用法都相同的一组是A.良曰
穿越火线打什么字可以变成白色名字
杨根明西医诊所地址在什么地方,想过去办事
双龙禽业地址在哪,我要去那里办事
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?