Monday, May 5, 2014

Let's Make a CSS3 3D Progress Bar

Today I will try to make a cool 3d progress bar with css3,it's pretty for its shining bar,and you can config it very easy.let's preview it:



Now let's see the source code below:

html:

<ul id="skill">
    <li><span class="expand html5"></span><em>HTML 5</em></li>
    <li><span class="expand css3"></span><em>CSS 3</em></li>
    <li><span class="expand jquery"></span><em>jQuery</em></li>
    <li><span class="expand photoshop"></span><em>Photoshop</em></li>
    <li><span class="expand dreamweaver"></span><em>Dreamweaver</em></li>
</ul>

we use ul li to show the basic frame for the progress bar.

css:

#skill {
list-style:none;
padding-top:30px;
}
#skill li {
margin-bottom:70px;
background:#000;
height:5px;
border-radius:3px;
border-left:1px solid #111;
border-top:1px solid #111;
border-right:1px solid #333;
border-bottom:1px solid #333;
}
#skill li em {
position:relative;
top:-30px;
}
.expand {
height:1px;
margin:2px 0;
background:#2187e7;
position:absolute;
box-shadow:0px 0px 10px 1px rgba(0,198,255,0.4);
}
.html5       { width:70%;  -moz-animation:html5 2s ease-out;       -webkit-animation:html5 2s ease-out;       }
.css3        { width:90%;  -moz-animation:css3 2s ease-out;        -webkit-animation:css3 2s ease-out;        }
.jquery      { width:50%;  -moz-animation:jquery 2s ease-out;      -webkit-animation:jquery 2s ease-out;      }
.photoshop   { width:10%;  -moz-animation:photoshop 2s ease-out;   -webkit-animation:photoshop 2s ease-out;   }
.dreamweaver { width:100%; -moz-animation:dreamweaver 2s ease-out; -webkit-animation:dreamweaver 2s ease-out; }
@-moz-keyframes html5       { 0%  { width:0px;} 100%{ width:70%;}  }
@-moz-keyframes css3        { 0%  { width:0px;} 100%{ width:90%;}  }
@-moz-keyframes jquery      { 0%  { width:0px;} 100%{ width:50%;}  }
@-moz-keyframes photoshop   { 0%  { width:0px;} 100%{ width:10%;}  }
@-moz-keyframes dreamweaver { 0%  { width:0px;} 100%{ width:100%;} }
@-webkit-keyframes html5       { 0%  { width:0px;} 100%{ width:70%;}  }
@-webkit-keyframes css3        { 0%  { width:0px;} 100%{ width:90%;}  }
@-webkit-keyframes jquery      { 0%  { width:0px;} 100%{ width:50%;}  }
@-webkit-keyframes photoshop   { 0%  { width:0px;} 100%{ width:10%;}  }
@-webkit-keyframes dreamweaver { 0%  { width:0px;} 100%{ width:100%;} }
we define some animations for very bars using @-moz-keyframes and @-webkit-keyframes.

It takes me about 1 hour to write the code and about 3 hour to design,css3 is so wonderful that most developer love it.

No comments:

Post a Comment