其他代码

Bootstrap超酷进度条动画UI设计

阿里云


这是一款基于原生 Bootstrap 进度条组件制作的超酷进度条动画 UI 设计效果。该进度条在原生 Bootstrap 进度条组件的基础上,通过简单 CSS3 代码制作出非常炫酷的进度条动画特效。

HTML 结构

该进度条的 HTML 结构如下,每一个 div.progress 是一个进度条。其中,.progress-bar 元素上通过 style 属性来设置进度条的最终进度。

也想出现在这里?联系我们
创客主机
  1. <div class="container">
  2.     <div class="row">
  3.         <div class="col-md-6">
  4.             <h3 class="progressbar-title">HTML5</h3>
  5.             <div class="progress">
  6.                 <div class="progress-bar" style="width: 85%; background: #ed687c;">
  7.                     <span style="background: #ed687c;">85%</span>
  8.                 </div>
  9.             </div>
  10.  
  11.             <h3 class="progressbar-title">CSS3</h3>
  12.             <div class="progress">
  13.                 <div class="progress-bar" style="width: 75%; background: #049dff;">
  14.                     <span style="background: #049dff;">75%</span>
  15.                 </div>
  16.             </div>
  17.         </div>
  18.     </div>
  19. </div>

CSS 样式

进度条上的标题和文本的样式非常简单。整个进度条采用相对定位方式,并设置背景色,内阴影和外边距。

  1. .progress_bar .pro-bar {
  2.     background: hsl(0, 0%, 97%);
  3.     box-shadow: 0 1px 2px hsla(0, 0%, 0%, 0.1) inset;
  4.     height:4px;
  5.     margin-bottom: 12px;
  6.     margin-top: 50px;
  7.     position: relative;
  8. }
  9. .progress_bar .progress_bar_title{
  10.     color: hsl(218, 4%, 50%);
  11.     font-size: 15px;
  12.     font-weight: 300;
  13.     position: relative;
  14.     top: -28px;
  15.     z-index: 1;
  16. }
  17. .progress_bar .progress_number{
  18.     float: right;
  19.     margin-top: -24px;
  20. }

进度条上的动画刻度使用绝对定位,开始的时候刻度为 0,为刻度动画设置 1 秒钟的 linear 类型动画过渡效果,并在 2 秒时间内执行 animate-positive 动画。

  1. .progress_bar .progress-bar-inner {
  2.     background-color: hsl(0, 0%, 88%);
  3.     display: block;
  4.     width: 0;
  5.     height: 100%;
  6.     position: absolute;
  7.     top: 0;
  8.     left: 0;
  9.     transition: width 1s linear 0s;
  10.     animation: animate-positive 2s;
  11. }
  12. @-webkit-keyframes animate-positive{
  13.     0% { width: 0%; }
  14. }
  15. @keyframes animate-positive{
  16.     0% { width: 0%; }
  17. }

进度条刻度前面的小圆使用.progress-bar-inner 的:before 和:after 为元素来制作。

  1. .progress_bar .progress-bar-inner:before {
  2.     content: "";
  3.     background-color: hsl(0, 0%, 100%);
  4.     border-radius: 50%;
  5.     width: 4px;
  6.     height: 4px;
  7.     position: absolute;
  8.     right: 1px;
  9.     top: 0;
  10.     z-index: 1;
  11. }
  12. .progress_bar .progress-bar-inner:after {
  13.     content: "";
  14.     width: 14px;
  15.     height: 14px;
  16.     background-color: inherit;
  17.     border-radius: 50%;
  18.     position: absolute;
  19.     right: -4px;
  20.     top: -5px;
  21. }

完整的 CSS 代码请参考下载文件。

Bootstrap 超酷进度条动画 UI 设计

已有 416 人购买
  • r0r2
查看演示升级 VIP立刻购买

演示地址 下载地址
收藏
(0)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!