css3炫酷进度条动画

当前位置:主页 > CSS3库 > CSS3动画 > css3炫酷进度条动画
css3炫酷进度条动画
分享:

    插件介绍

    这是一款css3炫酷进度条动画特效。高css3炫酷进度条动画在原生bootstrap进度条的基础上,通过少量的CSS3代码,将进度条美化为箭头样式,并制作动画效果。

    浏览器兼容性

    浏览器兼容性
    时间:12-19
    阅读:
简要教程

这是一款css3炫酷进度条动画特效。高css3炫酷进度条动画在原生bootstrap进度条的基础上,通过少量的CSS3代码,将进度条美化为箭头样式,并制作动画效果。

使用方法

在页面中引入bootstrap.min.css文件。

<link href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
                
HTML结构

该css3炫酷进度条动画的HTML结构如下:

<div class="container">
    <div class="row text-center">
        <h1 class="white">进度条示例</h1>
    </div>

    <div class="row">
        <div class="col-md-offset-3 col-md-6">
            <div class="progress pink">
                <h3 class="progress-title">HTML5</h3>
                <div class="progress-value">90%</div>
                <div class="progress-bar" style="width:90%; background:linear-gradient(to right,#f791bd,#ff4a98);"></div>
            </div>

            <div class="progress green">
                <h3 class="progress-title">CSS3</h3>
                <div class="progress-value">50%</div>
                <div class="progress-bar" style="width: 50%;  background:linear-gradient(to right,#baf883,#7CF210);"></div>
            </div>

            <div class="progress blue">
                <h3 class="progress-title">J-Query</h3>
                <div class="progress-value">80%</div>
                <div class="progress-bar" style="width:80%; background:linear-gradient(to right,#7E9AFB,#2C5AF9);"></div>
            </div>

            <div class="progress orange">
                <h3 class="progress-title">Bootstrap</h3>
                <div class="progress-value">65%</div>
                <div class="progress-bar" style="width:65%; background:linear-gradient(to right,#FF8E65,#FF5F25);"></div>
            </div>
        </div>
    </div>
</div>            
                
CSS样式

然后通过下面的CSS样式,将进度条美化为箭头样式,以及制作动画效果。

.progress{
    height: 20px;
    background: #fff;
    border-radius: 15px 0 0 15px;
    box-shadow: none;
    margin: 20px 50px 40px 100px;
    overflow: visible;
    position: relative;
}
.progress .progress-title{
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #205580;
    position: absolute;
    bottom: -3px;
    left: -90px;
}
.progress .progress-bar{
    background: #fff;
    box-shadow: none;
    border-radius: 15px 0 0 15px;
    position: relative;
    -webkit-animation: animate-positive 2s;
    animation: animate-positive 2s;
}
.progress .progress-bar:before{
    content: "";
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    position: absolute;
    top: -10px;
    right: -20px;
}
.progress .progress-value{
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #205580;
    position: absolute;
    bottom: -5px;
    right: -50px;
}
.progress.pink .progress-bar:before{ border-left: 20px solid #ff4a98; }
.progress.blue .progress-bar:before{ border-left: 20px solid #2c5af9; }
.progress.green .progress-bar:before{ border-left: 20px solid #7cf210; }
.progress.orange .progress-bar:before{ border-left: 20px solid #ff5f25; }
@-webkit-keyframes animate-positive{
    0% { width: 0; }
}
@keyframes animate-positive{
    0% { width: 0; }
}