Skip to content

Commit 2c38adb

Browse files
author
Octavian Ciubotaru
committed
Initial version
1 parent caea033 commit 2c38adb

6 files changed

+222
-2
lines changed

README.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
jquery-css-progress-bar
1+
JQuery CSS Progress Bar
22
=======================
33

4-
A jquery plugin for Pure CSS Progress Bar by http://ivan.ly
4+
A jquery plugin for Pure CSS Progress Bar by http://ivan.ly
5+
6+
Check his project at: https://github.com/ivanvanderbyl/ui-progress-bar
7+
8+
Usage
9+
=====
10+
11+
Initialize:
12+
$("#myProgressBar").cssProgressBar();
13+
14+
Update your progress:
15+
$("#myProgressBar").cssProgressBar("update", 99);
16+
17+
Author
18+
======
19+
20+
Ciubotaru Octavian

jquery-css-progress-bar-min.css

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jquery-css-progress-bar-min.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jquery-css-progress-bar.css

+158
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
/*
2+
Copyright (c) 2010-2012 Ivan Vanderbyl
3+
Originally found at http://ivan.ly/ui
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.
22+
23+
*/
24+
/* Webkit animation keyframes */
25+
@-webkit-keyframes animate-stripes {
26+
to {
27+
background-position: 0 0;
28+
}
29+
30+
from {
31+
background-position: 44px 0;
32+
}
33+
}
34+
35+
@-moz-keyframes animate-stripes {
36+
to {
37+
background-position: 0 0;
38+
}
39+
40+
from {
41+
background-position: 36px 0;
42+
}
43+
}
44+
45+
/* Bar which is placed behind the progress */
46+
.ui-progress-bar {
47+
/* Usual setup stuff */
48+
position: relative;
49+
height: 25px;
50+
/* Pad right so we don't cover the borders when fully progressed */
51+
padding-right: 2px;
52+
/* For browser that don't support gradients, we'll set a blanket background colour */
53+
background-color: #abb2bc;
54+
/* Rounds the ends, we specify an excessive amount to make sure they are completely rounded */
55+
/* Adjust to your liking, and don't forget to adjust to the same amount in .ui-progress */
56+
-moz-border-radius: 25px;
57+
-webkit-border-radius: 25px;
58+
-o-border-radius: 25px;
59+
-ms-border-radius: 25px;
60+
-khtml-border-radius: 25px;
61+
border-radius: 25px;
62+
/* Background gradient */
63+
background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #949daa), color-stop(100%, #abb2bc));
64+
background: -webkit-linear-gradient(#949daa 0%, #abb2bc 100%);
65+
background: -moz-linear-gradient(#949daa 0%, #abb2bc 100%);
66+
background: -o-linear-gradient(#949daa 0%, #abb2bc 100%);
67+
background: -ms-linear-gradient(#949daa 0%, #abb2bc 100%);
68+
background: linear-gradient(#949daa 0%, #abb2bc 100%);
69+
/* Give it the inset look by adding some shadows and highlights */
70+
-moz-box-shadow: inset 0px 1px 2px 0px rgba(0, 0, 0, 0.5), 0px 1px 0px 0px white;
71+
-webkit-box-shadow: inset 0px 1px 2px 0px rgba(0, 0, 0, 0.5), 0px 1px 0px 0px white;
72+
-o-box-shadow: inset 0px 1px 2px 0px rgba(0, 0, 0, 0.5), 0px 1px 0px 0px white;
73+
box-shadow: inset 0px 1px 2px 0px rgba(0, 0, 0, 0.5), 0px 1px 0px 0px white;
74+
/* Alt colours */
75+
/* Progress part of the progress bar */
76+
}
77+
.ui-progress-bar.blue .ui-progress {
78+
background-color: #339BB9!important;
79+
border: 1px solid #287a91;
80+
}
81+
.ui-progress-bar.error .ui-progress {
82+
background-color: #C43C35 !important;
83+
border: 1px solid #9c302a;
84+
}
85+
.ui-progress-bar.warning .ui-progress {
86+
background-color: #D9B31A!important;
87+
border: 1px solid #ab8d15;
88+
}
89+
.ui-progress-bar.success .ui-progress {
90+
background-color: #57A957!important;
91+
border: 1px solid #458845;
92+
}
93+
.ui-progress-bar.transition .ui-progress {
94+
-moz-transition: background-color 0.5s ease-in, border-color 1.5s ease-out, box-shadow 1.5s ease-out;
95+
-webkit-transition: background-color 0.5s ease-in, border-color 1.5s ease-out, box-shadow 1.5s ease-out;
96+
-o-transition: background-color 0.5s ease-in, border-color 1.5s ease-out, box-shadow 1.5s ease-out;
97+
transition: background-color 0.5s ease-in, border-color 1.5s ease-out, box-shadow 1.5s ease-out;
98+
}
99+
.ui-progress-bar .ui-progress {
100+
/* Usual setup stuff */
101+
position: relative;
102+
display: block;
103+
overflow: hidden;
104+
/* Height should be 2px less than .ui-progress-bar so as to not cover borders and give it a look of being inset */
105+
height: 23px;
106+
/* Rounds the ends, we specify an excessive amount to make sure they are completely rounded */
107+
/* Adjust to your liking, and don't forget to adjust to the same amount in .ui-progress-bar */
108+
-moz-border-radius: 25px;
109+
-webkit-border-radius: 25px;
110+
-o-border-radius: 25px;
111+
-ms-border-radius: 25px;
112+
-khtml-border-radius: 25px;
113+
border-radius: 25px;
114+
/* Set the background size so the stripes work correctly */
115+
-webkit-background-size: 44px 44px;
116+
-moz-background-size: 36px 36px;
117+
/* Webkit */
118+
/* For browser that don't support gradients, we'll set a base background colour */
119+
background-color: #74d04c;
120+
/* Webkit background stripes and gradient */
121+
background: -webkit-gradient(linear, 0 0, 44 44, color-stop(0, rgba(255, 255, 255, 0.17)), color-stop(0.25, rgba(255, 255, 255, 0.17)), color-stop(0.26, rgba(255, 255, 255, 0)), color-stop(0.5, rgba(255, 255, 255, 0)), color-stop(0.51, rgba(255, 255, 255, 0.17)), color-stop(0.75, rgba(255, 255, 255, 0.17)), color-stop(0.76, rgba(255, 255, 255, 0)), color-stop(1, rgba(255, 255, 255, 0))), -webkit-gradient(linear, left bottom, left top, color-stop(0, rgba(255, 255, 255, 0)), color-stop(1, rgba(255, 255, 255, 0.35))), #74d04c;
122+
/* Mozilla (Firefox etc) background stripes */
123+
/* Note: Mozilla's support for gradients is more true to the original design, allowing gradients at 30 degrees, as apposed to 45 degress in webkit. */
124+
background: -moz-repeating-linear-gradient(top left -30deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.17) 15px, rgba(255, 255, 255, 0) 15px, rgba(255, 255, 255, 0) 30px), -moz-linear-gradient(rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 100%), #74d04c;
125+
-moz-box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, 0.4), inset 0px -1px 1px rgba(0, 0, 0, 0.2);
126+
-webkit-box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, 0.4), inset 0px -1px 1px rgba(0, 0, 0, 0.2);
127+
-o-box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, 0.4), inset 0px -1px 1px rgba(0, 0, 0, 0.2);
128+
box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, 0.4), inset 0px -1px 1px rgba(0, 0, 0, 0.2);
129+
/* Give it a higher contrast outline */
130+
border: 1px solid #4c8932;
131+
/* Animate */
132+
-moz-animation: animate-stripes 2s linear infinite;
133+
-webkit-animation: animate-stripes 2s linear infinite;
134+
-o-animation: animate-stripes 2s linear infinite;
135+
-ms-animation: animate-stripes 2s linear infinite;
136+
-khtml-animation: animate-stripes 2s linear infinite;
137+
animation: animate-stripes 2s linear infinite;
138+
/* Style status label */
139+
}
140+
.ui-progress-bar .ui-progress span.ui-label {
141+
-moz-font-smoothing: antialiased;
142+
-webkit-font-smoothing: antialiased;
143+
-o-font-smoothing: antialiased;
144+
-ms-font-smoothing: antialiased;
145+
-khtml-font-smoothing: antialiased;
146+
font-smoothing: antialiased;
147+
font-size: 13px;
148+
position: absolute;
149+
right: 0;
150+
line-height: 23px;
151+
padding-right: 12px;
152+
color: rgba(0, 0, 0, 0.6);
153+
text-shadow: rgba(255, 255, 255, 0.45) 0 1px 0px;
154+
white-space: nowrap;
155+
}
156+
.ui-progress-bar .ui-progress span.ui-label b {
157+
font-weight: bold;
158+
}

jquery-css-progress-bar.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
(function ($) {
2+
3+
var methods = {
4+
init : function (options) {
5+
this.addClass("ui-progress-bar");
6+
this.addClass("ui-container");
7+
this.addClass("transition");
8+
var progressDiv = document.createElement('div');
9+
progressDiv.setAttribute("class", "ui-progress");
10+
progressDiv.setAttribute("style", "width: 0%;");
11+
this.append(progressDiv);
12+
return this;
13+
},
14+
update : function (perc) {
15+
this.children().css("width", perc + "%");
16+
return this;
17+
}
18+
};
19+
20+
$.fn.cssProgressBar = function (method) {
21+
if (methods[method]) {
22+
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
23+
} else if (typeof method === 'object' || !method) {
24+
return methods.init.apply(this, arguments);
25+
} else {
26+
$.error('Method ' + method + ' does not exist on jQuery.cssProgressBar');
27+
}
28+
};
29+
30+
})(jQuery);

upb-licence.txt

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
License
2+
Copyright (c) 2010-2012 Ivan Vanderbyl, Some Rights Reserved.
3+
4+
Originally found at ivan.ly and developed for use in TestPilot Continuous Integration service.
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9+
10+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)