File tree Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Original file line number Diff line number Diff line change 18
18
19
19
var Settings = NProgress . settings = {
20
20
minimum : 0.08 ,
21
- easing : 'ease ' ,
21
+ easing : 'linear ' ,
22
22
positionUsing : '' ,
23
- speed : 200 ,
23
+ speed : 350 ,
24
24
trickle : true ,
25
- trickleRate : 0.02 ,
26
- trickleSpeed : 800 ,
25
+ trickleSpeed : 250 ,
27
26
showSpinner : true ,
28
27
barSelector : '[role="bar"]' ,
29
28
spinnerSelector : '[role="spinner"]' ,
161
160
162
161
if ( ! n ) {
163
162
return NProgress . start ( ) ;
163
+ } else if ( n > 1 ) {
164
+ return ;
164
165
} else {
165
166
if ( typeof amount !== 'number' ) {
166
- amount = ( 1 - n ) * clamp ( Math . random ( ) * n , 0.1 , 0.95 ) ;
167
+ if ( n >= 0 && n < 0.25 ) {
168
+ // Start out between 3 - 6% increments
169
+ amount = ( Math . random ( ) * ( 5 - 3 + 1 ) + 3 ) / 100 ;
170
+ } else if ( n >= 0.25 && n < 0.65 ) {
171
+ // increment between 0 - 3%
172
+ amount = ( Math . random ( ) * 3 ) / 100 ;
173
+ } else if ( n >= 0.65 && n < 0.9 ) {
174
+ // increment between 0 - 2%
175
+ amount = ( Math . random ( ) * 2 ) / 100 ;
176
+ } else if ( n >= 0.9 && n < 0.99 ) {
177
+ // finally, increment it .5 %
178
+ amount = 0.005 ;
179
+ } else {
180
+ // after 99%, don't increment:
181
+ amount = 0 ;
182
+ }
167
183
}
168
184
169
185
n = clamp ( n + amount , 0 , 0.994 ) ;
172
188
} ;
173
189
174
190
NProgress . trickle = function ( ) {
175
- return NProgress . inc ( Math . random ( ) * Settings . trickleRate ) ;
191
+ return NProgress . inc ( ) ;
176
192
} ;
177
193
178
194
/**
You can’t perform that action at this time.
0 commit comments