1/** 2 * pathLoader.js v1.0.0 3 * http://www.codrops.com 4 * 5 * Licensed under the MIT license. 6 * http://www.opensource.org/licenses/mit-license.php 7 * 8 * Copyright 2014, Codrops 9 * http://www.codrops.com 10 */ 11;( function( window ) { 12 13 'use strict'; 14 15 function PathLoader( el ) { 16 this.el = el; 17 // clear stroke 18 this.el.style.strokeDasharray = this.el.style.strokeDashoffset = this.el.getTotalLength(); 19 } 20 21 PathLoader.prototype._draw = function( val ) { 22 this.el.style.strokeDashoffset = this.el.getTotalLength() * ( 1 - val ); 23 } 24 25 PathLoader.prototype.setProgress = function( val, callback ) { 26 this._draw(val); 27 if( callback && typeof callback === 'function' ) { 28 // give it a time (ideally the same like the transition time) so that the last progress increment animation is still visible. 29 setTimeout( callback, 200 ); 30 } 31 } 32 33 PathLoader.prototype.setProgressFn = function( fn ) { 34 if( typeof fn === 'function' ) { fn( this ); } 35 } 36 37 // add to global namespace 38 window.PathLoader = PathLoader; 39 40})( window );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.