1; 2(function ($) { 3 $.fn.loading = function () { 4 var DEFAULTS = { 5 backgroundColor: '#b3cef6', 6 progressColor: '#4b86db', 7 percent: 75, 8 duration: 2000 9 }; 10 11 $(this).each(function () { 12 var $target = $(this); 13 14 var opts = { 15 backgroundColor: $target.data('color') ? $target.data('color').split(',')[0] : DEFAULTS.backgroundColor, 16 progressColor: $target.data('color') ? $target.data('color').split(',')[1] : DEFAULTS.progressColor, 17 percent: $target.data('percent') ? $target.data('percent') : DEFAULTS.percent, 18 duration: $target.data('duration') ? $target.data('duration') : DEFAULTS.duration 19 }; 20 21 $target.append('<div class="background"></div><div class="rotate"></div><div class="left"></div><div class="right"></div><div class=""><span>' + opts.percent + '%</span></div>'); 22 23 $target.find('.background').css('background-color', opts.backgroundColor); 24 $target.find('.left').css('background-color', opts.backgroundColor); 25 $target.find('.rotate').css('background-color', opts.progressColor); 26 $target.find('.right').css('background-color', opts.progressColor); 27 28 var $rotate = $target.find('.rotate'); 29 setTimeout(function () { 30 $rotate.css({ 31 'transition': 'transform ' + opts.duration + 'ms linear', 32 'transform': 'rotate(' + opts.percent * 3.6 + 'deg)' 33 }); 34 },1); 35 36 if (opts.percent > 50) { 37 var animationRight = 'toggle ' + (opts.duration / opts.percent * 50) + 'ms step-end'; 38 var animationLeft = 'toggle ' + (opts.duration / opts.percent * 50) + 'ms step-start'; 39 $target.find('.right').css({ 40 animation: animationRight, 41 opacity: 1 42 }); 43 $target.find('.left').css({ 44 animation: animationLeft, 45 opacity: 0 46 }); 47 } 48 }); 49 } 50})(jQuery);
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.