-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
178 lines (166 loc) · 7.41 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link href='https://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="index/stylesheets/stylesheet.css" media="screen" />
<link rel="stylesheet" type="text/css" href="index/stylesheets/pygment_trac.css" media="screen" />
<link rel="stylesheet" type="text/css" href="index/stylesheets/print.css" media="print" />
<link rel="stylesheet" type="text/css" href="index/stylesheets/tomorrow-night-bright.css" media="all" />
<script src="index/javascripts/jquery-1.10.2.min.js"></script>
<script src="index/javascripts/prettify.min.js"></script>
<script src="progressx.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>ProgressX by RyadPasha</title>
<script>
$(function() {
prettyPrint()
function resetToDefaults() {
progressx.config({
autoRun : true,
barThickness : 3,
barColors : {
'0' : 'rgba(26, 188, 156, .9)',
'.25' : 'rgba(52, 152, 219, .9)',
'.50' : 'rgba(241, 196, 15, .9)',
'.75' : 'rgba(230, 126, 34, .9)',
'1.0' : 'rgba(211, 84, 0, .9)'
},
shadowBlur : 10,
shadowColor : 'rgba(0, 0, 0, .6)'
})
}
// Page load
resetToDefaults()
progressx.show()
setTimeout(function() {
$('#main_content').fadeIn('slow')
progressx.hide()
}, 1500)
// Simple Demo
$('#btnStartSimple').click(function() {
resetToDefaults()
progressx.show()
})
$('#btnStopSimple').click(function() {
progressx.hide()
})
// Advanced Demo
$('#btnStartAdvanced').click(function() {
resetToDefaults()
progressx.config({
autoRun : false,
barThickness : 5,
barColors : {
'0' : 'rgba(26, 188, 156, .7)',
'.3' : 'rgba(41, 128, 185, .7)',
'1.0' : 'rgba(231, 76, 60, .7)'
},
shadowBlur : 5,
shadowColor : 'rgba(0, 0, 0, .5)'
})
progressx.show();
(function step() {
setTimeout(function() {
if (progressx.progress('+.01') < 1) step()
}, 16)
})()
})
$('#btnStopAdvanced').click(function() {
progressx.hide()
})
})
</script>
</head>
<body>
<div id="container">
<div class="inner">
<header>
<h1>progressx</h1>
<h2>A wonderful & automatic page load progress bar.</h2>
</header>
<section id="main_content">
<section id="downloads" class="clearfix">
<a href="https://github.com/ryadpasha/progressx/zipball/master" id="download-zip" class="button"><span>Download .zip</span></a>
<a href="https://github.com/ryadpasha/progressx/tarball/master" id="download-tar-gz" class="button"><span>Download .tar.gz</span></a>
<a href="https://github.com/ryadpasha/progressx" id="view-on-github" class="button"><span>View on GitHub</span></a>
</section>
<hr>
<h3>Highlights</h3>
<ul>
<li>Tiny (2KB minified and gzipped), no dependency</li>
<li>Perfect for single-page/Turbolinks/pjax applications</a></li>
<li>Responsive</li>
</ul>
<h3>Usages</h3>
<h4>Installation</h4>
<section class="code">
<p>Download <a href="https://raw.github.com/ryadpasha/progressx/master/progressx.js">progressx.js</a> or <a href="https://raw.github.com/ryadpasha/progressx/master/progressx.min.js">progressx.min.js</a> and include it in the page.</p>
<pre class="prettyprint"><script src="path/to/progressx.js"></script></pre>
<p><em>optional:</em> also available for Bower (<code>bower install progressx</code>) and Browserify (<code>npm install progressx</code>).
</p>
</section>
<h4>Basic</h4>
<section class="code">
<p>Call <code>progressx.show()</code> to show and <code>progressx.hide()</code> to hide the progress bar. Before <code>progressx.hide()</code> is called, the progress bar will move slower and slower but never actually reach 100%. Most of the time, these 2 methods are all you need.</p>
<a id="btnStartSimple" class="button" href="javascript:void(0)">Show Progress</a>
<a id="btnStopSimple" class="button" href="javascript:void(0)">Hide Progress</a>
<pre class="prettyprint">
$('#btnStartSimple').click(function() {
progressx.show()
})
$('#btnStopSimple').click(function() {
progressx.hide()
})</pre>
</section>
<h4>Advanced</h4>
<section class="code">
<p>Use <code>progressx.config(options)</code> to customize <em>progressx</em>.</p>
<ul>
<li><code>autoRun</code> (default: <code>true</code>): if <code>false</code>, call <code>progressx.progress()</code> manually to run.</li>
<li><code>barThickness</code> (default: <code>3</code>): the progress bar thickness.</li>
<li><code>barColors</code>: list of gradient color stops used to draw the progress bar.</li>
<li><code>shadowBlur</code> (default: <code>10</code>): the shadow blur.</li>
<li><code>shadowColor</code>: the shadow color.</li>
</ul>
<p>Note: <code>progressx.progress()</code> can take a number or string value. If string, you can use <code>+</code> or <code>-</code> to change the progress relatively to current position. If no argument is specified, return the current progress (<code>0</code> to <code>1</code>).</p>
<a id="btnStartAdvanced" class="button" href="javascript:void(0)">Show Progress</a>
<a id="btnStopAdvanced" class="button" href="javascript:void(0)">Hide Progress</a>
<pre class="prettyprint">
$('#btnStartAdvanced').click(function() {
progressx.config({
autoRun : false,
barThickness : 5,
barColors : {
'0' : 'rgba(26, 188, 156, .7)',
'.3' : 'rgba(41, 128, 185, .7)',
'1.0' : 'rgba(231, 76, 60, .7)'
},
shadowBlur : 5,
shadowColor : 'rgba(0, 0, 0, .5)'
})
progressx.show();
(function step() {
setTimeout(function() {
if (progressx.progress('+.01') < 1) step()
}, 16)
})()
})
$('#btnStopAdvanced').click(function() {
progressx.hide()
})</pre>
</section>
<h3>Browsers</h3>
<p><em>ProgressX</em> works with any browser that supports <a href="http://caniuse.com/canvas">HTML5 Canvas</a>.</p>
<footer>
ProgressX is maintained by <a href="https://github.com/ryadpasha">RyadPasha</a><br>
This page was generated by <a href="http://pages.github.com">GitHub Pages</a>. Tactile theme by <a href="https://twitter.com/jasonlong">Jason Long</a>.
</footer>
</section> <!-- main_content-->
</div>
</div>
</body>
</html>