1/*! jQuery Migrate v1.2.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */ 2jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){var r=t.console;i[n]||(i[n]=!0,e.migrateWarnings.push(n),r&&r.warn&&!e.migrateMute&&(r.warn("JQMIGRATE: "+n),e.migrateTrace&&r.trace&&r.trace()))}function a(t,a,i,o){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(o),i},set:function(e){r(o),i=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=i}var i={};e.migrateWarnings=[],!e.migrateMute&&t.console&&t.console.log&&t.console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){i={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var o=e("<input/>",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",o||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,i,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(o?a in o:e.isFunction(e.fn[a])))?e(t)[a](i):("type"===a&&i!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,i=e.prop(t,r);return i===!0||"boolean"!=typeof i&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,i))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,n,a){var i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(i=y.exec(e.trim(t)))&&i[0]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),i[3]&&r("$(html) HTML text after last tag is ignored"),"#"===i[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(i[2],n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,i,o=this[0];return!o||"events"!==t||1!==arguments.length||(a=e.data(o,t),i=e._data(o,t),a!==n&&a!==i||i===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),i)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,i,o){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),i)for(c=function(e){return!e.type||j.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):i.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(i.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].c
2oncat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,T=e.fn.live,M=e.fn.die,S="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",C=RegExp("\\b(?:"+S+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,i){e!==document&&C.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,i)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,i=t.guid||e.guid++,o=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%o;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=i;a.length>o;)a[o++].guid=i;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),T?T.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),M?M.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||C.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(S.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window); 3var stacks = {}; 4stacks.jQuery = jQuery.noConflict(true); 5stacks.stacks_in_84 = {}; 6stacks.stacks_in_84 = (function(stack) { 7var jQuery = stacks.jQuery;var $ = jQuery;var opticStats = $; 8/* 9jquery-plugin-circliful 10+The MIT License (MIT) 11+ 12+Copyright (c) 2014 Patric Gutersohn 13+ 14+Permission is hereby granted, free of charge, to any person obtaining a copy of 15+this software and associated documentation files (the "Software"), to deal in 16+the Software without restriction, including without limitation the rights to 17+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 18+the Software, and to permit persons to whom the Software is furnished to do so, 19+subject to the following conditions: 20+ 21+The above copyright notice and this permission notice shall be included in all 22+copies or substantial portions of the Software. 23+ 24+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 26+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 27+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 28+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 29+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30*/ 31"use strict"; 32 33(function (opticStats) { 34 35 opticStats.fn.circliful = function (options, callback) { 36 37 var settings = opticStats.extend({ 38 // These are the defaults. 39 startdegree: 0, 40 fgcolor: "#556b2f", 41 bgcolor: "#eee", 42 fill: false, 43 width: 15, 44 dimension: 200, 45 fontsize: 15, 46 percent: 50, 47 animationstep: 1.0, 48 iconsize: '20px', 49 iconcolor: '#999', 50 border: 'default', 51 complete: null, 52 bordersize: 10 53 }, options); 54 55 return this.each(function () { 56 57 var customSettings = ["fgcolor", "bgcolor", "fill", "width", "dimension", "fontsize", "animationstep", "endPercent", "icon", "iconcolor", "iconsize", "border", "startdegree", "bordersize"]; 58 59 var customSettingsObj = {}; 60 var icon = ''; 61 var percent; 62 var endPercent = 0; 63 var obj = opticStats(this); 64 var fill = false;
65 var text, info; 66 67 obj.addClass('circliful'); 68 69 checkDataAttributes(obj); 70 71 if (obj.data('text') != undefined) { 72 73 //remove non number characters 74 75 text = obj.data('text'); 76 text = text.toString(); 77 text = text.replace(/[^0-9.,]/g, ''); 78 text = "<span class='counter'>" + text + "</span>"; 79 80 if (obj.data('icon') != undefined) { 81 icon = opticStats('<i></i>') 82 .addClass('osIcon fa ' + opticStats(this).data('icon')) 83 .css({ 84 'color': customSettingsObj.iconcolor, 85 'font-size': customSettingsObj.iconsize, 86 'line-height': customSettingsObj.iconsize + "px" 87 }); 88 } 89 if (obj.data('icon-custom') != undefined) { 90 icon = opticStats('<img src="'+opticStats(this).data("icon-custom")+'"></img>') 91 .addClass('osIcon ') 92 .css({ 93 'width': customSettingsObj.iconsize, 94 'height': customSettingsObj.iconsize 95 }); 96 } 97 98 if (obj.data('type') != undefined) { 99 type = opticStats(this).data('type'); 100 101 if (type == 'half') { 102 addCircleText(obj, 'circle-text-half', (customSettingsObj.dimension / 1.45)); 103 } else { 104 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 105 } 106 } else { 107 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 108 } 109 } 110 111 if (opticStats(this).data("total") != undefined && opticStats(this).data("part") != undefined) { 112 var total = opticStats(this).data("total") / 100; 113 114 percent = ((opticStats(this).data("part") / total) / 100).toFixed(3); 115 endPercent = (opticStats(this).data("part") / total).toFixed(3); 116 } else { 117 if (opticStats(this).data("percent") != undefined) { 118 percent = opticStats(this).data("percent") / 100; 119 endPercent = opticStats(this).data("percent"); 120 } else { 121 percent = settings.percent / 100; 122 } 123 } 124 125 if (opticStats(this).data('info') != undefined) { 126 info = opticStats(this).data('info'); 127 128 if (opticStats(this).data('type') != undefined) { 129 type = opticStats(this).data('type'); 130 131 if (type == 'half') { 132 addInfoText(obj, 0.9); 133 } else { 134 addInfoText(obj, 1.25); 135 } 136 } else { 137 addInfoText(obj, 1.25); 138 } 139 } 140 141 opticStats(this).width(customSettingsObj.dimension + 'px'); 142 if (type == 'line' || type == 'vert-line') { 143 opticStats(this).height(opticStats(this).data('height') + 'px'); 144 } else { 145 opticStats(this).height(customSettingsObj.dimension + 'px'); 146 } 147 148 149 var sizeX = customSettingsObj.dimension, 150 sizeY = customSettingsObj.dimension; 151 if (type == 'line' || type == 'vert-line') { 152 sizeY = opticStats(this).data('height'); 153 } 154 var canvas = opticStats('<canvas></canvas>').attr({ 155 width: sizeX, 156 height: sizeY 157 }).appendTo(opticStats(this)).get(0); 158 var context = canvas.getContext('2d'); 159 160 var dpr = window.devicePixelRatio; 161 if ( dpr ) { 162 var opticStatscanvas = opticStats(canvas); 163 opticStatscanvas.css('width', sizeX); 164 opticStatscanvas.css('height', sizeY); 165 opticStatscanvas.attr('width', sizeX * dpr); 166 opticStatscanvas.attr('height', sizeY * dpr); 167 168 context.scale(dpr, dpr); 169 } 170 171 var container = opticStats(canvas).parent(); 172 var x = sizeX / 2; 173 var y = sizeY / 2; 174 var degrees = customSettingsObj.percent * 360.0; 175 var radians = degrees * (Math.PI / 180); 176 var radius = sizeX / 2.5; 177 var startAngle = 2.3 * Math.PI; 178 var endAngle = 0; 179 var counterClockwise = false; 180 var curPerc = customSettingsObj.animationstep === 0.0 ? endPercent : 0.0; 181 var curStep = Math.max(customSettingsObj.animationstep, 0.0); 182 var circ = Math.PI * 2; 183 var quart = Math.PI / 2; 184 var type = ''; 185 var fireCallback = true; 186 var additionalAngelPI = (customSettingsObj.startdegree / 180) * Math.PI; 187 188 if (opticStats(this).data('type') != undefined) { 189 type = opticStats(this).data('type'); 190 if (type == 'half') { 191 startAngle = 2.0 * Math.PI; 192 endAngle = 3.14; 193 circ = Math.PI; 194 quart = Math.PI / 0.996; 195 } else if (type == 'angle') { 196 startAngle = 2.25 * Math.PI; 197 endAngle = 2.4; 198 circ = 1.53 + Math.PI; 199 quart = 0.73 + Math.PI / 0.996; 200 } 201 } 202 203 /** 204 * adds text to circle 205 * 206 * @param obj 207 * @param cssClass 208 * @param lineHeight 209 */ 210 opticStats(" > span", this).wrapAll("<div class='centerMe'><div></div></div>"); 211 function addCircleText(obj, cssClass, lineHeight) { 212 opticStats("<span></span>") 213 .appendTo(obj) 214 .addClass(cssClass) 215 .html(text) 216 .prepend(icon) 217 .css({ 218 //'line-height': lineHeight + 'px', 219 'font-size': customSettingsObj.fontsize + 'px', 220 'line-height': customSettingsObj.fontsize + 'px' 221 }); 222 } 223 224 /** 225 * adds info text to circle 226 * 227 * @param obj 228 * @param factor 229 */ 230 function addInfoText(obj, factor) { 231 opticStats('<span></span>') 232 .appendTo(obj) 233 .addClass('circle-info-half') 234 //.css( 235 //'line-height', (customSettingsObj.dimension * factor) + 'px' 236 //) 237 .text(info); 238 } 239 240 /** 241 * checks which data attributes are defined 242 * @param obj 243 */ 244 function checkDataAttributes(obj) { 245 opticStats.each(customSettings, function (index, attribute) { 246 if (obj.data(attribute) != undefined) { 247 customSettingsObj[attribute] = obj.data(attribute); 248 } else { 249 customSettingsObj[attribute] = opticStats(settings).attr(attribute); 250 } 251 252 if (attribute == 'fill' && obj.data('fill') != undefined) { 253 fill = true; 254 } 255 }); 256 } 257 258 //Animation Variables 259 var inc = 0, counter=0,calm = 2,finishFrames=0, animationType = obj.data('animation-type'), slowTheInc = 0; 260 // ---------------------- // 261 // Animation Functions 262 // ---------------------- // 263 function blend(inColor,outColor,current){ 264 var inColors = inColor.substring(inColor.indexOf('(') + 1, inColor.lastIndexOf(')')).split(/,\s*/), 265 outColors = outColor.substring(outColor.indexOf('(') + 1, outColor.lastIndexOf(')')).split(/,\s*/), 266 r,g,b,a,cur; 267 for(var i=0; i<inColors.length; i++) { inColors[i] = parseInt(inColors[i], 10); } 268 for(var i=0; i<outColors.length; i++) { outColors[i] = parseInt(outColors[i], 10); } 269 if(current < .5 ) { 270 cur = current*2; 271 r = Math.min(255,Math.max(0, inColors[0] + (outColors[0] * cur))); 272 g = Math.min(255,Math.max(0, inColors[1] + (outColors[1] * cur))); 273 b = Math.min(255,Math.max(0, inColors[2] + (outColors[2] * cur))); 274 } else { 275 cur = (current-.5)*2; 276 r = Math.min(255,Math.max(0,Math.max(inColors[0], outColors[0]) + ((outColors[0] - inColors[0]) * cur))); 277 g = Math.min(255,Math.max(0,Math.max(inColors[1], outColors[1]) + ((outColors[1] - inColors[1]) * cur))); 278 b = Math.min(255,Math.max(0,Math.max(inColors[2], outColors[2]) + ((outColors[2] - inColors[2]) * cur))); 279 } 280 var a = inColors[3]+((outColors[3] - inColors[3])*current);
281 return 'rgba('+Math.floor(r)+', '+Math.floor(g)+', '+Math.floor(b)+', '+Math.floor(a)+')'; 282 } 283 if (type == 'line' || type == 'vert-line') { 284 customSettingsObj.bordersize = customSettingsObj.bordersize*2; 285 } 286 var increaseInc = function(inc, current) { 287 if (current >= 1) { 288 // slowTheInc += 0.00002; 289 // slowTheInc = Math.min(slowTheInc, 0.005); 290 // inc = inc + (0.005-slowTheInc); 291 } else { 292 inc += 0.005; 293 } 294 return inc; 295 } 296 var moveColors = function(value, inc) { 297 var pos = value+inc; 298 pos = pos.toString(); 299 pos = pos.split(".").pop(); 300 pos = parseFloat("."+pos); 301 return pos; 302 } 303 var createGrad = function(inc,sizeX, sizeY) { 304 var grd=context.createLinearGradient(0,0,sizeX,sizeY); 305 grd.addColorStop(moveColors(0, inc),"#FF0000"); 306 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 307 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 308 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 309 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 310 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 311 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 312 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 313 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 314 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 315 grd.addColorStop(moveColors(1, inc),"#FF0000"); 316 return grd; 317 } 318 var shadowGlow = function() { 319 context.shadowColor = customSettingsObj.fgcolor; 320 context.shadowOffsetX = 0; 321 context.shadowOffsetY = 0; 322 context.shadowBlur = 10; 323 } 324 var drawBorder = function() { 325 context.lineWidth = customSettingsObj.bordersize + 1; 326 context.strokeStyle = customSettingsObj.bgcolor; 327 context.stroke(); 328 if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle') { 329 // 330 } else { 331 context.fillStyle = customSettingsObj.fill; 332 context.fill(); 333 } 334 context.beginPath(); 335 context.save(); 336 } 337 var fillAnimation = function(animationType, current) { 338 if(animationType == 1){ 339 context.strokeStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 340 context.stroke(); 341 } else if(animationType == 2){ 342 context.strokeStyle = customSettingsObj.fgcolor; 343 if (type == 'line') { 344 var grd=context.createLinearGradient(sizeX,0,0,0); 345 grd.addColorStop(0,"white"); 346 grd.addColorStop(1,customSettingsObj.fgcolor); 347 context.strokeStyle = grd; 348 shadowGlow(); 349 } else if (type == 'vert-line') { 350 var grd=context.createLinearGradient(0,0,0,sizeY); 351 grd.addColorStop(0,"white"); 352 grd.addColorStop(1,customSettingsObj.fgcolor); 353 context.strokeStyle = grd; 354 shadowGlow(); 355 } else { 356 var grd = context.createRadialGradient(sizeX/2, sizeY/2, (sizeX+customSettingsObj.bordersize*2)/2.5, sizeY/2, sizeX/2, (sizeY-customSettingsObj.bordersize*2)/2.5); 357 grd.addColorStop(0, customSettingsObj.fgcolor); 358 grd.addColorStop(0.5, 'white'); 359 grd.addColorStop(1, customSettingsObj.fgcolor); 360 context.strokeStyle = grd; 361 shadowGlow(); 362 } 363 context.stroke(); 364 context.restore(); 365 } else if(animationType == 3){ 366 if (type == 'line') { 367 var grd = createGrad(inc,sizeX,sizeY); 368 inc = increaseInc(inc,current); 369 context.strokeStyle = grd; 370 } else if (type == 'vert-line') { 371 var grd=context.createLinearGradient(sizeX/2,0,sizeX/2,sizeY); 372 grd.addColorStop(moveColors(0, inc),"#FF0000"); 373 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 374 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 375 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 376 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 377 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 378 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 379 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 380 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 381 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 382 grd.addColorStop(moveColors(1, inc),"#FF0000"); 383 inc = increaseInc(inc,current); 384 context.strokeStyle = grd; 385 } else { 386 var grd = createGrad(inc,sizeX,sizeY); 387 inc = increaseInc(inc,current); 388 context.strokeStyle = grd; 389 } 390 context.stroke();
391 context.restore(); 392 } else { 393 context.strokeStyle = customSettingsObj.fgcolor; 394 context.stroke(); 395 } 396 } 397 // ---------------------- // 398 // Animation 399 // ---------------------- // 400 function animate(current) { 401 //Clear Canvas for next frame 402 context.clearRect(0, 0, canvas.width, canvas.height); 403 //Draw Background 404 if (type == 'line' || type == 'vert-line') { 405 context.rect(10, 10, sizeX-20, sizeY-20); 406 } else if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle' || type == 'full' || type == 'half') { 407 context.beginPath(); 408 context.arc(x, y, radius, endAngle, startAngle, false); 409 } 410 context.fillStyle = customSettingsObj.fill; 411 context.fill(); 412 if (type == 'line') { 413 context.beginPath(); 414 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 415 context.lineTo(sizeX-10,sizeY-(customSettingsObj.bordersize/2+10)); 416 drawBorder(); 417 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 418 context.lineTo(Math.min((sizeX-20) * current+10,sizeX-10),sizeY-(customSettingsObj.bordersize/2+10)); 419 fillAnimation(animationType,current); 420 } else if (type == 'vert-line'){ 421 context.beginPath(); 422 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 423 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),10); 424 drawBorder(); 425 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 426 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),Math.max((sizeY-20) * (1-current)+10,10)); 427 fillAnimation(animationType,current); 428 } else if (type == 'full' || type=='half') { 429 drawBorder(); 430 context.arc(x, y, radius, -(quart) + additionalAngelPI, ((circ) * (Math.min(current,1)+.005)) - quart + additionalAngelPI, false); 431 fillAnimation(animationType,current); 432 } else if (type == 'grow-circle') { 433 drawBorder(); 434 var fillRadius = sizeX/2.5*Math.min(current,1); 435 context.arc(sizeX/2, sizeY/2, Math.max(fillRadius-customSettingsObj.bordersize/2,0), endAngle, startAngle, false); 436 if(animationType == 1){ 437 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 438 context.fill(); 439 } else if(animationType == 2){ 440 var grd=context.createLinearGradient(0,0,0,sizeY); 441 grd.addColorStop(0,"white"); 442 grd.addColorStop(1,customSettingsObj.fgcolor); 443 shadowGlow(); 444 context.fillStyle = grd; 445 context.fill(); 446 } else if(animationType == 3){ 447 var grd = createGrad(inc,sizeX,sizeY); 448 inc = increaseInc(inc,current); 449 context.fillStyle = grd; 450 context.fill(); 451 } else { 452 context.fillStyle = customSettingsObj.fgcolor; 453 context.fill(); 454 } 455 context.restore(); 456 } else if (type == 'fill-circle') { 457 drawBorder(); 458 var fillRadius = sizeX/2.5, 459 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 460 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 461 if(animationType == 1){ 462 context.clip(); 463 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 464 context.fillRect(0, fillLine, sizeX, sizeY); 465 } else if(animationType == 2){ 466 var grd=context.createLinearGradient(0,0,0,sizeY); 467 grd.addColorStop(0,"white"); 468 grd.addColorStop(1,customSettingsObj.fgcolor); 469 shadowGlow(); 470 context.clip(); 471 context.fillStyle = grd; 472 context.fillRect(0, fillLine, sizeX, sizeY); 473 474 } else if(animationType == 3){ 475 context.clip(); 476 var grd = createGrad(inc,sizeX, sizeY); 477 inc = increaseInc(inc,current); 478 context.fillStyle = grd; 479 context.fillRect(0, fillLine, sizeX, sizeY); 480 } else { 481 context.clip(); 482 context.fillStyle = customSettingsObj.fgcolor; 483 context.fillRect(0, fillLine, sizeX, sizeY); 484 }
485 context.restore(); 486 } else if (type == 'fill-circle-wave') { 487 drawBorder(); 488 var fillRadius = sizeX/2.5, 489 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 490 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 491 var ypos=fillLine, xpos=0; 492 counter += .1; 493 counterLoop = counter; 494 var increase = 2*Math.PI / 12; 495 context.clip(); 496 context.beginPath(); 497 context.moveTo(sizeX,sizeY); 498 context.lineTo(0,sizeY); 499 context.lineTo(0,ypos); 500 if (curPerc > endPercent) { 501 calm-=.01; 502 if(calm<0) calm=0; 503 } 504 for(i=0; i<=sizeX; i+=10){ 505 xpos = i; 506 ypos = ypos - Math.sin(counterLoop) * calm; 507 counterLoop += increase; 508 context.lineTo(xpos,ypos); 509 } 510 context.lineTo(sizeX,sizeY); 511 context.closePath(); 512 if(animationType == 1){ 513 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 514 context.fill(); 515 } else if(animationType == 2){ 516 var grd=context.createLinearGradient(0,0,0,sizeY); 517 grd.addColorStop(0,"white"); 518 grd.addColorStop(1,customSettingsObj.fgcolor); 519 shadowGlow(); 520 context.clip(); 521 context.fillStyle = grd; 522 context.fill(); 523 } else if(animationType == 3){ 524 context.clip(); 525 var grd = createGrad(inc,sizeX,sizeY); 526 inc = increaseInc(inc,current); 527 context.fillStyle = grd; 528 context.fill(); 529 } else { 530 context.clip(); 531 context.fillStyle = customSettingsObj.fgcolor; 532 context.fill(); 533 } 534 context.restore(); 535 } 536 537 if (curPerc < endPercent) { 538 curPerc += curStep; 539 requestAnimationFrame(function () { 540 context.strokeStyle = customSettingsObj.fgcolor; 541 animate(Math.min(curPerc, endPercent) / 100); 542 }, obj); 543 } else if(finishFrames < 500) { 544 curPerc += curStep; 545 finishFrames+=1; 546 requestAnimationFrame(function () { 547 context.strokeStyle = customSettingsObj.fgcolor; 548 animate(Math.min(curPerc, endPercent) / 100); 549 }, obj); 550 } 551 552 if (curPerc == endPercent && fireCallback && typeof(options) != "undefined") { 553 if (opticStats.isFunction(options.complete)) { 554 options.complete(); 555 556 fireCallback = false; 557 } 558 } 559 } 560 obj.waypoint(function(direction){ 561 animate(curPerc / 100); 562 this.destroy(); 563 }, { offset: '100%' }); 564 }); 565 }; 566}(opticStats)); 567/* 568 The MIT License (MIT) 569 CountUp 570+Copyright (c) 2014-2015 Jamie Perkins 571 Permission is hereby granted, free of charge, to any person obtaining a copy of 572 this software and associated documentation files (the "Software"), to deal in 573*/ 574!function(t,a){"function"==typeof define&&define.amd?define(a):"object"==typeof exports?module.exports=a(require,exports,module):t.CountUp=a()}(this,function(){var t=function(t,a,e,n,i,r){for(var o=0,s=["webkit","moz","ms","o"],u=0;u<s.length&&!window.requestAnimationFrame;++u)window.requestAnimationFrame=window[s[u]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[s[u]+"CancelAnimationFrame"]||window[s[u]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var a=(new Date).getTime(),e=Math.max(0,16-(a-o)),n=window.setTimeout(function(){t(a+e)},e);return o=a+e,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),this.options={useEasing:!0,useGrouping:!0,separator:",",decimal:"."};for(var m in r)r.hasOwnProperty(m)&&(this.options[m]=r[m]);""===this.options.separator&&(this.options.useGrouping=!1),this.options.prefix||(this.options.prefix=""),this.options.suffix||(this.options.suffix=""),this.d="string"==typeof t?document.getElementById(t):t,this.startVal=Number(a),this.endVal=Number(e),this.countDown=this.startVal>this.endVal,this.frameVal=this.startVal,this.decimals=Math.max(0,n||0),this.dec=Math.pow(10,this.decimals),this.duration=1e3*Number(i)||2e3;var l=this;this.version=function(){return"1.6.0"},this.printValue=function(t){var a=isNaN(t)?"--":l.formatNumber(t);"INPUT"==l.d.tagName?this.d.value=a:"text"==l.d.tagName||"tspan"==l.d.tagName?this.d.textContent=a:this.d.innerHTML=a},this.easeOutExpo=function(t,a,e,n){return e*(-Math.pow(2,-10*t/n)+1)*1024/1023+a},this.count=function(t){l.startTime||(l.startTime=t),l.timestamp=t;var a=t-l.startTime;l.remaining=l.duration-a,l.frameVal=l.options.useEasing?l.countDown?l.startVal-l.easeOutExpo(a,0,l.startVal-l.endVal,l.duration):l.easeOutExpo(a,l.startVal,l.endVal-l.startVal,l.duration):l.countDown?l.startVal-(l.startVal-l.endVal)*(a/l.duration):l.startVal+(l.endVal-l.startVal)*(a/l.duration),l.frameVal=l.countDown?l.frameVal<l.endVal?l.endVal:l.frameVal:l.frameVal>l.endVal?l.endVal:l.frameVal,l.frameVal=Math.round(l.frameVal*l.dec)/l.dec,l.printValue(l.frameVal),a<l.duration?l.rAF=requestAnimationFrame(l.count):l.callback&&l.callback()},this.start=function(t){return l.callback=t,l.rAF=requestAnimationFrame(l.count),!1},this.pauseResume=function(){l.paused?(l.paused=!1,delete l.startTime,l.duration=l.remaining,l.startVal=l.frameVal,requestAnimationFrame(l.count)):(l.paused=!0,cancelAnimationFrame(l.rAF))},this.reset=function(){l.paused=!1,delete l.startTime,l.startVal=a,cancelAnimationFrame(l.rAF),l.printValue(l.startVal)},this.update=function(t){cancelAnimationFrame(l.rAF),l.paused=!1,delete l.startTime,l.startVal=l.frameVal,l.endVal=Number(t),l.countDown=l.startVal>l.endVal,l.rAF=requestAnimationFrame(l.count)},this.formatNumber=function(t){t=t.toFixed(l.decimals),t+="";var a,e,n,i;if(a=t.split("."),e=a[0],n=a.length>1?l.options.decimal+a[1]:"",i=/(\d+)(\d{3})/,l.options.useGrouping)for(;i.test(e);)e=e.replace(i,"$1"+l.options.separator+"$2");return l.options.prefix+e+n+l.options.suffix},l.printValue(l.startVal)};return t}); 575/*! 576Waypoints - 4.0.0 577Copyright © 2011-2015 Caleb Troughton 578Licensed under the MIT license. 579https://github.com/imakewebthings/waypoints/blob/master/licenses.txt 580*/ 581!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");
vendor: 6,526 bytes, line 581
581this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],r
581ight:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.opticStatselement=e(t)}var e=opticStats,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.opticStatselement[i].apply(this.opticStatselement,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;opticStats&&(opticStats.fn.waypoint=t(opticStats)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); 582 583opticStats( document ).ready(function() { 584 var speed = 3000, 585 countNumberstacks_in_84 = "100", 586 decimalNumber = '0', 587 decimalNumber = decimalNumber.replace(/\D/g,''), 588 decimalLength = decimalNumber.length, 589 maxValuePercentstacks_in_84 = (countNumberstacks_in_84/100), 590 speedA = (2000/speed)*maxValuePercentstacks_in_84; 591 if (100 == 0) { 592 if(countNumberstacks_in_84 < 0) { 593 maxValuePercentstacks_in_84 = 1; 594 } else { 595 maxValuePercentstacks_in_84 = (0-countNumberstacks_in_84)/0; 596 } 597 } 598 if('False' == 'False' ) { 599 decimalLength = 0; 600 } else { 601 countNumberstacks_in_84 = countNumberstacks_in_84.replace(/\D/g,''); 602 countNumberstacks_in_84 = countNumberstacks_in_84+"."+decimalNumber; 603 } 604 if('False' == 'True' ) { 605 var items = readData_data(opticStats("#data")); 606 countNumberstacks_in_84 = items['data-A1']; 607 if(countNumberstacks_in_84 == null) { 608 countNumberstacks_in_84 = '0'; 609 } 610 opticStats("#stat_stacks_in_84").data("percent", maxValuePercentstacks_in_84*100); 611 // 612 // 613 if(countNumberstacks_in_84.indexOf(".") !== -1) { 614 decimalNumber = countNumberstacks_in_84.substr(countNumberstacks_in_84.indexOf(".") + 1); 615 decimalNumber = decimalNumber.replace(/\D/g,''); 616 decimalLength = decimalNumber.length; 617 countNumberstacks_in_84 = countNumberstacks_in_84.substr(0, countNumberstacks_in_84.indexOf('.')); 618 } 619 // 620 // 621 countNumberstacks_in_84 = countNumberstacks_in_84.replace(/[^0-9\-]/g,''); 622 countNumberstacks_in_84 = countNumberstacks_in_84+"."+decimalNumber; 623 maxValuePercentstacks_in_84 = (countNumberstacks_in_84/100); 624 if (100 == 0) { 625 if(countNumberstacks_in_84 < 0) { 626 maxValuePercentstacks_in_84 = 1; 627 } else { 628 maxValuePercentstacks_in_84 = (0-countNumberstacks_in_84)/0; 629 } 630 } 631 speedA = (2000/speed)*maxValuePercentstacks_in_84; 632 opticStats("#stat_stacks_in_84").data("percent", maxValuePercentstacks_in_84*100); 633 } else { 634 var maxValuePercentstacks_in_84 = (countNumberstacks_in_84/100); 635 if (100 == 0) { 636 if(countNumberstacks_in_84 < 0) { 637 maxValuePercentstacks_in_84 = 1; 638 } else { 639 maxValuePercentstacks_in_84 = (0-countNumberstacks_in_84)/0; 640 } 641 } 642 speedA = (2000/speed)*maxValuePercentstacks_in_84; 643 opticStats("#stat_stacks_in_84").data("percent", maxValuePercentstacks_in_84*100); 644 } 645 opticStats('#stat_stacks_in_84').attr("data-animationstep", speedA); 646 opticStats('#stat_stacks_in_84').circliful(); 647 opticStats('#stat_stacks_in_84').waypoint(function(direction){ 648 649 // 650// opticStats('#stacks_in_84 .counter').counterUp({ 651// delay: 10, 652// time: speed 653// }); 654 655 var options = { 656 // 657 // 658 separator : ',', 659 decimal : '.', 660 // 661 // 662 // 663 useEasing : false 664 }; 665 opticStats('#stacks_in_84 .counter').attr("id", "count_stacks_in_84"); 666 var count = new CountUp('count_stacks_in_84', 0, countNumberstacks_in_84, decimalLength, (1.9/speedA)*(maxValuePercentstacks_in_84), options);//(1.75/speedA)*(maxValuePercentstacks_in_84) 667 count.start(); 668 // 669 // 670 opticStats('#stat_stacks_in_84 .circle-text').append("%"); 671 opticStats('#stat_stacks_in_84 .circle-text-half').append("%"); 672 // 673 // 674 // 675 // 676 // 677 scale(); 678 this.destroy(); 679 }, { offset: '100%' }); 680 681 682}); 683 684opticStats( window ).resize(function() { 685 scale(); 686}); 687function scale() { 688 var width = 200, 689 currentWidth = opticStats('#stat_stacks_in_84').parent().outerWidth(); 690 if(currentWidth < width) { 691 var scale = currentWidth/width; 692 opticStats('#stat_stacks_in_84').css({ 693 "transform" : "scale("+scale+")", 694 "transform-origin" : "0px", 695 "-o-transform" : "scale("+scale+")", 696 "-o-transform-origin" : "0px" 697 }); 698 } else { 699 opticStats('#stat_stacks_in_84').css({ 700 "transform" : "scale(1)", 701 "-o-transform" : "scale(1)" 702 }); 703 } 704} 705 706return stack;})(stacks.stacks_in_84); 707stacks.stacks_in_165 = {}; 708stacks.stacks_in_165 = (function(stack) { 709var jQuery = stacks.jQuery;var $ = jQuery;var opticStats = $; 710/* 711jquery-plugin-circliful 712+The MIT License (MIT) 713+ 714+Copyright (c) 2014 Patric Gutersohn 715+ 716+Permission is hereby granted, free of charge, to any person obtaining a copy of 717+this software and associated documentation files (the "Software"), to deal in 718+the Software without restriction, including without limitation the rights to 719+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 720+the Software, and to permit persons to whom the Software is furnished to do so, 721+subject to the following conditions: 722+ 723+The above copyright notice and this permission notice shall be included in all 724+copies or substantial portions of the Software. 725+ 726+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 727+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 728+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 729+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 730+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 731+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 732*/ 733"use strict"; 734 735(function (opticStats) { 736 737 opticStats.fn.circliful = function (options, callback) { 738 739 var settings = opticStats.extend({ 740 // These are the defaults. 741 startdegree: 0, 742 fgcolor: "#556b2f", 743 bgcolor: "#eee", 744 fill: false, 745 width: 15, 746 dimension: 200, 747 fontsize: 15, 748 percent: 50, 749 animationstep: 1.0, 750 iconsize: '20px', 751 iconcolor: '#999', 752 border: 'default', 753 complete: null, 754 bordersize: 10 755 }, options); 756 757 return this.each(function () { 758 759 var customSettings = ["fgcolor", "bgcolor", "fill", "width", "dimension", "fontsize", "animationstep", "endPercent", "icon", "iconcolor", "iconsize", "border", "startdegree", "bordersize"]; 760 761 var customSettingsObj = {}; 762 var icon = ''; 763 var percent; 764 var endPercent = 0; 765 var obj = opticStats(this); 766 var fill = false;
767 var text, info; 768 769 obj.addClass('circliful'); 770 771 checkDataAttributes(obj); 772 773 if (obj.data('text') != undefined) { 774 775 //remove non number characters 776 777 text = obj.data('text'); 778 text = text.toString(); 779 text = text.replace(/[^0-9.,]/g, ''); 780 text = "<span class='counter'>" + text + "</span>"; 781 782 if (obj.data('icon') != undefined) { 783 icon = opticStats('<i></i>') 784 .addClass('osIcon fa ' + opticStats(this).data('icon')) 785 .css({ 786 'color': customSettingsObj.iconcolor, 787 'font-size': customSettingsObj.iconsize, 788 'line-height': customSettingsObj.iconsize + "px" 789 }); 790 } 791 if (obj.data('icon-custom') != undefined) { 792 icon = opticStats('<img src="'+opticStats(this).data("icon-custom")+'"></img>') 793 .addClass('osIcon ') 794 .css({ 795 'width': customSettingsObj.iconsize, 796 'height': customSettingsObj.iconsize 797 }); 798 } 799 800 if (obj.data('type') != undefined) { 801 type = opticStats(this).data('type'); 802 803 if (type == 'half') { 804 addCircleText(obj, 'circle-text-half', (customSettingsObj.dimension / 1.45)); 805 } else { 806 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 807 } 808 } else { 809 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 810 } 811 } 812 813 if (opticStats(this).data("total") != undefined && opticStats(this).data("part") != undefined) { 814 var total = opticStats(this).data("total") / 100; 815 816 percent = ((opticStats(this).data("part") / total) / 100).toFixed(3); 817 endPercent = (opticStats(this).data("part") / total).toFixed(3); 818 } else { 819 if (opticStats(this).data("percent") != undefined) { 820 percent = opticStats(this).data("percent") / 100; 821 endPercent = opticStats(this).data("percent"); 822 } else { 823 percent = settings.percent / 100; 824 } 825 } 826 827 if (opticStats(this).data('info') != undefined) { 828 info = opticStats(this).data('info'); 829 830 if (opticStats(this).data('type') != undefined) { 831 type = opticStats(this).data('type'); 832 833 if (type == 'half') { 834 addInfoText(obj, 0.9); 835 } else { 836 addInfoText(obj, 1.25); 837 } 838 } else { 839 addInfoText(obj, 1.25); 840 } 841 } 842 843 opticStats(this).width(customSettingsObj.dimension + 'px'); 844 if (type == 'line' || type == 'vert-line') { 845 opticStats(this).height(opticStats(this).data('height') + 'px'); 846 } else { 847 opticStats(this).height(customSettingsObj.dimension + 'px'); 848 } 849 850 851 var sizeX = customSettingsObj.dimension, 852 sizeY = customSettingsObj.dimension; 853 if (type == 'line' || type == 'vert-line') { 854 sizeY = opticStats(this).data('height'); 855 } 856 var canvas = opticStats('<canvas></canvas>').attr({ 857 width: sizeX, 858 height: sizeY 859 }).appendTo(opticStats(this)).get(0); 860 var context = canvas.getContext('2d'); 861 862 var dpr = window.devicePixelRatio; 863 if ( dpr ) { 864 var opticStatscanvas = opticStats(canvas); 865 opticStatscanvas.css('width', sizeX); 866 opticStatscanvas.css('height', sizeY); 867 opticStatscanvas.attr('width', sizeX * dpr); 868 opticStatscanvas.attr('height', sizeY * dpr); 869 870 context.scale(dpr, dpr); 871 } 872 873 var container = opticStats(canvas).parent(); 874 var x = sizeX / 2; 875 var y = sizeY / 2; 876 var degrees = customSettingsObj.percent * 360.0; 877 var radians = degrees * (Math.PI / 180); 878 var radius = sizeX / 2.5; 879 var startAngle = 2.3 * Math.PI; 880 var endAngle = 0; 881 var counterClockwise = false; 882 var curPerc = customSettingsObj.animationstep === 0.0 ? endPercent : 0.0; 883 var curStep = Math.max(customSettingsObj.animationstep, 0.0); 884 var circ = Math.PI * 2; 885 var quart = Math.PI / 2; 886 var type = ''; 887 var fireCallback = true; 888 var additionalAngelPI = (customSettingsObj.startdegree / 180) * Math.PI; 889 890 if (opticStats(this).data('type') != undefined) { 891 type = opticStats(this).data('type'); 892 if (type == 'half') { 893 startAngle = 2.0 * Math.PI; 894 endAngle = 3.14; 895 circ = Math.PI; 896 quart = Math.PI / 0.996; 897 } else if (type == 'angle') { 898 startAngle = 2.25 * Math.PI; 899 endAngle = 2.4; 900 circ = 1.53 + Math.PI; 901 quart = 0.73 + Math.PI / 0.996; 902 } 903 } 904 905 /** 906 * adds text to circle 907 * 908 * @param obj 909 * @param cssClass 910 * @param lineHeight 911 */ 912 opticStats(" > span", this).wrapAll("<div class='centerMe'><div></div></div>"); 913 function addCircleText(obj, cssClass, lineHeight) { 914 opticStats("<span></span>") 915 .appendTo(obj) 916 .addClass(cssClass) 917 .html(text) 918 .prepend(icon) 919 .css({ 920 //'line-height': lineHeight + 'px', 921 'font-size': customSettingsObj.fontsize + 'px', 922 'line-height': customSettingsObj.fontsize + 'px' 923 }); 924 } 925 926 /** 927 * adds info text to circle 928 * 929 * @param obj 930 * @param factor 931 */ 932 function addInfoText(obj, factor) { 933 opticStats('<span></span>') 934 .appendTo(obj) 935 .addClass('circle-info-half') 936 //.css( 937 //'line-height', (customSettingsObj.dimension * factor) + 'px' 938 //) 939 .text(info); 940 } 941 942 /** 943 * checks which data attributes are defined 944 * @param obj 945 */ 946 function checkDataAttributes(obj) { 947 opticStats.each(customSettings, function (index, attribute) { 948 if (obj.data(attribute) != undefined) { 949 customSettingsObj[attribute] = obj.data(attribute); 950 } else { 951 customSettingsObj[attribute] = opticStats(settings).attr(attribute); 952 } 953 954 if (attribute == 'fill' && obj.data('fill') != undefined) { 955 fill = true; 956 } 957 }); 958 } 959 960 //Animation Variables 961 var inc = 0, counter=0,calm = 2,finishFrames=0, animationType = obj.data('animation-type'), slowTheInc = 0; 962 // ---------------------- // 963 // Animation Functions 964 // ---------------------- // 965 function blend(inColor,outColor,current){ 966 var inColors = inColor.substring(inColor.indexOf('(') + 1, inColor.lastIndexOf(')')).split(/,\s*/), 967 outColors = outColor.substring(outColor.indexOf('(') + 1, outColor.lastIndexOf(')')).split(/,\s*/), 968 r,g,b,a,cur; 969 for(var i=0; i<inColors.length; i++) { inColors[i] = parseInt(inColors[i], 10); } 970 for(var i=0; i<outColors.length; i++) { outColors[i] = parseInt(outColors[i], 10); } 971 if(current < .5 ) { 972 cur = current*2; 973 r = Math.min(255,Math.max(0, inColors[0] + (outColors[0] * cur))); 974 g = Math.min(255,Math.max(0, inColors[1] + (outColors[1] * cur))); 975 b = Math.min(255,Math.max(0, inColors[2] + (outColors[2] * cur))); 976 } else { 977 cur = (current-.5)*2; 978 r = Math.min(255,Math.max(0,Math.max(inColors[0], outColors[0]) + ((outColors[0] - inColors[0]) * cur))); 979 g = Math.min(255,Math.max(0,Math.max(inColors[1], outColors[1]) + ((outColors[1] - inColors[1]) * cur))); 980 b = Math.min(255,Math.max(0,Math.max(inColors[2], outColors[2]) + ((outColors[2] - inColors[2]) * cur))); 981 } 982 var a = inColors[3]+((outColors[3] - inColors[3])*current);
983 return 'rgba('+Math.floor(r)+', '+Math.floor(g)+', '+Math.floor(b)+', '+Math.floor(a)+')'; 984 } 985 if (type == 'line' || type == 'vert-line') { 986 customSettingsObj.bordersize = customSettingsObj.bordersize*2; 987 } 988 var increaseInc = function(inc, current) { 989 if (current >= 1) { 990 // slowTheInc += 0.00002; 991 // slowTheInc = Math.min(slowTheInc, 0.005); 992 // inc = inc + (0.005-slowTheInc); 993 } else { 994 inc += 0.005; 995 } 996 return inc; 997 } 998 var moveColors = function(value, inc) { 999 var pos = value+inc; 1000 pos = pos.toString(); 1001 pos = pos.split(".").pop(); 1002 pos = parseFloat("."+pos); 1003 return pos; 1004 } 1005 var createGrad = function(inc,sizeX, sizeY) { 1006 var grd=context.createLinearGradient(0,0,sizeX,sizeY); 1007 grd.addColorStop(moveColors(0, inc),"#FF0000"); 1008 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 1009 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 1010 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 1011 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 1012 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 1013 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 1014 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 1015 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 1016 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 1017 grd.addColorStop(moveColors(1, inc),"#FF0000"); 1018 return grd; 1019 } 1020 var shadowGlow = function() { 1021 context.shadowColor = customSettingsObj.fgcolor; 1022 context.shadowOffsetX = 0; 1023 context.shadowOffsetY = 0; 1024 context.shadowBlur = 10; 1025 } 1026 var drawBorder = function() { 1027 context.lineWidth = customSettingsObj.bordersize + 1; 1028 context.strokeStyle = customSettingsObj.bgcolor; 1029 context.stroke(); 1030 if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle') { 1031 // 1032 } else { 1033 context.fillStyle = customSettingsObj.fill; 1034 context.fill(); 1035 } 1036 context.beginPath(); 1037 context.save(); 1038 } 1039 var fillAnimation = function(animationType, current) { 1040 if(animationType == 1){ 1041 context.strokeStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 1042 context.stroke(); 1043 } else if(animationType == 2){ 1044 context.strokeStyle = customSettingsObj.fgcolor; 1045 if (type == 'line') { 1046 var grd=context.createLinearGradient(sizeX,0,0,0); 1047 grd.addColorStop(0,"white"); 1048 grd.addColorStop(1,customSettingsObj.fgcolor); 1049 context.strokeStyle = grd; 1050 shadowGlow(); 1051 } else if (type == 'vert-line') { 1052 var grd=context.createLinearGradient(0,0,0,sizeY); 1053 grd.addColorStop(0,"white"); 1054 grd.addColorStop(1,customSettingsObj.fgcolor); 1055 context.strokeStyle = grd; 1056 shadowGlow(); 1057 } else { 1058 var grd = context.createRadialGradient(sizeX/2, sizeY/2, (sizeX+customSettingsObj.bordersize*2)/2.5, sizeY/2, sizeX/2, (sizeY-customSettingsObj.bordersize*2)/2.5); 1059 grd.addColorStop(0, customSettingsObj.fgcolor); 1060 grd.addColorStop(0.5, 'white'); 1061 grd.addColorStop(1, customSettingsObj.fgcolor); 1062 context.strokeStyle = grd; 1063 shadowGlow(); 1064 } 1065 context.stroke(); 1066 context.restore(); 1067 } else if(animationType == 3){ 1068 if (type == 'line') { 1069 var grd = createGrad(inc,sizeX,sizeY); 1070 inc = increaseInc(inc,current); 1071 context.strokeStyle = grd; 1072 } else if (type == 'vert-line') { 1073 var grd=context.createLinearGradient(sizeX/2,0,sizeX/2,sizeY); 1074 grd.addColorStop(moveColors(0, inc),"#FF0000"); 1075 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 1076 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 1077 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 1078 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 1079 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 1080 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 1081 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 1082 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 1083 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 1084 grd.addColorStop(moveColors(1, inc),"#FF0000"); 1085 inc = increaseInc(inc,current); 1086 context.strokeStyle = grd; 1087 } else { 1088 var grd = createGrad(inc,sizeX,sizeY); 1089 inc = increaseInc(inc,current); 1090 context.strokeStyle = grd; 1091 } 1092 context.stroke();
1093 context.restore(); 1094 } else { 1095 context.strokeStyle = customSettingsObj.fgcolor; 1096 context.stroke(); 1097 } 1098 } 1099 // ---------------------- // 1100 // Animation 1101 // ---------------------- // 1102 function animate(current) { 1103 //Clear Canvas for next frame 1104 context.clearRect(0, 0, canvas.width, canvas.height); 1105 //Draw Background 1106 if (type == 'line' || type == 'vert-line') { 1107 context.rect(10, 10, sizeX-20, sizeY-20); 1108 } else if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle' || type == 'full' || type == 'half') { 1109 context.beginPath(); 1110 context.arc(x, y, radius, endAngle, startAngle, false); 1111 } 1112 context.fillStyle = customSettingsObj.fill; 1113 context.fill(); 1114 if (type == 'line') { 1115 context.beginPath(); 1116 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 1117 context.lineTo(sizeX-10,sizeY-(customSettingsObj.bordersize/2+10)); 1118 drawBorder(); 1119 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 1120 context.lineTo(Math.min((sizeX-20) * current+10,sizeX-10),sizeY-(customSettingsObj.bordersize/2+10)); 1121 fillAnimation(animationType,current); 1122 } else if (type == 'vert-line'){ 1123 context.beginPath(); 1124 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 1125 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),10); 1126 drawBorder(); 1127 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 1128 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),Math.max((sizeY-20) * (1-current)+10,10)); 1129 fillAnimation(animationType,current); 1130 } else if (type == 'full' || type=='half') { 1131 drawBorder(); 1132 context.arc(x, y, radius, -(quart) + additionalAngelPI, ((circ) * (Math.min(current,1)+.005)) - quart + additionalAngelPI, false); 1133 fillAnimation(animationType,current); 1134 } else if (type == 'grow-circle') { 1135 drawBorder(); 1136 var fillRadius = sizeX/2.5*Math.min(current,1); 1137 context.arc(sizeX/2, sizeY/2, Math.max(fillRadius-customSettingsObj.bordersize/2,0), endAngle, startAngle, false); 1138 if(animationType == 1){ 1139 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 1140 context.fill(); 1141 } else if(animationType == 2){ 1142 var grd=context.createLinearGradient(0,0,0,sizeY); 1143 grd.addColorStop(0,"white"); 1144 grd.addColorStop(1,customSettingsObj.fgcolor); 1145 shadowGlow(); 1146 context.fillStyle = grd; 1147 context.fill(); 1148 } else if(animationType == 3){ 1149 var grd = createGrad(inc,sizeX,sizeY); 1150 inc = increaseInc(inc,current); 1151 context.fillStyle = grd; 1152 context.fill(); 1153 } else { 1154 context.fillStyle = customSettingsObj.fgcolor; 1155 context.fill(); 1156 } 1157 context.restore(); 1158 } else if (type == 'fill-circle') { 1159 drawBorder(); 1160 var fillRadius = sizeX/2.5, 1161 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 1162 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 1163 if(animationType == 1){ 1164 context.clip(); 1165 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 1166 context.fillRect(0, fillLine, sizeX, sizeY); 1167 } else if(animationType == 2){ 1168 var grd=context.createLinearGradient(0,0,0,sizeY); 1169 grd.addColorStop(0,"white"); 1170 grd.addColorStop(1,customSettingsObj.fgcolor); 1171 shadowGlow(); 1172 context.clip(); 1173 context.fillStyle = grd; 1174 context.fillRect(0, fillLine, sizeX, sizeY); 1175 1176 } else if(animationType == 3){ 1177 context.clip(); 1178 var grd = createGrad(inc,sizeX, sizeY); 1179 inc = increaseInc(inc,current); 1180 context.fillStyle = grd; 1181 context.fillRect(0, fillLine, sizeX, sizeY); 1182 } else { 1183 context.clip(); 1184 context.fillStyle = customSettingsObj.fgcolor; 1185 context.fillRect(0, fillLine, sizeX, sizeY); 1186 }
1187 context.restore(); 1188 } else if (type == 'fill-circle-wave') { 1189 drawBorder(); 1190 var fillRadius = sizeX/2.5, 1191 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 1192 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 1193 var ypos=fillLine, xpos=0; 1194 counter += .1; 1195 counterLoop = counter; 1196 var increase = 2*Math.PI / 12; 1197 context.clip(); 1198 context.beginPath(); 1199 context.moveTo(sizeX,sizeY); 1200 context.lineTo(0,sizeY); 1201 context.lineTo(0,ypos); 1202 if (curPerc > endPercent) { 1203 calm-=.01; 1204 if(calm<0) calm=0; 1205 } 1206 for(i=0; i<=sizeX; i+=10){ 1207 xpos = i; 1208 ypos = ypos - Math.sin(counterLoop) * calm; 1209 counterLoop += increase; 1210 context.lineTo(xpos,ypos); 1211 } 1212 context.lineTo(sizeX,sizeY); 1213 context.closePath(); 1214 if(animationType == 1){ 1215 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 1216 context.fill(); 1217 } else if(animationType == 2){ 1218 var grd=context.createLinearGradient(0,0,0,sizeY); 1219 grd.addColorStop(0,"white"); 1220 grd.addColorStop(1,customSettingsObj.fgcolor); 1221 shadowGlow(); 1222 context.clip(); 1223 context.fillStyle = grd; 1224 context.fill(); 1225 } else if(animationType == 3){ 1226 context.clip(); 1227 var grd = createGrad(inc,sizeX,sizeY); 1228 inc = increaseInc(inc,current); 1229 context.fillStyle = grd; 1230 context.fill(); 1231 } else { 1232 context.clip(); 1233 context.fillStyle = customSettingsObj.fgcolor; 1234 context.fill(); 1235 } 1236 context.restore(); 1237 } 1238 1239 if (curPerc < endPercent) { 1240 curPerc += curStep; 1241 requestAnimationFrame(function () { 1242 context.strokeStyle = customSettingsObj.fgcolor; 1243 animate(Math.min(curPerc, endPercent) / 100); 1244 }, obj); 1245 } else if(finishFrames < 500) { 1246 curPerc += curStep; 1247 finishFrames+=1; 1248 requestAnimationFrame(function () { 1249 context.strokeStyle = customSettingsObj.fgcolor; 1250 animate(Math.min(curPerc, endPercent) / 100); 1251 }, obj); 1252 } 1253 1254 if (curPerc == endPercent && fireCallback && typeof(options) != "undefined") { 1255 if (opticStats.isFunction(options.complete)) { 1256 options.complete(); 1257 1258 fireCallback = false; 1259 } 1260 } 1261 } 1262 obj.waypoint(function(direction){ 1263 animate(curPerc / 100); 1264 this.destroy(); 1265 }, { offset: '100%' }); 1266 }); 1267 }; 1268}(opticStats)); 1269/* 1270 The MIT License (MIT) 1271 CountUp 1272+Copyright (c) 2014-2015 Jamie Perkins 1273 Permission is hereby granted, free of charge, to any person obtaining a copy of 1274 this software and associated documentation files (the "Software"), to deal in 1275*/ 1276!function(t,a){"function"==typeof define&&define.amd?define(a):"object"==typeof exports?module.exports=a(require,exports,module):t.CountUp=a()}(this,function(){var t=function(t,a,e,n,i,r){for(var o=0,s=["webkit","moz","ms","o"],u=0;u<s.length&&!window.requestAnimationFrame;++u)window.requestAnimationFrame=window[s[u]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[s[u]+"CancelAnimationFrame"]||window[s[u]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var a=(new Date).getTime(),e=Math.max(0,16-(a-o)),n=window.setTimeout(function(){t(a+e)},e);return o=a+e,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),this.options={useEasing:!0,useGrouping:!0,separator:",",decimal:"."};for(var m in r)r.hasOwnProperty(m)&&(this.options[m]=r[m]);""===this.options.separator&&(this.options.useGrouping=!1),this.options.prefix||(this.options.prefix=""),this.options.suffix||(this.options.suffix=""),this.d="string"==typeof t?document.getElementById(t):t,this.startVal=Number(a),this.endVal=Number(e),this.countDown=this.startVal>this.endVal,this.frameVal=this.startVal,this.decimals=Math.max(0,n||0),this.dec=Math.pow(10,this.decimals),this.duration=1e3*Number(i)||2e3;var l=this;this.version=function(){return"1.6.0"},this.printValue=function(t){var a=isNaN(t)?"--":l.formatNumber(t);"INPUT"==l.d.tagName?this.d.value=a:"text"==l.d.tagName||"tspan"==l.d.tagName?this.d.textContent=a:this.d.innerHTML=a},this.easeOutExpo=function(t,a,e,n){return e*(-Math.pow(2,-10*t/n)+1)*1024/1023+a},this.count=function(t){l.startTime||(l.startTime=t),l.timestamp=t;var a=t-l.startTime;l.remaining=l.duration-a,l.frameVal=l.options.useEasing?l.countDown?l.startVal-l.easeOutExpo(a,0,l.startVal-l.endVal,l.duration):l.easeOutExpo(a,l.startVal,l.endVal-l.startVal,l.duration):l.countDown?l.startVal-(l.startVal-l.endVal)*(a/l.duration):l.startVal+(l.endVal-l.startVal)*(a/l.duration),l.frameVal=l.countDown?l.frameVal<l.endVal?l.endVal:l.frameVal:l.frameVal>l.endVal?l.endVal:l.frameVal,l.frameVal=Math.round(l.frameVal*l.dec)/l.dec,l.printValue(l.frameVal),a<l.duration?l.rAF=requestAnimationFrame(l.count):l.callback&&l.callback()},this.start=function(t){return l.callback=t,l.rAF=requestAnimationFrame(l.count),!1},this.pauseResume=function(){l.paused?(l.paused=!1,delete l.startTime,l.duration=l.remaining,l.startVal=l.frameVal,requestAnimationFrame(l.count)):(l.paused=!0,cancelAnimationFrame(l.rAF))},this.reset=function(){l.paused=!1,delete l.startTime,l.startVal=a,cancelAnimationFrame(l.rAF),l.printValue(l.startVal)},this.update=function(t){cancelAnimationFrame(l.rAF),l.paused=!1,delete l.startTime,l.startVal=l.frameVal,l.endVal=Number(t),l.countDown=l.startVal>l.endVal,l.rAF=requestAnimationFrame(l.count)},this.formatNumber=function(t){t=t.toFixed(l.decimals),t+="";var a,e,n,i;if(a=t.split("."),e=a[0],n=a.length>1?l.options.decimal+a[1]:"",i=/(\d+)(\d{3})/,l.options.useGrouping)for(;i.test(e);)e=e.replace(i,"$1"+l.options.separator+"$2");return l.options.prefix+e+n+l.options.suffix},l.printValue(l.startVal)};return t}); 1277/*! 1278Waypoints - 4.0.0 1279Copyright © 2011-2015 Caleb Troughton 1280Licensed under the MIT license. 1281https://github.com/imakewebthings/waypoints/blob/master/licenses.txt 1282*/ 1283!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");
vendor: 6,526 bytes, line 1283
1283this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],r
1283ight:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.opticStatselement=e(t)}var e=opticStats,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.opticStatselement[i].apply(this.opticStatselement,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;opticStats&&(opticStats.fn.waypoint=t(opticStats)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); 1284 1285opticStats( document ).ready(function() { 1286 var speed = 3000, 1287 countNumberstacks_in_165 = "98", 1288 decimalNumber = '0', 1289 decimalNumber = decimalNumber.replace(/\D/g,''), 1290 decimalLength = decimalNumber.length, 1291 maxValuePercentstacks_in_165 = (countNumberstacks_in_165/100), 1292 speedA = (2000/speed)*maxValuePercentstacks_in_165; 1293 if (100 == 0) { 1294 if(countNumberstacks_in_165 < 0) { 1295 maxValuePercentstacks_in_165 = 1; 1296 } else { 1297 maxValuePercentstacks_in_165 = (0-countNumberstacks_in_165)/0; 1298 } 1299 } 1300 if('False' == 'False' ) { 1301 decimalLength = 0; 1302 } else { 1303 countNumberstacks_in_165 = countNumberstacks_in_165.replace(/\D/g,''); 1304 countNumberstacks_in_165 = countNumberstacks_in_165+"."+decimalNumber; 1305 } 1306 if('False' == 'True' ) { 1307 var items = readData_data(opticStats("#data")); 1308 countNumberstacks_in_165 = items['data-A1']; 1309 if(countNumberstacks_in_165 == null) { 1310 countNumberstacks_in_165 = '0'; 1311 } 1312 opticStats("#stat_stacks_in_165").data("percent", maxValuePercentstacks_in_165*100); 1313 // 1314 // 1315 if(countNumberstacks_in_165.indexOf(".") !== -1) { 1316 decimalNumber = countNumberstacks_in_165.substr(countNumberstacks_in_165.indexOf(".") + 1); 1317 decimalNumber = decimalNumber.replace(/\D/g,''); 1318 decimalLength = decimalNumber.length; 1319 countNumberstacks_in_165 = countNumberstacks_in_165.substr(0, countNumberstacks_in_165.indexOf('.')); 1320 } 1321 // 1322 // 1323 countNumberstacks_in_165 = countNumberstacks_in_165.replace(/[^0-9\-]/g,''); 1324 countNumberstacks_in_165 = countNumberstacks_in_165+"."+decimalNumber; 1325 maxValuePercentstacks_in_165 = (countNumberstacks_in_165/100); 1326 if (100 == 0) { 1327 if(countNumberstacks_in_165 < 0) { 1328 maxValuePercentstacks_in_165 = 1; 1329 } else { 1330 maxValuePercentstacks_in_165 = (0-countNumberstacks_in_165)/0; 1331 } 1332 } 1333 speedA = (2000/speed)*maxValuePercentstacks_in_165; 1334 opticStats("#stat_stacks_in_165").data("percent", maxValuePercentstacks_in_165*100); 1335 } else { 1336 var maxValuePercentstacks_in_165 = (countNumberstacks_in_165/100); 1337 if (100 == 0) { 1338 if(countNumberstacks_in_165 < 0) { 1339 maxValuePercentstacks_in_165 = 1; 1340 } else { 1341 maxValuePercentstacks_in_165 = (0-countNumberstacks_in_165)/0; 1342 } 1343 } 1344 speedA = (2000/speed)*maxValuePercentstacks_in_165; 1345 opticStats("#stat_stacks_in_165").data("percent", maxValuePercentstacks_in_165*100); 1346 } 1347 opticStats('#stat_stacks_in_165').attr("data-animationstep", speedA); 1348 opticStats('#stat_stacks_in_165').circliful(); 1349 opticStats('#stat_stacks_in_165').waypoint(function(direction){ 1350 1351 // 1352// opticStats('#stacks_in_165 .counter').counterUp({ 1353// delay: 10, 1354// time: speed 1355// }); 1356 1357 var options = { 1358 // 1359 // 1360 separator : ',', 1361 decimal : '.', 1362 // 1363 // 1364 // 1365 useEasing : false 1366 }; 1367 opticStats('#stacks_in_165 .counter').attr("id", "count_stacks_in_165"); 1368 var count = new CountUp('count_stacks_in_165', 0, countNumberstacks_in_165, decimalLength, (1.9/speedA)*(maxValuePercentstacks_in_165), options);//(1.75/speedA)*(maxValuePercentstacks_in_165) 1369 count.start(); 1370 // 1371 //
1372 opticStats('#stat_stacks_in_165 .circle-text').append("%"); 1373 opticStats('#stat_stacks_in_165 .circle-text-half').append("%"); 1374 // 1375 // 1376 // 1377 // 1378 // 1379 scale(); 1380 this.destroy(); 1381 }, { offset: '100%' }); 1382 1383 1384}); 1385 1386opticStats( window ).resize(function() { 1387 scale(); 1388}); 1389function scale() { 1390 var width = 200, 1391 currentWidth = opticStats('#stat_stacks_in_165').parent().outerWidth(); 1392 if(currentWidth < width) { 1393 var scale = currentWidth/width; 1394 opticStats('#stat_stacks_in_165').css({ 1395 "transform" : "scale("+scale+")", 1396 "transform-origin" : "0px", 1397 "-o-transform" : "scale("+scale+")", 1398 "-o-transform-origin" : "0px" 1399 }); 1400 } else { 1401 opticStats('#stat_stacks_in_165').css({ 1402 "transform" : "scale(1)", 1403 "-o-transform" : "scale(1)" 1404 }); 1405 } 1406} 1407 1408return stack;})(stacks.stacks_in_165); 1409stacks.stacks_in_85 = {}; 1410stacks.stacks_in_85 = (function(stack) { 1411var jQuery = stacks.jQuery;var $ = jQuery;var opticStats = $; 1412/* 1413jquery-plugin-circliful 1414+The MIT License (MIT) 1415+ 1416+Copyright (c) 2014 Patric Gutersohn 1417+ 1418+Permission is hereby granted, free of charge, to any person obtaining a copy of 1419+this software and associated documentation files (the "Software"), to deal in 1420+the Software without restriction, including without limitation the rights to 1421+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 1422+the Software, and to permit persons to whom the Software is furnished to do so, 1423+subject to the following conditions: 1424+ 1425+The above copyright notice and this permission notice shall be included in all 1426+copies or substantial portions of the Software. 1427+ 1428+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1429+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 1430+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 1431+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 1432+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 1433+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 1434*/ 1435"use strict"; 1436 1437(function (opticStats) { 1438 1439 opticStats.fn.circliful = function (options, callback) { 1440 1441 var settings = opticStats.extend({ 1442 // These are the defaults. 1443 startdegree: 0, 1444 fgcolor: "#556b2f", 1445 bgcolor: "#eee", 1446 fill: false, 1447 width: 15, 1448 dimension: 200, 1449 fontsize: 15, 1450 percent: 50, 1451 animationstep: 1.0, 1452 iconsize: '20px', 1453 iconcolor: '#999', 1454 border: 'default', 1455 complete: null, 1456 bordersize: 10 1457 }, options); 1458 1459 return this.each(function () { 1460 1461 var customSettings = ["fgcolor", "bgcolor", "fill", "width", "dimension", "fontsize", "animationstep", "endPercent", "icon", "iconcolor", "iconsize", "border", "startdegree", "bordersize"]; 1462 1463 var customSettingsObj = {}; 1464 var icon = ''; 1465 var percent; 1466 var endPercent = 0; 1467 var obj = opticStats(this); 1468 var fill = false; 1469 var text, info; 1470 1471 obj.addClass('circliful'); 1472 1473 checkDataAttributes(obj); 1474 1475 if (obj.data('text') != undefined) { 1476 1477 //remove non number characters 1478 1479 text = obj.data('text'); 1480 text = text.toString(); 1481 text = text.replace(/[^0-9.,]/g, ''); 1482 text = "<span class='counter'>" + text + "</span>"; 1483 1484 if (obj.data('icon') != undefined) { 1485 icon = opticStats('<i></i>') 1486 .addClass('osIcon fa ' + opticStats(this).data('icon')) 1487 .css({ 1488 'color': customSettingsObj.iconcolor, 1489 'font-size': customSettingsObj.iconsize, 1490 'line-height': customSettingsObj.iconsize + "px" 1491 }); 1492 } 1493 if (obj.data('icon-custom') != undefined) { 1494 icon = opticStats('<img src="'+opticStats(this).data("icon-custom")+'"></img>') 1495 .addClass('osIcon ') 1496 .css({ 1497 'width': customSettingsObj.iconsize, 1498 'height': customSettingsObj.iconsize 1499 }); 1500 } 1501 1502 if (obj.data('type') != undefined) { 1503 type = opticStats(this).data('type'); 1504 1505 if (type == 'half') { 1506 addCircleText(obj, 'circle-text-half', (customSettingsObj.dimension / 1.45)); 1507 } else { 1508 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 1509 } 1510 } else { 1511 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 1512 } 1513 } 1514 1515 if (opticStats(this).data("total") != undefined && opticStats(this).data("part") != undefined) { 1516 var total = opticStats(this).data("total") / 100; 1517 1518 percent = ((opticStats(this).data("part") / total) / 100).toFixed(3); 1519 endPercent = (opticStats(this).data("part") / total).toFixed(3); 1520 } else { 1521 if (opticStats(this).data("percent") != undefined) { 1522 percent = opticStats(this).data("percent") / 100; 1523 endPercent = opticStats(this).data("percent"); 1524 } else { 1525 percent = settings.percent / 100; 1526 } 1527 } 1528 1529 if (opticStats(this).data('info') != undefined) { 1530 info = opticStats(this).data('info'); 1531 1532 if (opticStats(this).data('type') != undefined) { 1533 type = opticStats(this).data('type'); 1534 1535 if (type == 'half') { 1536 addInfoText(obj, 0.9); 1537 } else { 1538 addInfoText(obj, 1.25); 1539 } 1540 } else { 1541 addInfoText(obj, 1.25); 1542 } 1543 } 1544 1545 opticStats(this).width(customSettingsObj.dimension + 'px'); 1546 if (type == 'line' || type == 'vert-line') { 1547 opticStats(this).height(opticStats(this).data('height') + 'px'); 1548 } else { 1549 opticStats(this).height(customSettingsObj.dimension + 'px'); 1550 } 1551 1552 1553 var sizeX = customSettingsObj.dimension, 1554 sizeY = customSettingsObj.dimension; 1555 if (type == 'line' || type == 'vert-line') { 1556 sizeY = opticStats(this).data('height'); 1557 } 1558 var canvas = opticStats('<canvas></canvas>').attr({ 1559 width: sizeX, 1560 height: sizeY 1561 }).appendTo(opticStats(this)).get(0); 1562 var context = canvas.getContext('2d'); 1563 1564 var dpr = window.devicePixelRatio; 1565 if ( dpr ) { 1566 var opticStatscanvas = opticStats(canvas); 1567 opticStatscanvas.css('width', sizeX); 1568 opticStatscanvas.css('height', sizeY); 1569 opticStatscanvas.attr('width', sizeX * dpr); 1570 opticStatscanvas.attr('height', sizeY * dpr); 1571 1572 context.scale(dpr, dpr); 1573 } 1574 1575 var container = opticStats(canvas).parent(); 1576 var x = sizeX / 2; 1577 var y = sizeY / 2; 1578 var degrees = customSettingsObj.percent * 360.0; 1579 var radians = degrees * (Math.PI / 180); 1580 var radius = sizeX / 2.5; 1581 var startAngle = 2.3 * Math.PI; 1582 var endAngle = 0; 1583 var counterClockwise = false;
1584 var curPerc = customSettingsObj.animationstep === 0.0 ? endPercent : 0.0; 1585 var curStep = Math.max(customSettingsObj.animationstep, 0.0); 1586 var circ = Math.PI * 2; 1587 var quart = Math.PI / 2; 1588 var type = ''; 1589 var fireCallback = true; 1590 var additionalAngelPI = (customSettingsObj.startdegree / 180) * Math.PI; 1591 1592 if (opticStats(this).data('type') != undefined) { 1593 type = opticStats(this).data('type'); 1594 if (type == 'half') { 1595 startAngle = 2.0 * Math.PI; 1596 endAngle = 3.14; 1597 circ = Math.PI; 1598 quart = Math.PI / 0.996; 1599 } else if (type == 'angle') { 1600 startAngle = 2.25 * Math.PI; 1601 endAngle = 2.4; 1602 circ = 1.53 + Math.PI; 1603 quart = 0.73 + Math.PI / 0.996; 1604 } 1605 } 1606 1607 /** 1608 * adds text to circle 1609 * 1610 * @param obj 1611 * @param cssClass 1612 * @param lineHeight 1613 */ 1614 opticStats(" > span", this).wrapAll("<div class='centerMe'><div></div></div>"); 1615 function addCircleText(obj, cssClass, lineHeight) { 1616 opticStats("<span></span>") 1617 .appendTo(obj) 1618 .addClass(cssClass) 1619 .html(text) 1620 .prepend(icon) 1621 .css({ 1622 //'line-height': lineHeight + 'px', 1623 'font-size': customSettingsObj.fontsize + 'px', 1624 'line-height': customSettingsObj.fontsize + 'px' 1625 }); 1626 } 1627 1628 /** 1629 * adds info text to circle 1630 * 1631 * @param obj 1632 * @param factor 1633 */ 1634 function addInfoText(obj, factor) { 1635 opticStats('<span></span>') 1636 .appendTo(obj) 1637 .addClass('circle-info-half') 1638 //.css( 1639 //'line-height', (customSettingsObj.dimension * factor) + 'px' 1640 //) 1641 .text(info); 1642 } 1643 1644 /** 1645 * checks which data attributes are defined 1646 * @param obj 1647 */ 1648 function checkDataAttributes(obj) { 1649 opticStats.each(customSettings, function (index, attribute) { 1650 if (obj.data(attribute) != undefined) { 1651 customSettingsObj[attribute] = obj.data(attribute); 1652 } else { 1653 customSettingsObj[attribute] = opticStats(settings).attr(attribute); 1654 } 1655 1656 if (attribute == 'fill' && obj.data('fill') != undefined) { 1657 fill = true; 1658 } 1659 }); 1660 } 1661 1662 //Animation Variables 1663 var inc = 0, counter=0,calm = 2,finishFrames=0, animationType = obj.data('animation-type'), slowTheInc = 0; 1664 // ---------------------- // 1665 // Animation Functions 1666 // ---------------------- // 1667 function blend(inColor,outColor,current){ 1668 var inColors = inColor.substring(inColor.indexOf('(') + 1, inColor.lastIndexOf(')')).split(/,\s*/), 1669 outColors = outColor.substring(outColor.indexOf('(') + 1, outColor.lastIndexOf(')')).split(/,\s*/), 1670 r,g,b,a,cur; 1671 for(var i=0; i<inColors.length; i++) { inColors[i] = parseInt(inColors[i], 10); } 1672 for(var i=0; i<outColors.length; i++) { outColors[i] = parseInt(outColors[i], 10); } 1673 if(current < .5 ) { 1674 cur = current*2; 1675 r = Math.min(255,Math.max(0, inColors[0] + (outColors[0] * cur))); 1676 g = Math.min(255,Math.max(0, inColors[1] + (outColors[1] * cur))); 1677 b = Math.min(255,Math.max(0, inColors[2] + (outColors[2] * cur))); 1678 } else { 1679 cur = (current-.5)*2; 1680 r = Math.min(255,Math.max(0,Math.max(inColors[0], outColors[0]) + ((outColors[0] - inColors[0]) * cur))); 1681 g = Math.min(255,Math.max(0,Math.max(inColors[1], outColors[1]) + ((outColors[1] - inColors[1]) * cur))); 1682 b = Math.min(255,Math.max(0,Math.max(inColors[2], outColors[2]) + ((outColors[2] - inColors[2]) * cur))); 1683 } 1684 var a = inColors[3]+((outColors[3] - inColors[3])*current); 1685 return 'rgba('+Math.floor(r)+', '+Math.floor(g)+', '+Math.floor(b)+', '+Math.floor(a)+')'; 1686 } 1687 if (type == 'line' || type == 'vert-line') { 1688 customSettingsObj.bordersize = customSettingsObj.bordersize*2; 1689 } 1690 var increaseInc = function(inc, current) { 1691 if (current >= 1) { 1692 // slowTheInc += 0.00002; 1693 // slowTheInc = Math.min(slowTheInc, 0.005); 1694 // inc = inc + (0.005-slowTheInc); 1695 } else { 1696 inc += 0.005; 1697 } 1698 return inc; 1699 } 1700 var moveColors = function(value, inc) { 1701 var pos = value+inc; 1702 pos = pos.toString(); 1703 pos = pos.split(".").pop(); 1704 pos = parseFloat("."+pos); 1705 return pos; 1706 } 1707 var createGrad = function(inc,sizeX, sizeY) { 1708 var grd=context.createLinearGradient(0,0,sizeX,sizeY); 1709 grd.addColorStop(moveColors(0, inc),"#FF0000"); 1710 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 1711 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 1712 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 1713 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 1714 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 1715 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 1716 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 1717 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 1718 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 1719 grd.addColorStop(moveColors(1, inc),"#FF0000"); 1720 return grd; 1721 } 1722 var shadowGlow = function() { 1723 context.shadowColor = customSettingsObj.fgcolor; 1724 context.shadowOffsetX = 0; 1725 context.shadowOffsetY = 0; 1726 context.shadowBlur = 10; 1727 } 1728 var drawBorder = function() { 1729 context.lineWidth = customSettingsObj.bordersize + 1; 1730 context.strokeStyle = customSettingsObj.bgcolor; 1731 context.stroke(); 1732 if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle') { 1733 // 1734 } else { 1735 context.fillStyle = customSettingsObj.fill; 1736 context.fill(); 1737 } 1738 context.beginPath(); 1739 context.save(); 1740 } 1741 var fillAnimation = function(animationType, current) { 1742 if(animationType == 1){ 1743 context.strokeStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 1744 context.stroke(); 1745 } else if(animationType == 2){ 1746 context.strokeStyle = customSettingsObj.fgcolor; 1747 if (type == 'line') { 1748 var grd=context.createLinearGradient(sizeX,0,0,0); 1749 grd.addColorStop(0,"white"); 1750 grd.addColorStop(1,customSettingsObj.fgcolor); 1751 context.strokeStyle = grd; 1752 shadowGlow(); 1753 } else if (type == 'vert-line') { 1754 var grd=context.createLinearGradient(0,0,0,sizeY); 1755 grd.addColorStop(0,"white"); 1756 grd.addColorStop(1,customSettingsObj.fgcolor); 1757 context.strokeStyle = grd; 1758 shadowGlow(); 1759 } else { 1760 var grd = context.createRadialGradient(sizeX/2, sizeY/2, (sizeX+customSettingsObj.bordersize*2)/2.5, sizeY/2, sizeX/2, (sizeY-customSettingsObj.bordersize*2)/2.5); 1761 grd.addColorStop(0, customSettingsObj.fgcolor); 1762 grd.addColorStop(0.5, 'white'); 1763 grd.addColorStop(1, customSettingsObj.fgcolor); 1764 context.strokeStyle = grd; 1765 shadowGlow(); 1766 } 1767 context.stroke();
1768 context.restore(); 1769 } else if(animationType == 3){ 1770 if (type == 'line') { 1771 var grd = createGrad(inc,sizeX,sizeY); 1772 inc = increaseInc(inc,current); 1773 context.strokeStyle = grd; 1774 } else if (type == 'vert-line') { 1775 var grd=context.createLinearGradient(sizeX/2,0,sizeX/2,sizeY); 1776 grd.addColorStop(moveColors(0, inc),"#FF0000"); 1777 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 1778 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 1779 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 1780 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 1781 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 1782 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 1783 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 1784 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 1785 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 1786 grd.addColorStop(moveColors(1, inc),"#FF0000"); 1787 inc = increaseInc(inc,current); 1788 context.strokeStyle = grd; 1789 } else { 1790 var grd = createGrad(inc,sizeX,sizeY); 1791 inc = increaseInc(inc,current); 1792 context.strokeStyle = grd; 1793 } 1794 context.stroke(); 1795 context.restore(); 1796 } else { 1797 context.strokeStyle = customSettingsObj.fgcolor; 1798 context.stroke(); 1799 } 1800 } 1801 // ---------------------- // 1802 // Animation 1803 // ---------------------- // 1804 function animate(current) { 1805 //Clear Canvas for next frame 1806 context.clearRect(0, 0, canvas.width, canvas.height); 1807 //Draw Background 1808 if (type == 'line' || type == 'vert-line') { 1809 context.rect(10, 10, sizeX-20, sizeY-20); 1810 } else if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle' || type == 'full' || type == 'half') { 1811 context.beginPath(); 1812 context.arc(x, y, radius, endAngle, startAngle, false); 1813 } 1814 context.fillStyle = customSettingsObj.fill; 1815 context.fill(); 1816 if (type == 'line') { 1817 context.beginPath(); 1818 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 1819 context.lineTo(sizeX-10,sizeY-(customSettingsObj.bordersize/2+10)); 1820 drawBorder(); 1821 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 1822 context.lineTo(Math.min((sizeX-20) * current+10,sizeX-10),sizeY-(customSettingsObj.bordersize/2+10)); 1823 fillAnimation(animationType,current); 1824 } else if (type == 'vert-line'){ 1825 context.beginPath(); 1826 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 1827 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),10); 1828 drawBorder(); 1829 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 1830 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),Math.max((sizeY-20) * (1-current)+10,10)); 1831 fillAnimation(animationType,current); 1832 } else if (type == 'full' || type=='half') { 1833 drawBorder(); 1834 context.arc(x, y, radius, -(quart) + additionalAngelPI, ((circ) * (Math.min(current,1)+.005)) - quart + additionalAngelPI, false); 1835 fillAnimation(animationType,current); 1836 } else if (type == 'grow-circle') { 1837 drawBorder(); 1838 var fillRadius = sizeX/2.5*Math.min(current,1); 1839 context.arc(sizeX/2, sizeY/2, Math.max(fillRadius-customSettingsObj.bordersize/2,0), endAngle, startAngle, false); 1840 if(animationType == 1){ 1841 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 1842 context.fill(); 1843 } else if(animationType == 2){ 1844 var grd=context.createLinearGradient(0,0,0,sizeY); 1845 grd.addColorStop(0,"white"); 1846 grd.addColorStop(1,customSettingsObj.fgcolor); 1847 shadowGlow(); 1848 context.fillStyle = grd; 1849 context.fill(); 1850 } else if(animationType == 3){ 1851 var grd = createGrad(inc,sizeX,sizeY); 1852 inc = increaseInc(inc,current); 1853 context.fillStyle = grd; 1854 context.fill(); 1855 } else { 1856 context.fillStyle = customSettingsObj.fgcolor; 1857 context.fill(); 1858 }
1859 context.restore(); 1860 } else if (type == 'fill-circle') { 1861 drawBorder(); 1862 var fillRadius = sizeX/2.5, 1863 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 1864 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 1865 if(animationType == 1){ 1866 context.clip(); 1867 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 1868 context.fillRect(0, fillLine, sizeX, sizeY); 1869 } else if(animationType == 2){ 1870 var grd=context.createLinearGradient(0,0,0,sizeY); 1871 grd.addColorStop(0,"white"); 1872 grd.addColorStop(1,customSettingsObj.fgcolor); 1873 shadowGlow(); 1874 context.clip(); 1875 context.fillStyle = grd; 1876 context.fillRect(0, fillLine, sizeX, sizeY); 1877 1878 } else if(animationType == 3){ 1879 context.clip(); 1880 var grd = createGrad(inc,sizeX, sizeY); 1881 inc = increaseInc(inc,current); 1882 context.fillStyle = grd; 1883 context.fillRect(0, fillLine, sizeX, sizeY); 1884 } else { 1885 context.clip(); 1886 context.fillStyle = customSettingsObj.fgcolor; 1887 context.fillRect(0, fillLine, sizeX, sizeY); 1888 } 1889 context.restore(); 1890 } else if (type == 'fill-circle-wave') { 1891 drawBorder(); 1892 var fillRadius = sizeX/2.5, 1893 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 1894 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 1895 var ypos=fillLine, xpos=0; 1896 counter += .1; 1897 counterLoop = counter; 1898 var increase = 2*Math.PI / 12; 1899 context.clip(); 1900 context.beginPath(); 1901 context.moveTo(sizeX,sizeY); 1902 context.lineTo(0,sizeY); 1903 context.lineTo(0,ypos); 1904 if (curPerc > endPercent) { 1905 calm-=.01; 1906 if(calm<0) calm=0; 1907 } 1908 for(i=0; i<=sizeX; i+=10){ 1909 xpos = i; 1910 ypos = ypos - Math.sin(counterLoop) * calm; 1911 counterLoop += increase; 1912 context.lineTo(xpos,ypos); 1913 } 1914 context.lineTo(sizeX,sizeY); 1915 context.closePath(); 1916 if(animationType == 1){ 1917 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 1918 context.fill(); 1919 } else if(animationType == 2){ 1920 var grd=context.createLinearGradient(0,0,0,sizeY); 1921 grd.addColorStop(0,"white"); 1922 grd.addColorStop(1,customSettingsObj.fgcolor); 1923 shadowGlow(); 1924 context.clip(); 1925 context.fillStyle = grd; 1926 context.fill(); 1927 } else if(animationType == 3){ 1928 context.clip(); 1929 var grd = createGrad(inc,sizeX,sizeY); 1930 inc = increaseInc(inc,current); 1931 context.fillStyle = grd; 1932 context.fill(); 1933 } else { 1934 context.clip(); 1935 context.fillStyle = customSettingsObj.fgcolor; 1936 context.fill(); 1937 } 1938 context.restore(); 1939 } 1940 1941 if (curPerc < endPercent) { 1942 curPerc += curStep; 1943 requestAnimationFrame(function () { 1944 context.strokeStyle = customSettingsObj.fgcolor; 1945 animate(Math.min(curPerc, endPercent) / 100); 1946 }, obj); 1947 } else if(finishFrames < 500) { 1948 curPerc += curStep; 1949 finishFrames+=1; 1950 requestAnimationFrame(function () { 1951 context.strokeStyle = customSettingsObj.fgcolor; 1952 animate(Math.min(curPerc, endPercent) / 100); 1953 }, obj); 1954 } 1955 1956 if (curPerc == endPercent && fireCallback && typeof(options) != "undefined") { 1957 if (opticStats.isFunction(options.complete)) { 1958 options.complete(); 1959 1960 fireCallback = false; 1961 } 1962 } 1963 } 1964 obj.waypoint(function(direction){ 1965 animate(curPerc / 100); 1966 this.destroy(); 1967 }, { offset: '100%' }); 1968 }); 1969 }; 1970}(opticStats)); 1971/* 1972 The MIT License (MIT) 1973 CountUp 1974+Copyright (c) 2014-2015 Jamie Perkins 1975 Permission is hereby granted, free of charge, to any person obtaining a copy of
1976 this software and associated documentation files (the "Software"), to deal in 1977*/ 1978!function(t,a){"function"==typeof define&&define.amd?define(a):"object"==typeof exports?module.exports=a(require,exports,module):t.CountUp=a()}(this,function(){var t=function(t,a,e,n,i,r){for(var o=0,s=["webkit","moz","ms","o"],u=0;u<s.length&&!window.requestAnimationFrame;++u)window.requestAnimationFrame=window[s[u]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[s[u]+"CancelAnimationFrame"]||window[s[u]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var a=(new Date).getTime(),e=Math.max(0,16-(a-o)),n=window.setTimeout(function(){t(a+e)},e);return o=a+e,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),this.options={useEasing:!0,useGrouping:!0,separator:",",decimal:"."};for(var m in r)r.hasOwnProperty(m)&&(this.options[m]=r[m]);""===this.options.separator&&(this.options.useGrouping=!1),this.options.prefix||(this.options.prefix=""),this.options.suffix||(this.options.suffix=""),this.d="string"==typeof t?document.getElementById(t):t,this.startVal=Number(a),this.endVal=Number(e),this.countDown=this.startVal>this.endVal,this.frameVal=this.startVal,this.decimals=Math.max(0,n||0),this.dec=Math.pow(10,this.decimals),this.duration=1e3*Number(i)||2e3;var l=this;this.version=function(){return"1.6.0"},this.printValue=function(t){var a=isNaN(t)?"--":l.formatNumber(t);"INPUT"==l.d.tagName?this.d.value=a:"text"==l.d.tagName||"tspan"==l.d.tagName?this.d.textContent=a:this.d.innerHTML=a},this.easeOutExpo=function(t,a,e,n){return e*(-Math.pow(2,-10*t/n)+1)*1024/1023+a},this.count=function(t){l.startTime||(l.startTime=t),l.timestamp=t;var a=t-l.startTime;l.remaining=l.duration-a,l.frameVal=l.options.useEasing?l.countDown?l.startVal-l.easeOutExpo(a,0,l.startVal-l.endVal,l.duration):l.easeOutExpo(a,l.startVal,l.endVal-l.startVal,l.duration):l.countDown?l.startVal-(l.startVal-l.endVal)*(a/l.duration):l.startVal+(l.endVal-l.startVal)*(a/l.duration),l.frameVal=l.countDown?l.frameVal<l.endVal?l.endVal:l.frameVal:l.frameVal>l.endVal?l.endVal:l.frameVal,l.frameVal=Math.round(l.frameVal*l.dec)/l.dec,l.printValue(l.frameVal),a<l.duration?l.rAF=requestAnimationFrame(l.count):l.callback&&l.callback()},this.start=function(t){return l.callback=t,l.rAF=requestAnimationFrame(l.count),!1},this.pauseResume=function(){l.paused?(l.paused=!1,delete l.startTime,l.duration=l.remaining,l.startVal=l.frameVal,requestAnimationFrame(l.count)):(l.paused=!0,cancelAnimationFrame(l.rAF))},this.reset=function(){l.paused=!1,delete l.startTime,l.startVal=a,cancelAnimationFrame(l.rAF),l.printValue(l.startVal)},this.update=function(t){cancelAnimationFrame(l.rAF),l.paused=!1,delete l.startTime,l.startVal=l.frameVal,l.endVal=Number(t),l.countDown=l.startVal>l.endVal,l.rAF=requestAnimationFrame(l.count)},this.formatNumber=function(t){t=t.toFixed(l.decimals),t+="";var a,e,n,i;if(a=t.split("."),e=a[0],n=a.length>1?l.options.decimal+a[1]:"",i=/(\d+)(\d{3})/,l.options.useGrouping)for(;i.test(e);)e=e.replace(i,"$1"+l.options.separator+"$2");return l.options.prefix+e+n+l.options.suffix},l.printValue(l.startVal)};return t}); 1979/*! 1980Waypoints - 4.0.0 1981Copyright © 2011-2015 Caleb Troughton 1982Licensed under the MIT license. 1983https://github.com/imakewebthings/waypoints/blob/master/licenses.txt 1984*/ 1985!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()}
vendor: 5,106 bytes, line 1985
1985,t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],r
1985ight:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.opticStatselement=e(t)}var e=opticStats,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.opticStatselement[i].apply(this.opticStatselement,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;opticStats&&(opticStats.fn.waypoint=t(opticStats)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); 1986 1987opticStats( document ).ready(function() { 1988 var speed = 3000, 1989 countNumberstacks_in_85 = "100", 1990 decimalNumber = '0', 1991 decimalNumber = decimalNumber.replace(/\D/g,''), 1992 decimalLength = decimalNumber.length, 1993 maxValuePercentstacks_in_85 = (countNumberstacks_in_85/100), 1994 speedA = (2000/speed)*maxValuePercentstacks_in_85; 1995 if (100 == 0) { 1996 if(countNumberstacks_in_85 < 0) { 1997 maxValuePercentstacks_in_85 = 1; 1998 } else { 1999 maxValuePercentstacks_in_85 = (0-countNumberstacks_in_85)/0; 2000 } 2001 } 2002 if('False' == 'False' ) { 2003 decimalLength = 0; 2004 } else { 2005 countNumberstacks_in_85 = countNumberstacks_in_85.replace(/\D/g,''); 2006 countNumberstacks_in_85 = countNumberstacks_in_85+"."+decimalNumber; 2007 } 2008 if('False' == 'True' ) { 2009 var items = readData_data(opticStats("#data")); 2010 countNumberstacks_in_85 = items['data-A1']; 2011 if(countNumberstacks_in_85 == null) { 2012 countNumberstacks_in_85 = '0'; 2013 } 2014 opticStats("#stat_stacks_in_85").data("percent", maxValuePercentstacks_in_85*100); 2015 // 2016 // 2017 if(countNumberstacks_in_85.indexOf(".") !== -1) { 2018 decimalNumber = countNumberstacks_in_85.substr(countNumberstacks_in_85.indexOf(".") + 1); 2019 decimalNumber = decimalNumber.replace(/\D/g,''); 2020 decimalLength = decimalNumber.length; 2021 countNumberstacks_in_85 = countNumberstacks_in_85.substr(0, countNumberstacks_in_85.indexOf('.')); 2022 } 2023 // 2024 // 2025 countNumberstacks_in_85 = countNumberstacks_in_85.replace(/[^0-9\-]/g,''); 2026 countNumberstacks_in_85 = countNumberstacks_in_85+"."+decimalNumber; 2027 maxValuePercentstacks_in_85 = (countNumberstacks_in_85/100); 2028 if (100 == 0) { 2029 if(countNumberstacks_in_85 < 0) { 2030 maxValuePercentstacks_in_85 = 1; 2031 } else { 2032 maxValuePercentstacks_in_85 = (0-countNumberstacks_in_85)/0; 2033 } 2034 } 2035 speedA = (2000/speed)*maxValuePercentstacks_in_85; 2036 opticStats("#stat_stacks_in_85").data("percent", maxValuePercentstacks_in_85*100); 2037 } else { 2038 var maxValuePercentstacks_in_85 = (countNumberstacks_in_85/100); 2039 if (100 == 0) { 2040 if(countNumberstacks_in_85 < 0) { 2041 maxValuePercentstacks_in_85 = 1; 2042 } else { 2043 maxValuePercentstacks_in_85 = (0-countNumberstacks_in_85)/0; 2044 } 2045 } 2046 speedA = (2000/speed)*maxValuePercentstacks_in_85; 2047 opticStats("#stat_stacks_in_85").data("percent", maxValuePercentstacks_in_85*100); 2048 } 2049 opticStats('#stat_stacks_in_85').attr("data-animationstep", speedA); 2050 opticStats('#stat_stacks_in_85').circliful(); 2051 opticStats('#stat_stacks_in_85').waypoint(function(direction){ 2052 2053 // 2054// opticStats('#stacks_in_85 .counter').counterUp({ 2055// delay: 10, 2056// time: speed 2057// }); 2058 2059 var options = { 2060 // 2061 // 2062 separator : ',', 2063 decimal : '.', 2064 // 2065 // 2066 // 2067 useEasing : false 2068 }; 2069 opticStats('#stacks_in_85 .counter').attr("id", "count_stacks_in_85"); 2070 var count = new CountUp('count_stacks_in_85', 0, countNumberstacks_in_85, decimalLength, (1.9/speedA)*(maxValuePercentstacks_in_85), options);//(1.75/speedA)*(maxValuePercentstacks_in_85) 2071 count.start(); 2072 // 2073 // 2074 opticStats('#stat_stacks_in_85 .circle-text').append("%"); 2075 opticStats('#stat_stacks_in_85 .circle-text-half').append("%"); 2076 // 2077 // 2078 // 2079 // 2080 // 2081 scale(); 2082 this.destroy(); 2083 }, { offset: '100%' }); 2084 2085 2086}); 2087 2088opticStats( window ).resize(function() { 2089 scale(); 2090}); 2091function scale() { 2092 var width = 200, 2093 currentWidth = opticStats('#stat_stacks_in_85').parent().outerWidth(); 2094 if(currentWidth < width) { 2095 var scale = currentWidth/width; 2096 opticStats('#stat_stacks_in_85').css({ 2097 "transform" : "scale("+scale+")", 2098 "transform-origin" : "0px", 2099 "-o-transform" : "scale("+scale+")", 2100 "-o-transform-origin" : "0px" 2101 }); 2102 } else { 2103 opticStats('#stat_stacks_in_85').css({ 2104 "transform" : "scale(1)", 2105 "-o-transform" : "scale(1)" 2106 }); 2107 } 2108} 2109 2110return stack;})(stacks.stacks_in_85); 2111stacks.stacks_in_66 = {}; 2112stacks.stacks_in_66 = (function(stack) { 2113var jQuery = stacks.jQuery;var $ = jQuery;var opticStats = $; 2114/* 2115jquery-plugin-circliful 2116+The MIT License (MIT) 2117+ 2118+Copyright (c) 2014 Patric Gutersohn 2119+ 2120+Permission is hereby granted, free of charge, to any person obtaining a copy of 2121+this software and associated documentation files (the "Software"), to deal in 2122+the Software without restriction, including without limitation the rights to 2123+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 2124+the Software, and to permit persons to whom the Software is furnished to do so, 2125+subject to the following conditions: 2126+ 2127+The above copyright notice and this permission notice shall be included in all 2128+copies or substantial portions of the Software. 2129+ 2130+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 2131+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 2132+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 2133+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 2134+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 2135+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 2136*/ 2137"use strict"; 2138 2139(function (opticStats) { 2140 2141 opticStats.fn.circliful = function (options, callback) { 2142 2143 var settings = opticStats.extend({ 2144 // These are the defaults. 2145 startdegree: 0, 2146 fgcolor: "#556b2f", 2147 bgcolor: "#eee", 2148 fill: false, 2149 width: 15, 2150 dimension: 200, 2151 fontsize: 15, 2152 percent: 50, 2153 animationstep: 1.0, 2154 iconsize: '20px', 2155 iconcolor: '#999', 2156 border: 'default', 2157 complete: null, 2158 bordersize: 10 2159 }, options); 2160 2161 return this.each(function () { 2162 2163 var customSettings = ["fgcolor", "bgcolor", "fill", "width", "dimension", "fontsize", "animationstep", "endPercent", "icon", "iconcolor", "iconsize", "border", "startdegree", "bordersize"]; 2164 2165 var customSettingsObj = {}; 2166 var icon = ''; 2167 var percent; 2168 var endPercent = 0; 2169 var obj = opticStats(this); 2170 var fill = false;
2171 var text, info; 2172 2173 obj.addClass('circliful'); 2174 2175 checkDataAttributes(obj); 2176 2177 if (obj.data('text') != undefined) { 2178 2179 //remove non number characters 2180 2181 text = obj.data('text'); 2182 text = text.toString(); 2183 text = text.replace(/[^0-9.,]/g, ''); 2184 text = "<span class='counter'>" + text + "</span>"; 2185 2186 if (obj.data('icon') != undefined) { 2187 icon = opticStats('<i></i>') 2188 .addClass('osIcon fa ' + opticStats(this).data('icon')) 2189 .css({ 2190 'color': customSettingsObj.iconcolor, 2191 'font-size': customSettingsObj.iconsize, 2192 'line-height': customSettingsObj.iconsize + "px" 2193 }); 2194 } 2195 if (obj.data('icon-custom') != undefined) { 2196 icon = opticStats('<img src="'+opticStats(this).data("icon-custom")+'"></img>') 2197 .addClass('osIcon ') 2198 .css({ 2199 'width': customSettingsObj.iconsize, 2200 'height': customSettingsObj.iconsize 2201 }); 2202 } 2203 2204 if (obj.data('type') != undefined) { 2205 type = opticStats(this).data('type'); 2206 2207 if (type == 'half') { 2208 addCircleText(obj, 'circle-text-half', (customSettingsObj.dimension / 1.45)); 2209 } else { 2210 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 2211 } 2212 } else { 2213 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 2214 } 2215 } 2216 2217 if (opticStats(this).data("total") != undefined && opticStats(this).data("part") != undefined) { 2218 var total = opticStats(this).data("total") / 100; 2219 2220 percent = ((opticStats(this).data("part") / total) / 100).toFixed(3); 2221 endPercent = (opticStats(this).data("part") / total).toFixed(3); 2222 } else { 2223 if (opticStats(this).data("percent") != undefined) { 2224 percent = opticStats(this).data("percent") / 100; 2225 endPercent = opticStats(this).data("percent"); 2226 } else { 2227 percent = settings.percent / 100; 2228 } 2229 } 2230 2231 if (opticStats(this).data('info') != undefined) { 2232 info = opticStats(this).data('info'); 2233 2234 if (opticStats(this).data('type') != undefined) { 2235 type = opticStats(this).data('type'); 2236 2237 if (type == 'half') { 2238 addInfoText(obj, 0.9); 2239 } else { 2240 addInfoText(obj, 1.25); 2241 } 2242 } else { 2243 addInfoText(obj, 1.25); 2244 } 2245 } 2246 2247 opticStats(this).width(customSettingsObj.dimension + 'px'); 2248 if (type == 'line' || type == 'vert-line') { 2249 opticStats(this).height(opticStats(this).data('height') + 'px'); 2250 } else { 2251 opticStats(this).height(customSettingsObj.dimension + 'px'); 2252 } 2253 2254 2255 var sizeX = customSettingsObj.dimension, 2256 sizeY = customSettingsObj.dimension; 2257 if (type == 'line' || type == 'vert-line') { 2258 sizeY = opticStats(this).data('height'); 2259 } 2260 var canvas = opticStats('<canvas></canvas>').attr({ 2261 width: sizeX, 2262 height: sizeY 2263 }).appendTo(opticStats(this)).get(0); 2264 var context = canvas.getContext('2d'); 2265 2266 var dpr = window.devicePixelRatio; 2267 if ( dpr ) { 2268 var opticStatscanvas = opticStats(canvas); 2269 opticStatscanvas.css('width', sizeX); 2270 opticStatscanvas.css('height', sizeY); 2271 opticStatscanvas.attr('width', sizeX * dpr); 2272 opticStatscanvas.attr('height', sizeY * dpr); 2273 2274 context.scale(dpr, dpr); 2275 } 2276 2277 var container = opticStats(canvas).parent(); 2278 var x = sizeX / 2; 2279 var y = sizeY / 2; 2280 var degrees = customSettingsObj.percent * 360.0; 2281 var radians = degrees * (Math.PI / 180); 2282 var radius = sizeX / 2.5; 2283 var startAngle = 2.3 * Math.PI; 2284 var endAngle = 0; 2285 var counterClockwise = false; 2286 var curPerc = customSettingsObj.animationstep === 0.0 ? endPercent : 0.0; 2287 var curStep = Math.max(customSettingsObj.animationstep, 0.0); 2288 var circ = Math.PI * 2; 2289 var quart = Math.PI / 2; 2290 var type = ''; 2291 var fireCallback = true; 2292 var additionalAngelPI = (customSettingsObj.startdegree / 180) * Math.PI; 2293 2294 if (opticStats(this).data('type') != undefined) { 2295 type = opticStats(this).data('type'); 2296 if (type == 'half') { 2297 startAngle = 2.0 * Math.PI; 2298 endAngle = 3.14; 2299 circ = Math.PI; 2300 quart = Math.PI / 0.996; 2301 } else if (type == 'angle') { 2302 startAngle = 2.25 * Math.PI; 2303 endAngle = 2.4; 2304 circ = 1.53 + Math.PI; 2305 quart = 0.73 + Math.PI / 0.996; 2306 } 2307 } 2308 2309 /** 2310 * adds text to circle 2311 * 2312 * @param obj 2313 * @param cssClass 2314 * @param lineHeight 2315 */ 2316 opticStats(" > span", this).wrapAll("<div class='centerMe'><div></div></div>"); 2317 function addCircleText(obj, cssClass, lineHeight) { 2318 opticStats("<span></span>") 2319 .appendTo(obj) 2320 .addClass(cssClass) 2321 .html(text) 2322 .prepend(icon) 2323 .css({ 2324 //'line-height': lineHeight + 'px', 2325 'font-size': customSettingsObj.fontsize + 'px', 2326 'line-height': customSettingsObj.fontsize + 'px' 2327 }); 2328 } 2329 2330 /** 2331 * adds info text to circle 2332 * 2333 * @param obj 2334 * @param factor 2335 */ 2336 function addInfoText(obj, factor) { 2337 opticStats('<span></span>') 2338 .appendTo(obj) 2339 .addClass('circle-info-half') 2340 //.css( 2341 //'line-height', (customSettingsObj.dimension * factor) + 'px' 2342 //) 2343 .text(info); 2344 } 2345 2346 /** 2347 * checks which data attributes are defined 2348 * @param obj 2349 */ 2350 function checkDataAttributes(obj) { 2351 opticStats.each(customSettings, function (index, attribute) { 2352 if (obj.data(attribute) != undefined) { 2353 customSettingsObj[attribute] = obj.data(attribute); 2354 } else { 2355 customSettingsObj[attribute] = opticStats(settings).attr(attribute); 2356 } 2357 2358 if (attribute == 'fill' && obj.data('fill') != undefined) { 2359 fill = true; 2360 } 2361 }); 2362 } 2363 2364 //Animation Variables 2365 var inc = 0, counter=0,calm = 2,finishFrames=0, animationType = obj.data('animation-type'), slowTheInc = 0; 2366 // ---------------------- // 2367 // Animation Functions 2368 // ---------------------- // 2369 function blend(inColor,outColor,current){ 2370 var inColors = inColor.substring(inColor.indexOf('(') + 1, inColor.lastIndexOf(')')).split(/,\s*/), 2371 outColors = outColor.substring(outColor.indexOf('(') + 1, outColor.lastIndexOf(')')).split(/,\s*/), 2372 r,g,b,a,cur; 2373 for(var i=0; i<inColors.length; i++) { inColors[i] = parseInt(inColors[i], 10); } 2374 for(var i=0; i<outColors.length; i++) { outColors[i] = parseInt(outColors[i], 10); } 2375 if(current < .5 ) { 2376 cur = current*2; 2377 r = Math.min(255,Math.max(0, inColors[0] + (outColors[0] * cur))); 2378 g = Math.min(255,Math.max(0, inColors[1] + (outColors[1] * cur))); 2379 b = Math.min(255,Math.max(0, inColors[2] + (outColors[2] * cur))); 2380 } else { 2381 cur = (current-.5)*2; 2382 r = Math.min(255,Math.max(0,Math.max(inColors[0], outColors[0]) + ((outColors[0] - inColors[0]) * cur))); 2383 g = Math.min(255,Math.max(0,Math.max(inColors[1], outColors[1]) + ((outColors[1] - inColors[1]) * cur))); 2384 b = Math.min(255,Math.max(0,Math.max(inColors[2], outColors[2]) + ((outColors[2] - inColors[2]) * cur))); 2385 } 2386 var a = inColors[3]+((outColors[3] - inColors[3])*current);
2387 return 'rgba('+Math.floor(r)+', '+Math.floor(g)+', '+Math.floor(b)+', '+Math.floor(a)+')'; 2388 } 2389 if (type == 'line' || type == 'vert-line') { 2390 customSettingsObj.bordersize = customSettingsObj.bordersize*2; 2391 } 2392 var increaseInc = function(inc, current) { 2393 if (current >= 1) { 2394 // slowTheInc += 0.00002; 2395 // slowTheInc = Math.min(slowTheInc, 0.005); 2396 // inc = inc + (0.005-slowTheInc); 2397 } else { 2398 inc += 0.005; 2399 } 2400 return inc; 2401 } 2402 var moveColors = function(value, inc) { 2403 var pos = value+inc; 2404 pos = pos.toString(); 2405 pos = pos.split(".").pop(); 2406 pos = parseFloat("."+pos); 2407 return pos; 2408 } 2409 var createGrad = function(inc,sizeX, sizeY) { 2410 var grd=context.createLinearGradient(0,0,sizeX,sizeY); 2411 grd.addColorStop(moveColors(0, inc),"#FF0000"); 2412 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 2413 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 2414 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 2415 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 2416 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 2417 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 2418 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 2419 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 2420 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 2421 grd.addColorStop(moveColors(1, inc),"#FF0000"); 2422 return grd; 2423 } 2424 var shadowGlow = function() { 2425 context.shadowColor = customSettingsObj.fgcolor; 2426 context.shadowOffsetX = 0; 2427 context.shadowOffsetY = 0; 2428 context.shadowBlur = 10; 2429 } 2430 var drawBorder = function() { 2431 context.lineWidth = customSettingsObj.bordersize + 1; 2432 context.strokeStyle = customSettingsObj.bgcolor; 2433 context.stroke(); 2434 if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle') { 2435 // 2436 } else { 2437 context.fillStyle = customSettingsObj.fill; 2438 context.fill(); 2439 } 2440 context.beginPath(); 2441 context.save(); 2442 } 2443 var fillAnimation = function(animationType, current) { 2444 if(animationType == 1){ 2445 context.strokeStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 2446 context.stroke(); 2447 } else if(animationType == 2){ 2448 context.strokeStyle = customSettingsObj.fgcolor; 2449 if (type == 'line') { 2450 var grd=context.createLinearGradient(sizeX,0,0,0); 2451 grd.addColorStop(0,"white"); 2452 grd.addColorStop(1,customSettingsObj.fgcolor); 2453 context.strokeStyle = grd; 2454 shadowGlow(); 2455 } else if (type == 'vert-line') { 2456 var grd=context.createLinearGradient(0,0,0,sizeY); 2457 grd.addColorStop(0,"white"); 2458 grd.addColorStop(1,customSettingsObj.fgcolor); 2459 context.strokeStyle = grd; 2460 shadowGlow(); 2461 } else { 2462 var grd = context.createRadialGradient(sizeX/2, sizeY/2, (sizeX+customSettingsObj.bordersize*2)/2.5, sizeY/2, sizeX/2, (sizeY-customSettingsObj.bordersize*2)/2.5); 2463 grd.addColorStop(0, customSettingsObj.fgcolor); 2464 grd.addColorStop(0.5, 'white'); 2465 grd.addColorStop(1, customSettingsObj.fgcolor); 2466 context.strokeStyle = grd; 2467 shadowGlow(); 2468 } 2469 context.stroke(); 2470 context.restore(); 2471 } else if(animationType == 3){ 2472 if (type == 'line') { 2473 var grd = createGrad(inc,sizeX,sizeY); 2474 inc = increaseInc(inc,current); 2475 context.strokeStyle = grd; 2476 } else if (type == 'vert-line') { 2477 var grd=context.createLinearGradient(sizeX/2,0,sizeX/2,sizeY); 2478 grd.addColorStop(moveColors(0, inc),"#FF0000"); 2479 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 2480 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 2481 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 2482 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 2483 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 2484 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 2485 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 2486 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 2487 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 2488 grd.addColorStop(moveColors(1, inc),"#FF0000"); 2489 inc = increaseInc(inc,current); 2490 context.strokeStyle = grd; 2491 } else { 2492 var grd = createGrad(inc,sizeX,sizeY); 2493 inc = increaseInc(inc,current); 2494 context.strokeStyle = grd; 2495 } 2496 context.stroke();
2497 context.restore(); 2498 } else { 2499 context.strokeStyle = customSettingsObj.fgcolor; 2500 context.stroke(); 2501 } 2502 } 2503 // ---------------------- // 2504 // Animation 2505 // ---------------------- // 2506 function animate(current) { 2507 //Clear Canvas for next frame 2508 context.clearRect(0, 0, canvas.width, canvas.height); 2509 //Draw Background 2510 if (type == 'line' || type == 'vert-line') { 2511 context.rect(10, 10, sizeX-20, sizeY-20); 2512 } else if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle' || type == 'full' || type == 'half') { 2513 context.beginPath(); 2514 context.arc(x, y, radius, endAngle, startAngle, false); 2515 } 2516 context.fillStyle = customSettingsObj.fill; 2517 context.fill(); 2518 if (type == 'line') { 2519 context.beginPath(); 2520 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 2521 context.lineTo(sizeX-10,sizeY-(customSettingsObj.bordersize/2+10)); 2522 drawBorder(); 2523 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 2524 context.lineTo(Math.min((sizeX-20) * current+10,sizeX-10),sizeY-(customSettingsObj.bordersize/2+10)); 2525 fillAnimation(animationType,current); 2526 } else if (type == 'vert-line'){ 2527 context.beginPath(); 2528 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 2529 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),10); 2530 drawBorder(); 2531 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 2532 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),Math.max((sizeY-20) * (1-current)+10,10)); 2533 fillAnimation(animationType,current); 2534 } else if (type == 'full' || type=='half') { 2535 drawBorder(); 2536 context.arc(x, y, radius, -(quart) + additionalAngelPI, ((circ) * (Math.min(current,1)+.005)) - quart + additionalAngelPI, false); 2537 fillAnimation(animationType,current); 2538 } else if (type == 'grow-circle') { 2539 drawBorder(); 2540 var fillRadius = sizeX/2.5*Math.min(current,1); 2541 context.arc(sizeX/2, sizeY/2, Math.max(fillRadius-customSettingsObj.bordersize/2,0), endAngle, startAngle, false); 2542 if(animationType == 1){ 2543 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 2544 context.fill(); 2545 } else if(animationType == 2){ 2546 var grd=context.createLinearGradient(0,0,0,sizeY); 2547 grd.addColorStop(0,"white"); 2548 grd.addColorStop(1,customSettingsObj.fgcolor); 2549 shadowGlow(); 2550 context.fillStyle = grd; 2551 context.fill(); 2552 } else if(animationType == 3){ 2553 var grd = createGrad(inc,sizeX,sizeY); 2554 inc = increaseInc(inc,current); 2555 context.fillStyle = grd; 2556 context.fill(); 2557 } else { 2558 context.fillStyle = customSettingsObj.fgcolor; 2559 context.fill(); 2560 } 2561 context.restore(); 2562 } else if (type == 'fill-circle') { 2563 drawBorder(); 2564 var fillRadius = sizeX/2.5, 2565 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 2566 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 2567 if(animationType == 1){ 2568 context.clip(); 2569 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 2570 context.fillRect(0, fillLine, sizeX, sizeY); 2571 } else if(animationType == 2){ 2572 var grd=context.createLinearGradient(0,0,0,sizeY); 2573 grd.addColorStop(0,"white"); 2574 grd.addColorStop(1,customSettingsObj.fgcolor); 2575 shadowGlow(); 2576 context.clip(); 2577 context.fillStyle = grd; 2578 context.fillRect(0, fillLine, sizeX, sizeY); 2579 2580 } else if(animationType == 3){ 2581 context.clip(); 2582 var grd = createGrad(inc,sizeX, sizeY); 2583 inc = increaseInc(inc,current); 2584 context.fillStyle = grd; 2585 context.fillRect(0, fillLine, sizeX, sizeY); 2586 } else { 2587 context.clip(); 2588 context.fillStyle = customSettingsObj.fgcolor; 2589 context.fillRect(0, fillLine, sizeX, sizeY); 2590 }
2591 context.restore(); 2592 } else if (type == 'fill-circle-wave') { 2593 drawBorder(); 2594 var fillRadius = sizeX/2.5, 2595 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 2596 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 2597 var ypos=fillLine, xpos=0; 2598 counter += .1; 2599 counterLoop = counter; 2600 var increase = 2*Math.PI / 12; 2601 context.clip(); 2602 context.beginPath(); 2603 context.moveTo(sizeX,sizeY); 2604 context.lineTo(0,sizeY); 2605 context.lineTo(0,ypos); 2606 if (curPerc > endPercent) { 2607 calm-=.01; 2608 if(calm<0) calm=0; 2609 } 2610 for(i=0; i<=sizeX; i+=10){ 2611 xpos = i; 2612 ypos = ypos - Math.sin(counterLoop) * calm; 2613 counterLoop += increase; 2614 context.lineTo(xpos,ypos); 2615 } 2616 context.lineTo(sizeX,sizeY); 2617 context.closePath(); 2618 if(animationType == 1){ 2619 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 2620 context.fill(); 2621 } else if(animationType == 2){ 2622 var grd=context.createLinearGradient(0,0,0,sizeY); 2623 grd.addColorStop(0,"white"); 2624 grd.addColorStop(1,customSettingsObj.fgcolor); 2625 shadowGlow(); 2626 context.clip(); 2627 context.fillStyle = grd; 2628 context.fill(); 2629 } else if(animationType == 3){ 2630 context.clip(); 2631 var grd = createGrad(inc,sizeX,sizeY); 2632 inc = increaseInc(inc,current); 2633 context.fillStyle = grd; 2634 context.fill(); 2635 } else { 2636 context.clip(); 2637 context.fillStyle = customSettingsObj.fgcolor; 2638 context.fill(); 2639 } 2640 context.restore(); 2641 } 2642 2643 if (curPerc < endPercent) { 2644 curPerc += curStep; 2645 requestAnimationFrame(function () { 2646 context.strokeStyle = customSettingsObj.fgcolor; 2647 animate(Math.min(curPerc, endPercent) / 100); 2648 }, obj); 2649 } else if(finishFrames < 500) { 2650 curPerc += curStep; 2651 finishFrames+=1; 2652 requestAnimationFrame(function () { 2653 context.strokeStyle = customSettingsObj.fgcolor; 2654 animate(Math.min(curPerc, endPercent) / 100); 2655 }, obj); 2656 } 2657 2658 if (curPerc == endPercent && fireCallback && typeof(options) != "undefined") { 2659 if (opticStats.isFunction(options.complete)) { 2660 options.complete(); 2661 2662 fireCallback = false; 2663 } 2664 } 2665 } 2666 obj.waypoint(function(direction){ 2667 animate(curPerc / 100); 2668 this.destroy(); 2669 }, { offset: '100%' }); 2670 }); 2671 }; 2672}(opticStats)); 2673/* 2674 The MIT License (MIT) 2675 CountUp 2676+Copyright (c) 2014-2015 Jamie Perkins 2677 Permission is hereby granted, free of charge, to any person obtaining a copy of 2678 this software and associated documentation files (the "Software"), to deal in 2679*/ 2680!function(t,a){"function"==typeof define&&define.amd?define(a):"object"==typeof exports?module.exports=a(require,exports,module):t.CountUp=a()}(this,function(){var t=function(t,a,e,n,i,r){for(var o=0,s=["webkit","moz","ms","o"],u=0;u<s.length&&!window.requestAnimationFrame;++u)window.requestAnimationFrame=window[s[u]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[s[u]+"CancelAnimationFrame"]||window[s[u]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var a=(new Date).getTime(),e=Math.max(0,16-(a-o)),n=window.setTimeout(function(){t(a+e)},e);return o=a+e,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),this.options={useEasing:!0,useGrouping:!0,separator:",",decimal:"."};for(var m in r)r.hasOwnProperty(m)&&(this.options[m]=r[m]);""===this.options.separator&&(this.options.useGrouping=!1),this.options.prefix||(this.options.prefix=""),this.options.suffix||(this.options.suffix=""),this.d="string"==typeof t?document.getElementById(t):t,this.startVal=Number(a),this.endVal=Number(e),this.countDown=this.startVal>this.endVal,this.frameVal=this.startVal,this.decimals=Math.max(0,n||0),this.dec=Math.pow(10,this.decimals),this.duration=1e3*Number(i)||2e3;var l=this;this.version=function(){return"1.6.0"},this.printValue=function(t){var a=isNaN(t)?"--":l.formatNumber(t);"INPUT"==l.d.tagName?this.d.value=a:"text"==l.d.tagName||"tspan"==l.d.tagName?this.d.textContent=a:this.d.innerHTML=a},this.easeOutExpo=function(t,a,e,n){return e*(-Math.pow(2,-10*t/n)+1)*1024/1023+a},this.count=function(t){l.startTime||(l.startTime=t),l.timestamp=t;var a=t-l.startTime;l.remaining=l.duration-a,l.frameVal=l.options.useEasing?l.countDown?l.startVal-l.easeOutExpo(a,0,l.startVal-l.endVal,l.duration):l.easeOutExpo(a,l.startVal,l.endVal-l.startVal,l.duration):l.countDown?l.startVal-(l.startVal-l.endVal)*(a/l.duration):l.startVal+(l.endVal-l.startVal)*(a/l.duration),l.frameVal=l.countDown?l.frameVal<l.endVal?l.endVal:l.frameVal:l.frameVal>l.endVal?l.endVal:l.frameVal,l.frameVal=Math.round(l.frameVal*l.dec)/l.dec,l.printValue(l.frameVal),a<l.duration?l.rAF=requestAnimationFrame(l.count):l.callback&&l.callback()},this.start=function(t){return l.callback=t,l.rAF=requestAnimationFrame(l.count),!1},this.pauseResume=function(){l.paused?(l.paused=!1,delete l.startTime,l.duration=l.remaining,l.startVal=l.frameVal,requestAnimationFrame(l.count)):(l.paused=!0,cancelAnimationFrame(l.rAF))},this.reset=function(){l.paused=!1,delete l.startTime,l.startVal=a,cancelAnimationFrame(l.rAF),l.printValue(l.startVal)},this.update=function(t){cancelAnimationFrame(l.rAF),l.paused=!1,delete l.startTime,l.startVal=l.frameVal,l.endVal=Number(t),l.countDown=l.startVal>l.endVal,l.rAF=requestAnimationFrame(l.count)},this.formatNumber=function(t){t=t.toFixed(l.decimals),t+="";var a,e,n,i;if(a=t.split("."),e=a[0],n=a.length>1?l.options.decimal+a[1]:"",i=/(\d+)(\d{3})/,l.options.useGrouping)for(;i.test(e);)e=e.replace(i,"$1"+l.options.separator+"$2");return l.options.prefix+e+n+l.options.suffix},l.printValue(l.startVal)};return t}); 2681/*! 2682Waypoints - 4.0.0 2683Copyright © 2011-2015 Caleb Troughton 2684Licensed under the MIT license. 2685https://github.com/imakewebthings/waypoints/blob/master/licenses.txt 2686*/ 2687!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");
vendor: 6,526 bytes, line 2687
2687this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],r
2687ight:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.opticStatselement=e(t)}var e=opticStats,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.opticStatselement[i].apply(this.opticStatselement,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;opticStats&&(opticStats.fn.waypoint=t(opticStats)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); 2688 2689opticStats( document ).ready(function() { 2690 var speed = 3000, 2691 countNumberstacks_in_66 = "100", 2692 decimalNumber = '0', 2693 decimalNumber = decimalNumber.replace(/\D/g,''), 2694 decimalLength = decimalNumber.length, 2695 maxValuePercentstacks_in_66 = (countNumberstacks_in_66/100), 2696 speedA = (2000/speed)*maxValuePercentstacks_in_66; 2697 if (100 == 0) { 2698 if(countNumberstacks_in_66 < 0) { 2699 maxValuePercentstacks_in_66 = 1; 2700 } else { 2701 maxValuePercentstacks_in_66 = (0-countNumberstacks_in_66)/0; 2702 } 2703 } 2704 if('False' == 'False' ) { 2705 decimalLength = 0; 2706 } else { 2707 countNumberstacks_in_66 = countNumberstacks_in_66.replace(/\D/g,''); 2708 countNumberstacks_in_66 = countNumberstacks_in_66+"."+decimalNumber; 2709 } 2710 if('False' == 'True' ) { 2711 var items = readData_data(opticStats("#data")); 2712 countNumberstacks_in_66 = items['data-A1']; 2713 if(countNumberstacks_in_66 == null) { 2714 countNumberstacks_in_66 = '0'; 2715 } 2716 opticStats("#stat_stacks_in_66").data("percent", maxValuePercentstacks_in_66*100); 2717 // 2718 // 2719 if(countNumberstacks_in_66.indexOf(".") !== -1) { 2720 decimalNumber = countNumberstacks_in_66.substr(countNumberstacks_in_66.indexOf(".") + 1); 2721 decimalNumber = decimalNumber.replace(/\D/g,''); 2722 decimalLength = decimalNumber.length; 2723 countNumberstacks_in_66 = countNumberstacks_in_66.substr(0, countNumberstacks_in_66.indexOf('.')); 2724 } 2725 // 2726 // 2727 countNumberstacks_in_66 = countNumberstacks_in_66.replace(/[^0-9\-]/g,''); 2728 countNumberstacks_in_66 = countNumberstacks_in_66+"."+decimalNumber; 2729 maxValuePercentstacks_in_66 = (countNumberstacks_in_66/100); 2730 if (100 == 0) { 2731 if(countNumberstacks_in_66 < 0) { 2732 maxValuePercentstacks_in_66 = 1; 2733 } else { 2734 maxValuePercentstacks_in_66 = (0-countNumberstacks_in_66)/0; 2735 } 2736 } 2737 speedA = (2000/speed)*maxValuePercentstacks_in_66; 2738 opticStats("#stat_stacks_in_66").data("percent", maxValuePercentstacks_in_66*100); 2739 } else { 2740 var maxValuePercentstacks_in_66 = (countNumberstacks_in_66/100); 2741 if (100 == 0) { 2742 if(countNumberstacks_in_66 < 0) { 2743 maxValuePercentstacks_in_66 = 1; 2744 } else { 2745 maxValuePercentstacks_in_66 = (0-countNumberstacks_in_66)/0; 2746 } 2747 } 2748 speedA = (2000/speed)*maxValuePercentstacks_in_66; 2749 opticStats("#stat_stacks_in_66").data("percent", maxValuePercentstacks_in_66*100); 2750 } 2751 opticStats('#stat_stacks_in_66').attr("data-animationstep", speedA); 2752 opticStats('#stat_stacks_in_66').circliful(); 2753 opticStats('#stat_stacks_in_66').waypoint(function(direction){ 2754 2755 // 2756// opticStats('#stacks_in_66 .counter').counterUp({ 2757// delay: 10, 2758// time: speed 2759// }); 2760 2761 var options = { 2762 // 2763 // 2764 separator : ',', 2765 decimal : '.', 2766 // 2767 // 2768 // 2769 useEasing : false 2770 }; 2771 opticStats('#stacks_in_66 .counter').attr("id", "count_stacks_in_66"); 2772 var count = new CountUp('count_stacks_in_66', 0, countNumberstacks_in_66, decimalLength, (1.9/speedA)*(maxValuePercentstacks_in_66), options);//(1.75/speedA)*(maxValuePercentstacks_in_66) 2773 count.start(); 2774 // 2775 // 2776 opticStats('#stat_stacks_in_66 .circle-text').append("%"); 2777 opticStats('#stat_stacks_in_66 .circle-text-half').append("%"); 2778 // 2779 // 2780 // 2781 // 2782 // 2783 scale(); 2784 this.destroy(); 2785 }, { offset: '100%' }); 2786 2787 2788}); 2789 2790opticStats( window ).resize(function() { 2791 scale(); 2792}); 2793function scale() { 2794 var width = 200, 2795 currentWidth = opticStats('#stat_stacks_in_66').parent().outerWidth(); 2796 if(currentWidth < width) { 2797 var scale = currentWidth/width; 2798 opticStats('#stat_stacks_in_66').css({ 2799 "transform" : "scale("+scale+")", 2800 "transform-origin" : "0px", 2801 "-o-transform" : "scale("+scale+")", 2802 "-o-transform-origin" : "0px" 2803 }); 2804 } else { 2805 opticStats('#stat_stacks_in_66').css({ 2806 "transform" : "scale(1)", 2807 "-o-transform" : "scale(1)" 2808 }); 2809 } 2810} 2811 2812return stack;})(stacks.stacks_in_66); 2813stacks.stacks_in_65 = {}; 2814stacks.stacks_in_65 = (function(stack) { 2815var jQuery = stacks.jQuery;var $ = jQuery;var opticStats = $; 2816/* 2817jquery-plugin-circliful 2818+The MIT License (MIT) 2819+ 2820+Copyright (c) 2014 Patric Gutersohn 2821+ 2822+Permission is hereby granted, free of charge, to any person obtaining a copy of 2823+this software and associated documentation files (the "Software"), to deal in 2824+the Software without restriction, including without limitation the rights to 2825+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 2826+the Software, and to permit persons to whom the Software is furnished to do so, 2827+subject to the following conditions: 2828+ 2829+The above copyright notice and this permission notice shall be included in all 2830+copies or substantial portions of the Software. 2831+ 2832+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 2833+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 2834+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 2835+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 2836+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 2837+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 2838*/ 2839"use strict"; 2840 2841(function (opticStats) { 2842 2843 opticStats.fn.circliful = function (options, callback) { 2844 2845 var settings = opticStats.extend({ 2846 // These are the defaults. 2847 startdegree: 0, 2848 fgcolor: "#556b2f", 2849 bgcolor: "#eee", 2850 fill: false, 2851 width: 15, 2852 dimension: 200, 2853 fontsize: 15, 2854 percent: 50, 2855 animationstep: 1.0, 2856 iconsize: '20px', 2857 iconcolor: '#999', 2858 border: 'default', 2859 complete: null, 2860 bordersize: 10 2861 }, options); 2862 2863 return this.each(function () { 2864 2865 var customSettings = ["fgcolor", "bgcolor", "fill", "width", "dimension", "fontsize", "animationstep", "endPercent", "icon", "iconcolor", "iconsize", "border", "startdegree", "bordersize"]; 2866 2867 var customSettingsObj = {}; 2868 var icon = ''; 2869 var percent; 2870 var endPercent = 0; 2871 var obj = opticStats(this); 2872 var fill = false;
2873 var text, info; 2874 2875 obj.addClass('circliful'); 2876 2877 checkDataAttributes(obj); 2878 2879 if (obj.data('text') != undefined) { 2880 2881 //remove non number characters 2882 2883 text = obj.data('text'); 2884 text = text.toString(); 2885 text = text.replace(/[^0-9.,]/g, ''); 2886 text = "<span class='counter'>" + text + "</span>"; 2887 2888 if (obj.data('icon') != undefined) { 2889 icon = opticStats('<i></i>') 2890 .addClass('osIcon fa ' + opticStats(this).data('icon')) 2891 .css({ 2892 'color': customSettingsObj.iconcolor, 2893 'font-size': customSettingsObj.iconsize, 2894 'line-height': customSettingsObj.iconsize + "px" 2895 }); 2896 } 2897 if (obj.data('icon-custom') != undefined) { 2898 icon = opticStats('<img src="'+opticStats(this).data("icon-custom")+'"></img>') 2899 .addClass('osIcon ') 2900 .css({ 2901 'width': customSettingsObj.iconsize, 2902 'height': customSettingsObj.iconsize 2903 }); 2904 } 2905 2906 if (obj.data('type') != undefined) { 2907 type = opticStats(this).data('type'); 2908 2909 if (type == 'half') { 2910 addCircleText(obj, 'circle-text-half', (customSettingsObj.dimension / 1.45)); 2911 } else { 2912 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 2913 } 2914 } else { 2915 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 2916 } 2917 } 2918 2919 if (opticStats(this).data("total") != undefined && opticStats(this).data("part") != undefined) { 2920 var total = opticStats(this).data("total") / 100; 2921 2922 percent = ((opticStats(this).data("part") / total) / 100).toFixed(3); 2923 endPercent = (opticStats(this).data("part") / total).toFixed(3); 2924 } else { 2925 if (opticStats(this).data("percent") != undefined) { 2926 percent = opticStats(this).data("percent") / 100; 2927 endPercent = opticStats(this).data("percent"); 2928 } else { 2929 percent = settings.percent / 100; 2930 } 2931 } 2932 2933 if (opticStats(this).data('info') != undefined) { 2934 info = opticStats(this).data('info'); 2935 2936 if (opticStats(this).data('type') != undefined) { 2937 type = opticStats(this).data('type'); 2938 2939 if (type == 'half') { 2940 addInfoText(obj, 0.9); 2941 } else { 2942 addInfoText(obj, 1.25); 2943 } 2944 } else { 2945 addInfoText(obj, 1.25); 2946 } 2947 } 2948 2949 opticStats(this).width(customSettingsObj.dimension + 'px'); 2950 if (type == 'line' || type == 'vert-line') { 2951 opticStats(this).height(opticStats(this).data('height') + 'px'); 2952 } else { 2953 opticStats(this).height(customSettingsObj.dimension + 'px'); 2954 } 2955 2956 2957 var sizeX = customSettingsObj.dimension, 2958 sizeY = customSettingsObj.dimension; 2959 if (type == 'line' || type == 'vert-line') { 2960 sizeY = opticStats(this).data('height'); 2961 } 2962 var canvas = opticStats('<canvas></canvas>').attr({ 2963 width: sizeX, 2964 height: sizeY 2965 }).appendTo(opticStats(this)).get(0); 2966 var context = canvas.getContext('2d'); 2967 2968 var dpr = window.devicePixelRatio; 2969 if ( dpr ) { 2970 var opticStatscanvas = opticStats(canvas); 2971 opticStatscanvas.css('width', sizeX); 2972 opticStatscanvas.css('height', sizeY); 2973 opticStatscanvas.attr('width', sizeX * dpr); 2974 opticStatscanvas.attr('height', sizeY * dpr); 2975 2976 context.scale(dpr, dpr); 2977 } 2978 2979 var container = opticStats(canvas).parent(); 2980 var x = sizeX / 2; 2981 var y = sizeY / 2; 2982 var degrees = customSettingsObj.percent * 360.0; 2983 var radians = degrees * (Math.PI / 180); 2984 var radius = sizeX / 2.5; 2985 var startAngle = 2.3 * Math.PI; 2986 var endAngle = 0; 2987 var counterClockwise = false; 2988 var curPerc = customSettingsObj.animationstep === 0.0 ? endPercent : 0.0; 2989 var curStep = Math.max(customSettingsObj.animationstep, 0.0); 2990 var circ = Math.PI * 2; 2991 var quart = Math.PI / 2; 2992 var type = ''; 2993 var fireCallback = true; 2994 var additionalAngelPI = (customSettingsObj.startdegree / 180) * Math.PI; 2995 2996 if (opticStats(this).data('type') != undefined) { 2997 type = opticStats(this).data('type'); 2998 if (type == 'half') { 2999 startAngle = 2.0 * Math.PI; 3000 endAngle = 3.14; 3001 circ = Math.PI; 3002 quart = Math.PI / 0.996; 3003 } else if (type == 'angle') { 3004 startAngle = 2.25 * Math.PI; 3005 endAngle = 2.4; 3006 circ = 1.53 + Math.PI; 3007 quart = 0.73 + Math.PI / 0.996; 3008 } 3009 } 3010 3011 /** 3012 * adds text to circle 3013 * 3014 * @param obj 3015 * @param cssClass 3016 * @param lineHeight 3017 */ 3018 opticStats(" > span", this).wrapAll("<div class='centerMe'><div></div></div>"); 3019 function addCircleText(obj, cssClass, lineHeight) { 3020 opticStats("<span></span>") 3021 .appendTo(obj) 3022 .addClass(cssClass) 3023 .html(text) 3024 .prepend(icon) 3025 .css({ 3026 //'line-height': lineHeight + 'px', 3027 'font-size': customSettingsObj.fontsize + 'px', 3028 'line-height': customSettingsObj.fontsize + 'px' 3029 }); 3030 } 3031 3032 /** 3033 * adds info text to circle 3034 * 3035 * @param obj 3036 * @param factor 3037 */ 3038 function addInfoText(obj, factor) { 3039 opticStats('<span></span>') 3040 .appendTo(obj) 3041 .addClass('circle-info-half') 3042 //.css( 3043 //'line-height', (customSettingsObj.dimension * factor) + 'px' 3044 //) 3045 .text(info); 3046 } 3047 3048 /** 3049 * checks which data attributes are defined 3050 * @param obj 3051 */ 3052 function checkDataAttributes(obj) { 3053 opticStats.each(customSettings, function (index, attribute) { 3054 if (obj.data(attribute) != undefined) { 3055 customSettingsObj[attribute] = obj.data(attribute); 3056 } else { 3057 customSettingsObj[attribute] = opticStats(settings).attr(attribute); 3058 } 3059 3060 if (attribute == 'fill' && obj.data('fill') != undefined) { 3061 fill = true; 3062 } 3063 }); 3064 } 3065 3066 //Animation Variables 3067 var inc = 0, counter=0,calm = 2,finishFrames=0, animationType = obj.data('animation-type'), slowTheInc = 0; 3068 // ---------------------- // 3069 // Animation Functions 3070 // ---------------------- // 3071 function blend(inColor,outColor,current){ 3072 var inColors = inColor.substring(inColor.indexOf('(') + 1, inColor.lastIndexOf(')')).split(/,\s*/), 3073 outColors = outColor.substring(outColor.indexOf('(') + 1, outColor.lastIndexOf(')')).split(/,\s*/), 3074 r,g,b,a,cur; 3075 for(var i=0; i<inColors.length; i++) { inColors[i] = parseInt(inColors[i], 10); } 3076 for(var i=0; i<outColors.length; i++) { outColors[i] = parseInt(outColors[i], 10); } 3077 if(current < .5 ) { 3078 cur = current*2; 3079 r = Math.min(255,Math.max(0, inColors[0] + (outColors[0] * cur))); 3080 g = Math.min(255,Math.max(0, inColors[1] + (outColors[1] * cur))); 3081 b = Math.min(255,Math.max(0, inColors[2] + (outColors[2] * cur))); 3082 } else { 3083 cur = (current-.5)*2; 3084 r = Math.min(255,Math.max(0,Math.max(inColors[0], outColors[0]) + ((outColors[0] - inColors[0]) * cur))); 3085 g = Math.min(255,Math.max(0,Math.max(inColors[1], outColors[1]) + ((outColors[1] - inColors[1]) * cur))); 3086 b = Math.min(255,Math.max(0,Math.max(inColors[2], outColors[2]) + ((outColors[2] - inColors[2]) * cur))); 3087 } 3088 var a = inColors[3]+((outColors[3] - inColors[3])*current);
3089 return 'rgba('+Math.floor(r)+', '+Math.floor(g)+', '+Math.floor(b)+', '+Math.floor(a)+')'; 3090 } 3091 if (type == 'line' || type == 'vert-line') { 3092 customSettingsObj.bordersize = customSettingsObj.bordersize*2; 3093 } 3094 var increaseInc = function(inc, current) { 3095 if (current >= 1) { 3096 // slowTheInc += 0.00002; 3097 // slowTheInc = Math.min(slowTheInc, 0.005); 3098 // inc = inc + (0.005-slowTheInc); 3099 } else { 3100 inc += 0.005; 3101 } 3102 return inc; 3103 } 3104 var moveColors = function(value, inc) { 3105 var pos = value+inc; 3106 pos = pos.toString(); 3107 pos = pos.split(".").pop(); 3108 pos = parseFloat("."+pos); 3109 return pos; 3110 } 3111 var createGrad = function(inc,sizeX, sizeY) { 3112 var grd=context.createLinearGradient(0,0,sizeX,sizeY); 3113 grd.addColorStop(moveColors(0, inc),"#FF0000"); 3114 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 3115 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 3116 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 3117 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 3118 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 3119 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 3120 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 3121 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 3122 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 3123 grd.addColorStop(moveColors(1, inc),"#FF0000"); 3124 return grd; 3125 } 3126 var shadowGlow = function() { 3127 context.shadowColor = customSettingsObj.fgcolor; 3128 context.shadowOffsetX = 0; 3129 context.shadowOffsetY = 0; 3130 context.shadowBlur = 10; 3131 } 3132 var drawBorder = function() { 3133 context.lineWidth = customSettingsObj.bordersize + 1; 3134 context.strokeStyle = customSettingsObj.bgcolor; 3135 context.stroke(); 3136 if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle') { 3137 // 3138 } else { 3139 context.fillStyle = customSettingsObj.fill; 3140 context.fill(); 3141 } 3142 context.beginPath(); 3143 context.save(); 3144 } 3145 var fillAnimation = function(animationType, current) { 3146 if(animationType == 1){ 3147 context.strokeStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 3148 context.stroke(); 3149 } else if(animationType == 2){ 3150 context.strokeStyle = customSettingsObj.fgcolor; 3151 if (type == 'line') { 3152 var grd=context.createLinearGradient(sizeX,0,0,0); 3153 grd.addColorStop(0,"white"); 3154 grd.addColorStop(1,customSettingsObj.fgcolor); 3155 context.strokeStyle = grd; 3156 shadowGlow(); 3157 } else if (type == 'vert-line') { 3158 var grd=context.createLinearGradient(0,0,0,sizeY); 3159 grd.addColorStop(0,"white"); 3160 grd.addColorStop(1,customSettingsObj.fgcolor); 3161 context.strokeStyle = grd; 3162 shadowGlow(); 3163 } else { 3164 var grd = context.createRadialGradient(sizeX/2, sizeY/2, (sizeX+customSettingsObj.bordersize*2)/2.5, sizeY/2, sizeX/2, (sizeY-customSettingsObj.bordersize*2)/2.5); 3165 grd.addColorStop(0, customSettingsObj.fgcolor); 3166 grd.addColorStop(0.5, 'white'); 3167 grd.addColorStop(1, customSettingsObj.fgcolor); 3168 context.strokeStyle = grd; 3169 shadowGlow(); 3170 } 3171 context.stroke(); 3172 context.restore(); 3173 } else if(animationType == 3){ 3174 if (type == 'line') { 3175 var grd = createGrad(inc,sizeX,sizeY); 3176 inc = increaseInc(inc,current); 3177 context.strokeStyle = grd; 3178 } else if (type == 'vert-line') { 3179 var grd=context.createLinearGradient(sizeX/2,0,sizeX/2,sizeY); 3180 grd.addColorStop(moveColors(0, inc),"#FF0000"); 3181 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 3182 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 3183 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 3184 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 3185 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 3186 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 3187 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 3188 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 3189 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 3190 grd.addColorStop(moveColors(1, inc),"#FF0000"); 3191 inc = increaseInc(inc,current); 3192 context.strokeStyle = grd; 3193 } else { 3194 var grd = createGrad(inc,sizeX,sizeY); 3195 inc = increaseInc(inc,current); 3196 context.strokeStyle = grd; 3197 } 3198 context.stroke();
3199 context.restore(); 3200 } else { 3201 context.strokeStyle = customSettingsObj.fgcolor; 3202 context.stroke(); 3203 } 3204 } 3205 // ---------------------- // 3206 // Animation 3207 // ---------------------- // 3208 function animate(current) { 3209 //Clear Canvas for next frame 3210 context.clearRect(0, 0, canvas.width, canvas.height); 3211 //Draw Background 3212 if (type == 'line' || type == 'vert-line') { 3213 context.rect(10, 10, sizeX-20, sizeY-20); 3214 } else if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle' || type == 'full' || type == 'half') { 3215 context.beginPath(); 3216 context.arc(x, y, radius, endAngle, startAngle, false); 3217 } 3218 context.fillStyle = customSettingsObj.fill; 3219 context.fill(); 3220 if (type == 'line') { 3221 context.beginPath(); 3222 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 3223 context.lineTo(sizeX-10,sizeY-(customSettingsObj.bordersize/2+10)); 3224 drawBorder(); 3225 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 3226 context.lineTo(Math.min((sizeX-20) * current+10,sizeX-10),sizeY-(customSettingsObj.bordersize/2+10)); 3227 fillAnimation(animationType,current); 3228 } else if (type == 'vert-line'){ 3229 context.beginPath(); 3230 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 3231 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),10); 3232 drawBorder(); 3233 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 3234 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),Math.max((sizeY-20) * (1-current)+10,10)); 3235 fillAnimation(animationType,current); 3236 } else if (type == 'full' || type=='half') { 3237 drawBorder(); 3238 context.arc(x, y, radius, -(quart) + additionalAngelPI, ((circ) * (Math.min(current,1)+.005)) - quart + additionalAngelPI, false); 3239 fillAnimation(animationType,current); 3240 } else if (type == 'grow-circle') { 3241 drawBorder(); 3242 var fillRadius = sizeX/2.5*Math.min(current,1); 3243 context.arc(sizeX/2, sizeY/2, Math.max(fillRadius-customSettingsObj.bordersize/2,0), endAngle, startAngle, false); 3244 if(animationType == 1){ 3245 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 3246 context.fill(); 3247 } else if(animationType == 2){ 3248 var grd=context.createLinearGradient(0,0,0,sizeY); 3249 grd.addColorStop(0,"white"); 3250 grd.addColorStop(1,customSettingsObj.fgcolor); 3251 shadowGlow(); 3252 context.fillStyle = grd; 3253 context.fill(); 3254 } else if(animationType == 3){ 3255 var grd = createGrad(inc,sizeX,sizeY); 3256 inc = increaseInc(inc,current); 3257 context.fillStyle = grd; 3258 context.fill(); 3259 } else { 3260 context.fillStyle = customSettingsObj.fgcolor; 3261 context.fill(); 3262 } 3263 context.restore(); 3264 } else if (type == 'fill-circle') { 3265 drawBorder(); 3266 var fillRadius = sizeX/2.5, 3267 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 3268 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 3269 if(animationType == 1){ 3270 context.clip(); 3271 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 3272 context.fillRect(0, fillLine, sizeX, sizeY); 3273 } else if(animationType == 2){ 3274 var grd=context.createLinearGradient(0,0,0,sizeY); 3275 grd.addColorStop(0,"white"); 3276 grd.addColorStop(1,customSettingsObj.fgcolor); 3277 shadowGlow(); 3278 context.clip(); 3279 context.fillStyle = grd; 3280 context.fillRect(0, fillLine, sizeX, sizeY); 3281 3282 } else if(animationType == 3){ 3283 context.clip(); 3284 var grd = createGrad(inc,sizeX, sizeY); 3285 inc = increaseInc(inc,current); 3286 context.fillStyle = grd; 3287 context.fillRect(0, fillLine, sizeX, sizeY); 3288 } else { 3289 context.clip(); 3290 context.fillStyle = customSettingsObj.fgcolor; 3291 context.fillRect(0, fillLine, sizeX, sizeY); 3292 }
3293 context.restore(); 3294 } else if (type == 'fill-circle-wave') { 3295 drawBorder(); 3296 var fillRadius = sizeX/2.5, 3297 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 3298 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 3299 var ypos=fillLine, xpos=0; 3300 counter += .1; 3301 counterLoop = counter; 3302 var increase = 2*Math.PI / 12; 3303 context.clip(); 3304 context.beginPath(); 3305 context.moveTo(sizeX,sizeY); 3306 context.lineTo(0,sizeY); 3307 context.lineTo(0,ypos); 3308 if (curPerc > endPercent) { 3309 calm-=.01; 3310 if(calm<0) calm=0; 3311 } 3312 for(i=0; i<=sizeX; i+=10){ 3313 xpos = i; 3314 ypos = ypos - Math.sin(counterLoop) * calm; 3315 counterLoop += increase; 3316 context.lineTo(xpos,ypos); 3317 } 3318 context.lineTo(sizeX,sizeY); 3319 context.closePath(); 3320 if(animationType == 1){ 3321 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 3322 context.fill(); 3323 } else if(animationType == 2){ 3324 var grd=context.createLinearGradient(0,0,0,sizeY); 3325 grd.addColorStop(0,"white"); 3326 grd.addColorStop(1,customSettingsObj.fgcolor); 3327 shadowGlow(); 3328 context.clip(); 3329 context.fillStyle = grd; 3330 context.fill(); 3331 } else if(animationType == 3){ 3332 context.clip(); 3333 var grd = createGrad(inc,sizeX,sizeY); 3334 inc = increaseInc(inc,current); 3335 context.fillStyle = grd; 3336 context.fill(); 3337 } else { 3338 context.clip(); 3339 context.fillStyle = customSettingsObj.fgcolor; 3340 context.fill(); 3341 } 3342 context.restore(); 3343 } 3344 3345 if (curPerc < endPercent) { 3346 curPerc += curStep; 3347 requestAnimationFrame(function () { 3348 context.strokeStyle = customSettingsObj.fgcolor; 3349 animate(Math.min(curPerc, endPercent) / 100); 3350 }, obj); 3351 } else if(finishFrames < 500) { 3352 curPerc += curStep; 3353 finishFrames+=1; 3354 requestAnimationFrame(function () { 3355 context.strokeStyle = customSettingsObj.fgcolor; 3356 animate(Math.min(curPerc, endPercent) / 100); 3357 }, obj); 3358 } 3359 3360 if (curPerc == endPercent && fireCallback && typeof(options) != "undefined") { 3361 if (opticStats.isFunction(options.complete)) { 3362 options.complete(); 3363 3364 fireCallback = false; 3365 } 3366 } 3367 } 3368 obj.waypoint(function(direction){ 3369 animate(curPerc / 100); 3370 this.destroy(); 3371 }, { offset: '100%' }); 3372 }); 3373 }; 3374}(opticStats)); 3375/* 3376 The MIT License (MIT) 3377 CountUp 3378+Copyright (c) 2014-2015 Jamie Perkins 3379 Permission is hereby granted, free of charge, to any person obtaining a copy of 3380 this software and associated documentation files (the "Software"), to deal in 3381*/ 3382!function(t,a){"function"==typeof define&&define.amd?define(a):"object"==typeof exports?module.exports=a(require,exports,module):t.CountUp=a()}(this,function(){var t=function(t,a,e,n,i,r){for(var o=0,s=["webkit","moz","ms","o"],u=0;u<s.length&&!window.requestAnimationFrame;++u)window.requestAnimationFrame=window[s[u]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[s[u]+"CancelAnimationFrame"]||window[s[u]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var a=(new Date).getTime(),e=Math.max(0,16-(a-o)),n=window.setTimeout(function(){t(a+e)},e);return o=a+e,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),this.options={useEasing:!0,useGrouping:!0,separator:",",decimal:"."};for(var m in r)r.hasOwnProperty(m)&&(this.options[m]=r[m]);""===this.options.separator&&(this.options.useGrouping=!1),this.options.prefix||(this.options.prefix=""),this.options.suffix||(this.options.suffix=""),this.d="string"==typeof t?document.getElementById(t):t,this.startVal=Number(a),this.endVal=Number(e),this.countDown=this.startVal>this.endVal,this.frameVal=this.startVal,this.decimals=Math.max(0,n||0),this.dec=Math.pow(10,this.decimals),this.duration=1e3*Number(i)||2e3;var l=this;this.version=function(){return"1.6.0"},this.printValue=function(t){var a=isNaN(t)?"--":l.formatNumber(t);"INPUT"==l.d.tagName?this.d.value=a:"text"==l.d.tagName||"tspan"==l.d.tagName?this.d.textContent=a:this.d.innerHTML=a},this.easeOutExpo=function(t,a,e,n){return e*(-Math.pow(2,-10*t/n)+1)*1024/1023+a},this.count=function(t){l.startTime||(l.startTime=t),l.timestamp=t;var a=t-l.startTime;l.remaining=l.duration-a,l.frameVal=l.options.useEasing?l.countDown?l.startVal-l.easeOutExpo(a,0,l.startVal-l.endVal,l.duration):l.easeOutExpo(a,l.startVal,l.endVal-l.startVal,l.duration):l.countDown?l.startVal-(l.startVal-l.endVal)*(a/l.duration):l.startVal+(l.endVal-l.startVal)*(a/l.duration),l.frameVal=l.countDown?l.frameVal<l.endVal?l.endVal:l.frameVal:l.frameVal>l.endVal?l.endVal:l.frameVal,l.frameVal=Math.round(l.frameVal*l.dec)/l.dec,l.printValue(l.frameVal),a<l.duration?l.rAF=requestAnimationFrame(l.count):l.callback&&l.callback()},this.start=function(t){return l.callback=t,l.rAF=requestAnimationFrame(l.count),!1},this.pauseResume=function(){l.paused?(l.paused=!1,delete l.startTime,l.duration=l.remaining,l.startVal=l.frameVal,requestAnimationFrame(l.count)):(l.paused=!0,cancelAnimationFrame(l.rAF))},this.reset=function(){l.paused=!1,delete l.startTime,l.startVal=a,cancelAnimationFrame(l.rAF),l.printValue(l.startVal)},this.update=function(t){cancelAnimationFrame(l.rAF),l.paused=!1,delete l.startTime,l.startVal=l.frameVal,l.endVal=Number(t),l.countDown=l.startVal>l.endVal,l.rAF=requestAnimationFrame(l.count)},this.formatNumber=function(t){t=t.toFixed(l.decimals),t+="";var a,e,n,i;if(a=t.split("."),e=a[0],n=a.length>1?l.options.decimal+a[1]:"",i=/(\d+)(\d{3})/,l.options.useGrouping)for(;i.test(e);)e=e.replace(i,"$1"+l.options.separator+"$2");return l.options.prefix+e+n+l.options.suffix},l.printValue(l.startVal)};return t}); 3383/*! 3384Waypoints - 4.0.0 3385Copyright © 2011-2015 Caleb Troughton 3386Licensed under the MIT license. 3387https://github.com/imakewebthings/waypoints/blob/master/licenses.txt 3388*/ 3389!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");
vendor: 6,526 bytes, line 3389
3389this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],r
3389ight:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.opticStatselement=e(t)}var e=opticStats,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.opticStatselement[i].apply(this.opticStatselement,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;opticStats&&(opticStats.fn.waypoint=t(opticStats)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); 3390 3391opticStats( document ).ready(function() { 3392 var speed = 3000, 3393 countNumberstacks_in_65 = "100", 3394 decimalNumber = '0', 3395 decimalNumber = decimalNumber.replace(/\D/g,''), 3396 decimalLength = decimalNumber.length, 3397 maxValuePercentstacks_in_65 = (countNumberstacks_in_65/100), 3398 speedA = (2000/speed)*maxValuePercentstacks_in_65; 3399 if (100 == 0) { 3400 if(countNumberstacks_in_65 < 0) { 3401 maxValuePercentstacks_in_65 = 1; 3402 } else { 3403 maxValuePercentstacks_in_65 = (0-countNumberstacks_in_65)/0; 3404 } 3405 } 3406 if('False' == 'False' ) { 3407 decimalLength = 0; 3408 } else { 3409 countNumberstacks_in_65 = countNumberstacks_in_65.replace(/\D/g,''); 3410 countNumberstacks_in_65 = countNumberstacks_in_65+"."+decimalNumber; 3411 } 3412 if('False' == 'True' ) { 3413 var items = readData_data(opticStats("#data")); 3414 countNumberstacks_in_65 = items['data-A1']; 3415 if(countNumberstacks_in_65 == null) { 3416 countNumberstacks_in_65 = '0'; 3417 } 3418 opticStats("#stat_stacks_in_65").data("percent", maxValuePercentstacks_in_65*100); 3419 // 3420 // 3421 if(countNumberstacks_in_65.indexOf(".") !== -1) { 3422 decimalNumber = countNumberstacks_in_65.substr(countNumberstacks_in_65.indexOf(".") + 1); 3423 decimalNumber = decimalNumber.replace(/\D/g,''); 3424 decimalLength = decimalNumber.length; 3425 countNumberstacks_in_65 = countNumberstacks_in_65.substr(0, countNumberstacks_in_65.indexOf('.')); 3426 } 3427 // 3428 // 3429 countNumberstacks_in_65 = countNumberstacks_in_65.replace(/[^0-9\-]/g,''); 3430 countNumberstacks_in_65 = countNumberstacks_in_65+"."+decimalNumber; 3431 maxValuePercentstacks_in_65 = (countNumberstacks_in_65/100); 3432 if (100 == 0) { 3433 if(countNumberstacks_in_65 < 0) { 3434 maxValuePercentstacks_in_65 = 1; 3435 } else { 3436 maxValuePercentstacks_in_65 = (0-countNumberstacks_in_65)/0; 3437 } 3438 } 3439 speedA = (2000/speed)*maxValuePercentstacks_in_65; 3440 opticStats("#stat_stacks_in_65").data("percent", maxValuePercentstacks_in_65*100); 3441 } else { 3442 var maxValuePercentstacks_in_65 = (countNumberstacks_in_65/100); 3443 if (100 == 0) { 3444 if(countNumberstacks_in_65 < 0) { 3445 maxValuePercentstacks_in_65 = 1; 3446 } else { 3447 maxValuePercentstacks_in_65 = (0-countNumberstacks_in_65)/0; 3448 } 3449 } 3450 speedA = (2000/speed)*maxValuePercentstacks_in_65; 3451 opticStats("#stat_stacks_in_65").data("percent", maxValuePercentstacks_in_65*100); 3452 } 3453 opticStats('#stat_stacks_in_65').attr("data-animationstep", speedA); 3454 opticStats('#stat_stacks_in_65').circliful(); 3455 opticStats('#stat_stacks_in_65').waypoint(function(direction){ 3456 3457 // 3458// opticStats('#stacks_in_65 .counter').counterUp({ 3459// delay: 10, 3460// time: speed 3461// }); 3462 3463 var options = { 3464 // 3465 // 3466 separator : ',', 3467 decimal : '.', 3468 // 3469 // 3470 // 3471 useEasing : false 3472 }; 3473 opticStats('#stacks_in_65 .counter').attr("id", "count_stacks_in_65"); 3474 var count = new CountUp('count_stacks_in_65', 0, countNumberstacks_in_65, decimalLength, (1.9/speedA)*(maxValuePercentstacks_in_65), options);//(1.75/speedA)*(maxValuePercentstacks_in_65) 3475 count.start(); 3476 // 3477 // 3478 opticStats('#stat_stacks_in_65 .circle-text').append("%"); 3479 opticStats('#stat_stacks_in_65 .circle-text-half').append("%"); 3480 // 3481 // 3482 // 3483 // 3484 // 3485 scale(); 3486 this.destroy(); 3487 }, { offset: '100%' }); 3488 3489 3490}); 3491 3492opticStats( window ).resize(function() { 3493 scale(); 3494}); 3495function scale() { 3496 var width = 200, 3497 currentWidth = opticStats('#stat_stacks_in_65').parent().outerWidth(); 3498 if(currentWidth < width) { 3499 var scale = currentWidth/width; 3500 opticStats('#stat_stacks_in_65').css({ 3501 "transform" : "scale("+scale+")", 3502 "transform-origin" : "0px", 3503 "-o-transform" : "scale("+scale+")", 3504 "-o-transform-origin" : "0px" 3505 }); 3506 } else { 3507 opticStats('#stat_stacks_in_65').css({ 3508 "transform" : "scale(1)", 3509 "-o-transform" : "scale(1)" 3510 }); 3511 } 3512} 3513 3514return stack;})(stacks.stacks_in_65); 3515stacks.stacks_in_166 = {}; 3516stacks.stacks_in_166 = (function(stack) { 3517var jQuery = stacks.jQuery;var $ = jQuery;var opticStats = $; 3518/* 3519jquery-plugin-circliful 3520+The MIT License (MIT) 3521+ 3522+Copyright (c) 2014 Patric Gutersohn 3523+ 3524+Permission is hereby granted, free of charge, to any person obtaining a copy of 3525+this software and associated documentation files (the "Software"), to deal in 3526+the Software without restriction, including without limitation the rights to 3527+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 3528+the Software, and to permit persons to whom the Software is furnished to do so, 3529+subject to the following conditions: 3530+ 3531+The above copyright notice and this permission notice shall be included in all 3532+copies or substantial portions of the Software. 3533+ 3534+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 3535+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 3536+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 3537+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 3538+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 3539+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 3540*/ 3541"use strict"; 3542 3543(function (opticStats) { 3544 3545 opticStats.fn.circliful = function (options, callback) { 3546 3547 var settings = opticStats.extend({ 3548 // These are the defaults. 3549 startdegree: 0, 3550 fgcolor: "#556b2f", 3551 bgcolor: "#eee", 3552 fill: false, 3553 width: 15, 3554 dimension: 200, 3555 fontsize: 15, 3556 percent: 50, 3557 animationstep: 1.0, 3558 iconsize: '20px', 3559 iconcolor: '#999', 3560 border: 'default', 3561 complete: null, 3562 bordersize: 10 3563 }, options); 3564 3565 return this.each(function () { 3566 3567 var customSettings = ["fgcolor", "bgcolor", "fill", "width", "dimension", "fontsize", "animationstep", "endPercent", "icon", "iconcolor", "iconsize", "border", "startdegree", "bordersize"]; 3568 3569 var customSettingsObj = {}; 3570 var icon = ''; 3571 var percent; 3572 var endPercent = 0; 3573 var obj = opticStats(this); 3574 var fill = false;
3575 var text, info; 3576 3577 obj.addClass('circliful'); 3578 3579 checkDataAttributes(obj); 3580 3581 if (obj.data('text') != undefined) { 3582 3583 //remove non number characters 3584 3585 text = obj.data('text'); 3586 text = text.toString(); 3587 text = text.replace(/[^0-9.,]/g, ''); 3588 text = "<span class='counter'>" + text + "</span>"; 3589 3590 if (obj.data('icon') != undefined) { 3591 icon = opticStats('<i></i>') 3592 .addClass('osIcon fa ' + opticStats(this).data('icon')) 3593 .css({ 3594 'color': customSettingsObj.iconcolor, 3595 'font-size': customSettingsObj.iconsize, 3596 'line-height': customSettingsObj.iconsize + "px" 3597 }); 3598 } 3599 if (obj.data('icon-custom') != undefined) { 3600 icon = opticStats('<img src="'+opticStats(this).data("icon-custom")+'"></img>') 3601 .addClass('osIcon ') 3602 .css({ 3603 'width': customSettingsObj.iconsize, 3604 'height': customSettingsObj.iconsize 3605 }); 3606 } 3607 3608 if (obj.data('type') != undefined) { 3609 type = opticStats(this).data('type'); 3610 3611 if (type == 'half') { 3612 addCircleText(obj, 'circle-text-half', (customSettingsObj.dimension / 1.45)); 3613 } else { 3614 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 3615 } 3616 } else { 3617 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 3618 } 3619 } 3620 3621 if (opticStats(this).data("total") != undefined && opticStats(this).data("part") != undefined) { 3622 var total = opticStats(this).data("total") / 100; 3623 3624 percent = ((opticStats(this).data("part") / total) / 100).toFixed(3); 3625 endPercent = (opticStats(this).data("part") / total).toFixed(3); 3626 } else { 3627 if (opticStats(this).data("percent") != undefined) { 3628 percent = opticStats(this).data("percent") / 100; 3629 endPercent = opticStats(this).data("percent"); 3630 } else { 3631 percent = settings.percent / 100; 3632 } 3633 } 3634 3635 if (opticStats(this).data('info') != undefined) { 3636 info = opticStats(this).data('info'); 3637 3638 if (opticStats(this).data('type') != undefined) { 3639 type = opticStats(this).data('type'); 3640 3641 if (type == 'half') { 3642 addInfoText(obj, 0.9); 3643 } else { 3644 addInfoText(obj, 1.25); 3645 } 3646 } else { 3647 addInfoText(obj, 1.25); 3648 } 3649 } 3650 3651 opticStats(this).width(customSettingsObj.dimension + 'px'); 3652 if (type == 'line' || type == 'vert-line') { 3653 opticStats(this).height(opticStats(this).data('height') + 'px'); 3654 } else { 3655 opticStats(this).height(customSettingsObj.dimension + 'px'); 3656 } 3657 3658 3659 var sizeX = customSettingsObj.dimension, 3660 sizeY = customSettingsObj.dimension; 3661 if (type == 'line' || type == 'vert-line') { 3662 sizeY = opticStats(this).data('height'); 3663 } 3664 var canvas = opticStats('<canvas></canvas>').attr({ 3665 width: sizeX, 3666 height: sizeY 3667 }).appendTo(opticStats(this)).get(0); 3668 var context = canvas.getContext('2d'); 3669 3670 var dpr = window.devicePixelRatio; 3671 if ( dpr ) { 3672 var opticStatscanvas = opticStats(canvas); 3673 opticStatscanvas.css('width', sizeX); 3674 opticStatscanvas.css('height', sizeY); 3675 opticStatscanvas.attr('width', sizeX * dpr); 3676 opticStatscanvas.attr('height', sizeY * dpr); 3677 3678 context.scale(dpr, dpr); 3679 } 3680 3681 var container = opticStats(canvas).parent(); 3682 var x = sizeX / 2; 3683 var y = sizeY / 2; 3684 var degrees = customSettingsObj.percent * 360.0; 3685 var radians = degrees * (Math.PI / 180); 3686 var radius = sizeX / 2.5; 3687 var startAngle = 2.3 * Math.PI; 3688 var endAngle = 0; 3689 var counterClockwise = false; 3690 var curPerc = customSettingsObj.animationstep === 0.0 ? endPercent : 0.0; 3691 var curStep = Math.max(customSettingsObj.animationstep, 0.0); 3692 var circ = Math.PI * 2; 3693 var quart = Math.PI / 2; 3694 var type = ''; 3695 var fireCallback = true; 3696 var additionalAngelPI = (customSettingsObj.startdegree / 180) * Math.PI; 3697 3698 if (opticStats(this).data('type') != undefined) { 3699 type = opticStats(this).data('type'); 3700 if (type == 'half') { 3701 startAngle = 2.0 * Math.PI; 3702 endAngle = 3.14; 3703 circ = Math.PI; 3704 quart = Math.PI / 0.996; 3705 } else if (type == 'angle') { 3706 startAngle = 2.25 * Math.PI; 3707 endAngle = 2.4; 3708 circ = 1.53 + Math.PI; 3709 quart = 0.73 + Math.PI / 0.996; 3710 } 3711 } 3712 3713 /** 3714 * adds text to circle 3715 * 3716 * @param obj 3717 * @param cssClass 3718 * @param lineHeight 3719 */ 3720 opticStats(" > span", this).wrapAll("<div class='centerMe'><div></div></div>"); 3721 function addCircleText(obj, cssClass, lineHeight) { 3722 opticStats("<span></span>") 3723 .appendTo(obj) 3724 .addClass(cssClass) 3725 .html(text) 3726 .prepend(icon) 3727 .css({ 3728 //'line-height': lineHeight + 'px', 3729 'font-size': customSettingsObj.fontsize + 'px', 3730 'line-height': customSettingsObj.fontsize + 'px' 3731 }); 3732 } 3733 3734 /** 3735 * adds info text to circle 3736 * 3737 * @param obj 3738 * @param factor 3739 */ 3740 function addInfoText(obj, factor) { 3741 opticStats('<span></span>') 3742 .appendTo(obj) 3743 .addClass('circle-info-half') 3744 //.css( 3745 //'line-height', (customSettingsObj.dimension * factor) + 'px' 3746 //) 3747 .text(info); 3748 } 3749 3750 /** 3751 * checks which data attributes are defined 3752 * @param obj 3753 */ 3754 function checkDataAttributes(obj) { 3755 opticStats.each(customSettings, function (index, attribute) { 3756 if (obj.data(attribute) != undefined) { 3757 customSettingsObj[attribute] = obj.data(attribute); 3758 } else { 3759 customSettingsObj[attribute] = opticStats(settings).attr(attribute); 3760 } 3761 3762 if (attribute == 'fill' && obj.data('fill') != undefined) { 3763 fill = true; 3764 } 3765 }); 3766 } 3767 3768 //Animation Variables 3769 var inc = 0, counter=0,calm = 2,finishFrames=0, animationType = obj.data('animation-type'), slowTheInc = 0; 3770 // ---------------------- // 3771 // Animation Functions 3772 // ---------------------- // 3773 function blend(inColor,outColor,current){ 3774 var inColors = inColor.substring(inColor.indexOf('(') + 1, inColor.lastIndexOf(')')).split(/,\s*/), 3775 outColors = outColor.substring(outColor.indexOf('(') + 1, outColor.lastIndexOf(')')).split(/,\s*/), 3776 r,g,b,a,cur; 3777 for(var i=0; i<inColors.length; i++) { inColors[i] = parseInt(inColors[i], 10); } 3778 for(var i=0; i<outColors.length; i++) { outColors[i] = parseInt(outColors[i], 10); } 3779 if(current < .5 ) { 3780 cur = current*2; 3781 r = Math.min(255,Math.max(0, inColors[0] + (outColors[0] * cur))); 3782 g = Math.min(255,Math.max(0, inColors[1] + (outColors[1] * cur))); 3783 b = Math.min(255,Math.max(0, inColors[2] + (outColors[2] * cur))); 3784 } else { 3785 cur = (current-.5)*2; 3786 r = Math.min(255,Math.max(0,Math.max(inColors[0], outColors[0]) + ((outColors[0] - inColors[0]) * cur))); 3787 g = Math.min(255,Math.max(0,Math.max(inColors[1], outColors[1]) + ((outColors[1] - inColors[1]) * cur))); 3788 b = Math.min(255,Math.max(0,Math.max(inColors[2], outColors[2]) + ((outColors[2] - inColors[2]) * cur))); 3789 } 3790 var a = inColors[3]+((outColors[3] - inColors[3])*current);
3791 return 'rgba('+Math.floor(r)+', '+Math.floor(g)+', '+Math.floor(b)+', '+Math.floor(a)+')'; 3792 } 3793 if (type == 'line' || type == 'vert-line') { 3794 customSettingsObj.bordersize = customSettingsObj.bordersize*2; 3795 } 3796 var increaseInc = function(inc, current) { 3797 if (current >= 1) { 3798 // slowTheInc += 0.00002; 3799 // slowTheInc = Math.min(slowTheInc, 0.005); 3800 // inc = inc + (0.005-slowTheInc); 3801 } else { 3802 inc += 0.005; 3803 } 3804 return inc; 3805 } 3806 var moveColors = function(value, inc) { 3807 var pos = value+inc; 3808 pos = pos.toString(); 3809 pos = pos.split(".").pop(); 3810 pos = parseFloat("."+pos); 3811 return pos; 3812 } 3813 var createGrad = function(inc,sizeX, sizeY) { 3814 var grd=context.createLinearGradient(0,0,sizeX,sizeY); 3815 grd.addColorStop(moveColors(0, inc),"#FF0000"); 3816 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 3817 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 3818 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 3819 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 3820 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 3821 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 3822 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 3823 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 3824 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 3825 grd.addColorStop(moveColors(1, inc),"#FF0000"); 3826 return grd; 3827 } 3828 var shadowGlow = function() { 3829 context.shadowColor = customSettingsObj.fgcolor; 3830 context.shadowOffsetX = 0; 3831 context.shadowOffsetY = 0; 3832 context.shadowBlur = 10; 3833 } 3834 var drawBorder = function() { 3835 context.lineWidth = customSettingsObj.bordersize + 1; 3836 context.strokeStyle = customSettingsObj.bgcolor; 3837 context.stroke(); 3838 if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle') { 3839 // 3840 } else { 3841 context.fillStyle = customSettingsObj.fill; 3842 context.fill(); 3843 } 3844 context.beginPath(); 3845 context.save(); 3846 } 3847 var fillAnimation = function(animationType, current) { 3848 if(animationType == 1){ 3849 context.strokeStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 3850 context.stroke(); 3851 } else if(animationType == 2){ 3852 context.strokeStyle = customSettingsObj.fgcolor; 3853 if (type == 'line') { 3854 var grd=context.createLinearGradient(sizeX,0,0,0); 3855 grd.addColorStop(0,"white"); 3856 grd.addColorStop(1,customSettingsObj.fgcolor); 3857 context.strokeStyle = grd; 3858 shadowGlow(); 3859 } else if (type == 'vert-line') { 3860 var grd=context.createLinearGradient(0,0,0,sizeY); 3861 grd.addColorStop(0,"white"); 3862 grd.addColorStop(1,customSettingsObj.fgcolor); 3863 context.strokeStyle = grd; 3864 shadowGlow(); 3865 } else { 3866 var grd = context.createRadialGradient(sizeX/2, sizeY/2, (sizeX+customSettingsObj.bordersize*2)/2.5, sizeY/2, sizeX/2, (sizeY-customSettingsObj.bordersize*2)/2.5); 3867 grd.addColorStop(0, customSettingsObj.fgcolor); 3868 grd.addColorStop(0.5, 'white'); 3869 grd.addColorStop(1, customSettingsObj.fgcolor); 3870 context.strokeStyle = grd; 3871 shadowGlow(); 3872 } 3873 context.stroke(); 3874 context.restore(); 3875 } else if(animationType == 3){ 3876 if (type == 'line') { 3877 var grd = createGrad(inc,sizeX,sizeY); 3878 inc = increaseInc(inc,current); 3879 context.strokeStyle = grd; 3880 } else if (type == 'vert-line') { 3881 var grd=context.createLinearGradient(sizeX/2,0,sizeX/2,sizeY); 3882 grd.addColorStop(moveColors(0, inc),"#FF0000"); 3883 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 3884 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 3885 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 3886 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 3887 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 3888 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 3889 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 3890 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 3891 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 3892 grd.addColorStop(moveColors(1, inc),"#FF0000"); 3893 inc = increaseInc(inc,current); 3894 context.strokeStyle = grd; 3895 } else { 3896 var grd = createGrad(inc,sizeX,sizeY); 3897 inc = increaseInc(inc,current); 3898 context.strokeStyle = grd; 3899 } 3900 context.stroke();
3901 context.restore(); 3902 } else { 3903 context.strokeStyle = customSettingsObj.fgcolor; 3904 context.stroke(); 3905 } 3906 } 3907 // ---------------------- // 3908 // Animation 3909 // ---------------------- // 3910 function animate(current) { 3911 //Clear Canvas for next frame 3912 context.clearRect(0, 0, canvas.width, canvas.height); 3913 //Draw Background 3914 if (type == 'line' || type == 'vert-line') { 3915 context.rect(10, 10, sizeX-20, sizeY-20); 3916 } else if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle' || type == 'full' || type == 'half') { 3917 context.beginPath(); 3918 context.arc(x, y, radius, endAngle, startAngle, false); 3919 } 3920 context.fillStyle = customSettingsObj.fill; 3921 context.fill(); 3922 if (type == 'line') { 3923 context.beginPath(); 3924 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 3925 context.lineTo(sizeX-10,sizeY-(customSettingsObj.bordersize/2+10)); 3926 drawBorder(); 3927 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 3928 context.lineTo(Math.min((sizeX-20) * current+10,sizeX-10),sizeY-(customSettingsObj.bordersize/2+10)); 3929 fillAnimation(animationType,current); 3930 } else if (type == 'vert-line'){ 3931 context.beginPath(); 3932 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 3933 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),10); 3934 drawBorder(); 3935 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 3936 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),Math.max((sizeY-20) * (1-current)+10,10)); 3937 fillAnimation(animationType,current); 3938 } else if (type == 'full' || type=='half') { 3939 drawBorder(); 3940 context.arc(x, y, radius, -(quart) + additionalAngelPI, ((circ) * (Math.min(current,1)+.005)) - quart + additionalAngelPI, false); 3941 fillAnimation(animationType,current); 3942 } else if (type == 'grow-circle') { 3943 drawBorder(); 3944 var fillRadius = sizeX/2.5*Math.min(current,1); 3945 context.arc(sizeX/2, sizeY/2, Math.max(fillRadius-customSettingsObj.bordersize/2,0), endAngle, startAngle, false); 3946 if(animationType == 1){ 3947 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 3948 context.fill(); 3949 } else if(animationType == 2){ 3950 var grd=context.createLinearGradient(0,0,0,sizeY); 3951 grd.addColorStop(0,"white"); 3952 grd.addColorStop(1,customSettingsObj.fgcolor); 3953 shadowGlow(); 3954 context.fillStyle = grd; 3955 context.fill(); 3956 } else if(animationType == 3){ 3957 var grd = createGrad(inc,sizeX,sizeY); 3958 inc = increaseInc(inc,current); 3959 context.fillStyle = grd; 3960 context.fill(); 3961 } else { 3962 context.fillStyle = customSettingsObj.fgcolor; 3963 context.fill(); 3964 } 3965 context.restore(); 3966 } else if (type == 'fill-circle') { 3967 drawBorder(); 3968 var fillRadius = sizeX/2.5, 3969 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 3970 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 3971 if(animationType == 1){ 3972 context.clip(); 3973 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 3974 context.fillRect(0, fillLine, sizeX, sizeY); 3975 } else if(animationType == 2){ 3976 var grd=context.createLinearGradient(0,0,0,sizeY); 3977 grd.addColorStop(0,"white"); 3978 grd.addColorStop(1,customSettingsObj.fgcolor); 3979 shadowGlow(); 3980 context.clip(); 3981 context.fillStyle = grd; 3982 context.fillRect(0, fillLine, sizeX, sizeY); 3983 3984 } else if(animationType == 3){ 3985 context.clip(); 3986 var grd = createGrad(inc,sizeX, sizeY); 3987 inc = increaseInc(inc,current); 3988 context.fillStyle = grd; 3989 context.fillRect(0, fillLine, sizeX, sizeY); 3990 } else { 3991 context.clip(); 3992 context.fillStyle = customSettingsObj.fgcolor; 3993 context.fillRect(0, fillLine, sizeX, sizeY); 3994 }
3995 context.restore(); 3996 } else if (type == 'fill-circle-wave') { 3997 drawBorder(); 3998 var fillRadius = sizeX/2.5, 3999 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 4000 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 4001 var ypos=fillLine, xpos=0; 4002 counter += .1; 4003 counterLoop = counter; 4004 var increase = 2*Math.PI / 12; 4005 context.clip(); 4006 context.beginPath(); 4007 context.moveTo(sizeX,sizeY); 4008 context.lineTo(0,sizeY); 4009 context.lineTo(0,ypos); 4010 if (curPerc > endPercent) { 4011 calm-=.01; 4012 if(calm<0) calm=0; 4013 } 4014 for(i=0; i<=sizeX; i+=10){ 4015 xpos = i; 4016 ypos = ypos - Math.sin(counterLoop) * calm; 4017 counterLoop += increase; 4018 context.lineTo(xpos,ypos); 4019 } 4020 context.lineTo(sizeX,sizeY); 4021 context.closePath(); 4022 if(animationType == 1){ 4023 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 4024 context.fill(); 4025 } else if(animationType == 2){ 4026 var grd=context.createLinearGradient(0,0,0,sizeY); 4027 grd.addColorStop(0,"white"); 4028 grd.addColorStop(1,customSettingsObj.fgcolor); 4029 shadowGlow(); 4030 context.clip(); 4031 context.fillStyle = grd; 4032 context.fill(); 4033 } else if(animationType == 3){ 4034 context.clip(); 4035 var grd = createGrad(inc,sizeX,sizeY); 4036 inc = increaseInc(inc,current); 4037 context.fillStyle = grd; 4038 context.fill(); 4039 } else { 4040 context.clip(); 4041 context.fillStyle = customSettingsObj.fgcolor; 4042 context.fill(); 4043 } 4044 context.restore(); 4045 } 4046 4047 if (curPerc < endPercent) { 4048 curPerc += curStep; 4049 requestAnimationFrame(function () { 4050 context.strokeStyle = customSettingsObj.fgcolor; 4051 animate(Math.min(curPerc, endPercent) / 100); 4052 }, obj); 4053 } else if(finishFrames < 500) { 4054 curPerc += curStep; 4055 finishFrames+=1; 4056 requestAnimationFrame(function () { 4057 context.strokeStyle = customSettingsObj.fgcolor; 4058 animate(Math.min(curPerc, endPercent) / 100); 4059 }, obj); 4060 } 4061 4062 if (curPerc == endPercent && fireCallback && typeof(options) != "undefined") { 4063 if (opticStats.isFunction(options.complete)) { 4064 options.complete(); 4065 4066 fireCallback = false; 4067 } 4068 } 4069 } 4070 obj.waypoint(function(direction){ 4071 animate(curPerc / 100); 4072 this.destroy(); 4073 }, { offset: '100%' }); 4074 }); 4075 }; 4076}(opticStats)); 4077/* 4078 The MIT License (MIT) 4079 CountUp 4080+Copyright (c) 2014-2015 Jamie Perkins 4081 Permission is hereby granted, free of charge, to any person obtaining a copy of 4082 this software and associated documentation files (the "Software"), to deal in 4083*/ 4084!function(t,a){"function"==typeof define&&define.amd?define(a):"object"==typeof exports?module.exports=a(require,exports,module):t.CountUp=a()}(this,function(){var t=function(t,a,e,n,i,r){for(var o=0,s=["webkit","moz","ms","o"],u=0;u<s.length&&!window.requestAnimationFrame;++u)window.requestAnimationFrame=window[s[u]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[s[u]+"CancelAnimationFrame"]||window[s[u]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var a=(new Date).getTime(),e=Math.max(0,16-(a-o)),n=window.setTimeout(function(){t(a+e)},e);return o=a+e,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),this.options={useEasing:!0,useGrouping:!0,separator:",",decimal:"."};for(var m in r)r.hasOwnProperty(m)&&(this.options[m]=r[m]);""===this.options.separator&&(this.options.useGrouping=!1),this.options.prefix||(this.options.prefix=""),this.options.suffix||(this.options.suffix=""),this.d="string"==typeof t?document.getElementById(t):t,this.startVal=Number(a),this.endVal=Number(e),this.countDown=this.startVal>this.endVal,this.frameVal=this.startVal,this.decimals=Math.max(0,n||0),this.dec=Math.pow(10,this.decimals),this.duration=1e3*Number(i)||2e3;var l=this;this.version=function(){return"1.6.0"},this.printValue=function(t){var a=isNaN(t)?"--":l.formatNumber(t);"INPUT"==l.d.tagName?this.d.value=a:"text"==l.d.tagName||"tspan"==l.d.tagName?this.d.textContent=a:this.d.innerHTML=a},this.easeOutExpo=function(t,a,e,n){return e*(-Math.pow(2,-10*t/n)+1)*1024/1023+a},this.count=function(t){l.startTime||(l.startTime=t),l.timestamp=t;var a=t-l.startTime;l.remaining=l.duration-a,l.frameVal=l.options.useEasing?l.countDown?l.startVal-l.easeOutExpo(a,0,l.startVal-l.endVal,l.duration):l.easeOutExpo(a,l.startVal,l.endVal-l.startVal,l.duration):l.countDown?l.startVal-(l.startVal-l.endVal)*(a/l.duration):l.startVal+(l.endVal-l.startVal)*(a/l.duration),l.frameVal=l.countDown?l.frameVal<l.endVal?l.endVal:l.frameVal:l.frameVal>l.endVal?l.endVal:l.frameVal,l.frameVal=Math.round(l.frameVal*l.dec)/l.dec,l.printValue(l.frameVal),a<l.duration?l.rAF=requestAnimationFrame(l.count):l.callback&&l.callback()},this.start=function(t){return l.callback=t,l.rAF=requestAnimationFrame(l.count),!1},this.pauseResume=function(){l.paused?(l.paused=!1,delete l.startTime,l.duration=l.remaining,l.startVal=l.frameVal,requestAnimationFrame(l.count)):(l.paused=!0,cancelAnimationFrame(l.rAF))},this.reset=function(){l.paused=!1,delete l.startTime,l.startVal=a,cancelAnimationFrame(l.rAF),l.printValue(l.startVal)},this.update=function(t){cancelAnimationFrame(l.rAF),l.paused=!1,delete l.startTime,l.startVal=l.frameVal,l.endVal=Number(t),l.countDown=l.startVal>l.endVal,l.rAF=requestAnimationFrame(l.count)},this.formatNumber=function(t){t=t.toFixed(l.decimals),t+="";var a,e,n,i;if(a=t.split("."),e=a[0],n=a.length>1?l.options.decimal+a[1]:"",i=/(\d+)(\d{3})/,l.options.useGrouping)for(;i.test(e);)e=e.replace(i,"$1"+l.options.separator+"$2");return l.options.prefix+e+n+l.options.suffix},l.printValue(l.startVal)};return t}); 4085/*! 4086Waypoints - 4.0.0 4087Copyright © 2011-2015 Caleb Troughton 4088Licensed under the MIT license. 4089https://github.com/imakewebthings/waypoints/blob/master/licenses.txt 4090*/ 4091!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");
vendor: 6,526 bytes, line 4091
4091this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],r
4091ight:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.opticStatselement=e(t)}var e=opticStats,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.opticStatselement[i].apply(this.opticStatselement,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;opticStats&&(opticStats.fn.waypoint=t(opticStats)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); 4092 4093opticStats( document ).ready(function() { 4094 var speed = 3000, 4095 countNumberstacks_in_166 = "100", 4096 decimalNumber = '0', 4097 decimalNumber = decimalNumber.replace(/\D/g,''), 4098 decimalLength = decimalNumber.length, 4099 maxValuePercentstacks_in_166 = (countNumberstacks_in_166/100), 4100 speedA = (2000/speed)*maxValuePercentstacks_in_166; 4101 if (100 == 0) { 4102 if(countNumberstacks_in_166 < 0) { 4103 maxValuePercentstacks_in_166 = 1; 4104 } else { 4105 maxValuePercentstacks_in_166 = (0-countNumberstacks_in_166)/0; 4106 } 4107 } 4108 if('False' == 'False' ) { 4109 decimalLength = 0; 4110 } else { 4111 countNumberstacks_in_166 = countNumberstacks_in_166.replace(/\D/g,''); 4112 countNumberstacks_in_166 = countNumberstacks_in_166+"."+decimalNumber; 4113 } 4114 if('False' == 'True' ) { 4115 var items = readData_data(opticStats("#data")); 4116 countNumberstacks_in_166 = items['data-A1']; 4117 if(countNumberstacks_in_166 == null) { 4118 countNumberstacks_in_166 = '0'; 4119 } 4120 opticStats("#stat_stacks_in_166").data("percent", maxValuePercentstacks_in_166*100); 4121 // 4122 // 4123 if(countNumberstacks_in_166.indexOf(".") !== -1) { 4124 decimalNumber = countNumberstacks_in_166.substr(countNumberstacks_in_166.indexOf(".") + 1); 4125 decimalNumber = decimalNumber.replace(/\D/g,''); 4126 decimalLength = decimalNumber.length; 4127 countNumberstacks_in_166 = countNumberstacks_in_166.substr(0, countNumberstacks_in_166.indexOf('.')); 4128 } 4129 // 4130 // 4131 countNumberstacks_in_166 = countNumberstacks_in_166.replace(/[^0-9\-]/g,''); 4132 countNumberstacks_in_166 = countNumberstacks_in_166+"."+decimalNumber; 4133 maxValuePercentstacks_in_166 = (countNumberstacks_in_166/100); 4134 if (100 == 0) { 4135 if(countNumberstacks_in_166 < 0) { 4136 maxValuePercentstacks_in_166 = 1; 4137 } else { 4138 maxValuePercentstacks_in_166 = (0-countNumberstacks_in_166)/0; 4139 } 4140 } 4141 speedA = (2000/speed)*maxValuePercentstacks_in_166; 4142 opticStats("#stat_stacks_in_166").data("percent", maxValuePercentstacks_in_166*100); 4143 } else { 4144 var maxValuePercentstacks_in_166 = (countNumberstacks_in_166/100); 4145 if (100 == 0) { 4146 if(countNumberstacks_in_166 < 0) { 4147 maxValuePercentstacks_in_166 = 1; 4148 } else { 4149 maxValuePercentstacks_in_166 = (0-countNumberstacks_in_166)/0; 4150 } 4151 } 4152 speedA = (2000/speed)*maxValuePercentstacks_in_166; 4153 opticStats("#stat_stacks_in_166").data("percent", maxValuePercentstacks_in_166*100); 4154 } 4155 opticStats('#stat_stacks_in_166').attr("data-animationstep", speedA); 4156 opticStats('#stat_stacks_in_166').circliful(); 4157 opticStats('#stat_stacks_in_166').waypoint(function(direction){ 4158 4159 // 4160// opticStats('#stacks_in_166 .counter').counterUp({ 4161// delay: 10, 4162// time: speed 4163// }); 4164 4165 var options = { 4166 // 4167 // 4168 separator : ',', 4169 decimal : '.', 4170 // 4171 // 4172 // 4173 useEasing : false 4174 }; 4175 opticStats('#stacks_in_166 .counter').attr("id", "count_stacks_in_166"); 4176 var count = new CountUp('count_stacks_in_166', 0, countNumberstacks_in_166, decimalLength, (1.9/speedA)*(maxValuePercentstacks_in_166), options);//(1.75/speedA)*(maxValuePercentstacks_in_166) 4177 count.start(); 4178 // 4179 // 4180 opticStats('#stat_stacks_in_166 .circle-text').append("%"); 4181 opticStats('#stat_stacks_in_166 .circle-text-half').append("%"); 4182 // 4183 // 4184 // 4185 // 4186 // 4187 scale(); 4188 this.destroy(); 4189 }, { offset: '100%' }); 4190 4191 4192}); 4193 4194opticStats( window ).resize(function() { 4195 scale(); 4196}); 4197function scale() { 4198 var width = 200, 4199 currentWidth = opticStats('#stat_stacks_in_166').parent().outerWidth(); 4200 if(currentWidth < width) { 4201 var scale = currentWidth/width; 4202 opticStats('#stat_stacks_in_166').css({ 4203 "transform" : "scale("+scale+")", 4204 "transform-origin" : "0px", 4205 "-o-transform" : "scale("+scale+")", 4206 "-o-transform-origin" : "0px" 4207 }); 4208 } else { 4209 opticStats('#stat_stacks_in_166').css({ 4210 "transform" : "scale(1)", 4211 "-o-transform" : "scale(1)" 4212 }); 4213 } 4214} 4215 4216return stack;})(stacks.stacks_in_166); 4217stacks.stacks_in_103 = {}; 4218stacks.stacks_in_103 = (function(stack) { 4219var jQuery = stacks.jQuery;var $ = jQuery;var opticStats = $; 4220/* 4221jquery-plugin-circliful 4222+The MIT License (MIT) 4223+ 4224+Copyright (c) 2014 Patric Gutersohn 4225+ 4226+Permission is hereby granted, free of charge, to any person obtaining a copy of 4227+this software and associated documentation files (the "Software"), to deal in 4228+the Software without restriction, including without limitation the rights to 4229+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 4230+the Software, and to permit persons to whom the Software is furnished to do so, 4231+subject to the following conditions: 4232+ 4233+The above copyright notice and this permission notice shall be included in all 4234+copies or substantial portions of the Software. 4235+ 4236+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4237+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 4238+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 4239+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 4240+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 4241+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 4242*/ 4243"use strict"; 4244 4245(function (opticStats) { 4246 4247 opticStats.fn.circliful = function (options, callback) { 4248 4249 var settings = opticStats.extend({ 4250 // These are the defaults. 4251 startdegree: 0, 4252 fgcolor: "#556b2f", 4253 bgcolor: "#eee", 4254 fill: false, 4255 width: 15, 4256 dimension: 200, 4257 fontsize: 15, 4258 percent: 50, 4259 animationstep: 1.0, 4260 iconsize: '20px', 4261 iconcolor: '#999', 4262 border: 'default', 4263 complete: null, 4264 bordersize: 10 4265 }, options); 4266 4267 return this.each(function () { 4268 4269 var customSettings = ["fgcolor", "bgcolor", "fill", "width", "dimension", "fontsize", "animationstep", "endPercent", "icon", "iconcolor", "iconsize", "border", "startdegree", "bordersize"]; 4270 4271 var customSettingsObj = {}; 4272 var icon = ''; 4273 var percent; 4274 var endPercent = 0; 4275 var obj = opticStats(this); 4276 var fill = false;
4277 var text, info; 4278 4279 obj.addClass('circliful'); 4280 4281 checkDataAttributes(obj); 4282 4283 if (obj.data('text') != undefined) { 4284 4285 //remove non number characters 4286 4287 text = obj.data('text'); 4288 text = text.toString(); 4289 text = text.replace(/[^0-9.,]/g, ''); 4290 text = "<span class='counter'>" + text + "</span>"; 4291 4292 if (obj.data('icon') != undefined) { 4293 icon = opticStats('<i></i>') 4294 .addClass('osIcon fa ' + opticStats(this).data('icon')) 4295 .css({ 4296 'color': customSettingsObj.iconcolor, 4297 'font-size': customSettingsObj.iconsize, 4298 'line-height': customSettingsObj.iconsize + "px" 4299 }); 4300 } 4301 if (obj.data('icon-custom') != undefined) { 4302 icon = opticStats('<img src="'+opticStats(this).data("icon-custom")+'"></img>') 4303 .addClass('osIcon ') 4304 .css({ 4305 'width': customSettingsObj.iconsize, 4306 'height': customSettingsObj.iconsize 4307 }); 4308 } 4309 4310 if (obj.data('type') != undefined) { 4311 type = opticStats(this).data('type'); 4312 4313 if (type == 'half') { 4314 addCircleText(obj, 'circle-text-half', (customSettingsObj.dimension / 1.45)); 4315 } else { 4316 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 4317 } 4318 } else { 4319 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 4320 } 4321 } 4322 4323 if (opticStats(this).data("total") != undefined && opticStats(this).data("part") != undefined) { 4324 var total = opticStats(this).data("total") / 100; 4325 4326 percent = ((opticStats(this).data("part") / total) / 100).toFixed(3); 4327 endPercent = (opticStats(this).data("part") / total).toFixed(3); 4328 } else { 4329 if (opticStats(this).data("percent") != undefined) { 4330 percent = opticStats(this).data("percent") / 100; 4331 endPercent = opticStats(this).data("percent"); 4332 } else { 4333 percent = settings.percent / 100; 4334 } 4335 } 4336 4337 if (opticStats(this).data('info') != undefined) { 4338 info = opticStats(this).data('info'); 4339 4340 if (opticStats(this).data('type') != undefined) { 4341 type = opticStats(this).data('type'); 4342 4343 if (type == 'half') { 4344 addInfoText(obj, 0.9); 4345 } else { 4346 addInfoText(obj, 1.25); 4347 } 4348 } else { 4349 addInfoText(obj, 1.25); 4350 } 4351 } 4352 4353 opticStats(this).width(customSettingsObj.dimension + 'px'); 4354 if (type == 'line' || type == 'vert-line') { 4355 opticStats(this).height(opticStats(this).data('height') + 'px'); 4356 } else { 4357 opticStats(this).height(customSettingsObj.dimension + 'px'); 4358 } 4359 4360 4361 var sizeX = customSettingsObj.dimension, 4362 sizeY = customSettingsObj.dimension; 4363 if (type == 'line' || type == 'vert-line') { 4364 sizeY = opticStats(this).data('height'); 4365 } 4366 var canvas = opticStats('<canvas></canvas>').attr({ 4367 width: sizeX, 4368 height: sizeY 4369 }).appendTo(opticStats(this)).get(0); 4370 var context = canvas.getContext('2d'); 4371 4372 var dpr = window.devicePixelRatio; 4373 if ( dpr ) { 4374 var opticStatscanvas = opticStats(canvas); 4375 opticStatscanvas.css('width', sizeX); 4376 opticStatscanvas.css('height', sizeY); 4377 opticStatscanvas.attr('width', sizeX * dpr); 4378 opticStatscanvas.attr('height', sizeY * dpr); 4379 4380 context.scale(dpr, dpr); 4381 } 4382 4383 var container = opticStats(canvas).parent(); 4384 var x = sizeX / 2; 4385 var y = sizeY / 2; 4386 var degrees = customSettingsObj.percent * 360.0; 4387 var radians = degrees * (Math.PI / 180); 4388 var radius = sizeX / 2.5; 4389 var startAngle = 2.3 * Math.PI; 4390 var endAngle = 0; 4391 var counterClockwise = false; 4392 var curPerc = customSettingsObj.animationstep === 0.0 ? endPercent : 0.0; 4393 var curStep = Math.max(customSettingsObj.animationstep, 0.0); 4394 var circ = Math.PI * 2; 4395 var quart = Math.PI / 2; 4396 var type = ''; 4397 var fireCallback = true; 4398 var additionalAngelPI = (customSettingsObj.startdegree / 180) * Math.PI; 4399 4400 if (opticStats(this).data('type') != undefined) { 4401 type = opticStats(this).data('type'); 4402 if (type == 'half') { 4403 startAngle = 2.0 * Math.PI; 4404 endAngle = 3.14; 4405 circ = Math.PI; 4406 quart = Math.PI / 0.996; 4407 } else if (type == 'angle') { 4408 startAngle = 2.25 * Math.PI; 4409 endAngle = 2.4; 4410 circ = 1.53 + Math.PI; 4411 quart = 0.73 + Math.PI / 0.996; 4412 } 4413 } 4414 4415 /** 4416 * adds text to circle 4417 * 4418 * @param obj 4419 * @param cssClass 4420 * @param lineHeight 4421 */ 4422 opticStats(" > span", this).wrapAll("<div class='centerMe'><div></div></div>"); 4423 function addCircleText(obj, cssClass, lineHeight) { 4424 opticStats("<span></span>") 4425 .appendTo(obj) 4426 .addClass(cssClass) 4427 .html(text) 4428 .prepend(icon) 4429 .css({ 4430 //'line-height': lineHeight + 'px', 4431 'font-size': customSettingsObj.fontsize + 'px', 4432 'line-height': customSettingsObj.fontsize + 'px' 4433 }); 4434 } 4435 4436 /** 4437 * adds info text to circle 4438 * 4439 * @param obj 4440 * @param factor 4441 */ 4442 function addInfoText(obj, factor) { 4443 opticStats('<span></span>') 4444 .appendTo(obj) 4445 .addClass('circle-info-half') 4446 //.css( 4447 //'line-height', (customSettingsObj.dimension * factor) + 'px' 4448 //) 4449 .text(info); 4450 } 4451 4452 /** 4453 * checks which data attributes are defined 4454 * @param obj 4455 */ 4456 function checkDataAttributes(obj) { 4457 opticStats.each(customSettings, function (index, attribute) { 4458 if (obj.data(attribute) != undefined) { 4459 customSettingsObj[attribute] = obj.data(attribute); 4460 } else { 4461 customSettingsObj[attribute] = opticStats(settings).attr(attribute); 4462 } 4463 4464 if (attribute == 'fill' && obj.data('fill') != undefined) { 4465 fill = true; 4466 } 4467 }); 4468 } 4469 4470 //Animation Variables 4471 var inc = 0, counter=0,calm = 2,finishFrames=0, animationType = obj.data('animation-type'), slowTheInc = 0; 4472 // ---------------------- // 4473 // Animation Functions 4474 // ---------------------- // 4475 function blend(inColor,outColor,current){ 4476 var inColors = inColor.substring(inColor.indexOf('(') + 1, inColor.lastIndexOf(')')).split(/,\s*/), 4477 outColors = outColor.substring(outColor.indexOf('(') + 1, outColor.lastIndexOf(')')).split(/,\s*/), 4478 r,g,b,a,cur; 4479 for(var i=0; i<inColors.length; i++) { inColors[i] = parseInt(inColors[i], 10); } 4480 for(var i=0; i<outColors.length; i++) { outColors[i] = parseInt(outColors[i], 10); } 4481 if(current < .5 ) { 4482 cur = current*2; 4483 r = Math.min(255,Math.max(0, inColors[0] + (outColors[0] * cur))); 4484 g = Math.min(255,Math.max(0, inColors[1] + (outColors[1] * cur))); 4485 b = Math.min(255,Math.max(0, inColors[2] + (outColors[2] * cur))); 4486 } else { 4487 cur = (current-.5)*2; 4488 r = Math.min(255,Math.max(0,Math.max(inColors[0], outColors[0]) + ((outColors[0] - inColors[0]) * cur))); 4489 g = Math.min(255,Math.max(0,Math.max(inColors[1], outColors[1]) + ((outColors[1] - inColors[1]) * cur))); 4490 b = Math.min(255,Math.max(0,Math.max(inColors[2], outColors[2]) + ((outColors[2] - inColors[2]) * cur))); 4491 } 4492 var a = inColors[3]+((outColors[3] - inColors[3])*current);
4493 return 'rgba('+Math.floor(r)+', '+Math.floor(g)+', '+Math.floor(b)+', '+Math.floor(a)+')'; 4494 } 4495 if (type == 'line' || type == 'vert-line') { 4496 customSettingsObj.bordersize = customSettingsObj.bordersize*2; 4497 } 4498 var increaseInc = function(inc, current) { 4499 if (current >= 1) { 4500 // slowTheInc += 0.00002; 4501 // slowTheInc = Math.min(slowTheInc, 0.005); 4502 // inc = inc + (0.005-slowTheInc); 4503 } else { 4504 inc += 0.005; 4505 } 4506 return inc; 4507 } 4508 var moveColors = function(value, inc) { 4509 var pos = value+inc; 4510 pos = pos.toString(); 4511 pos = pos.split(".").pop(); 4512 pos = parseFloat("."+pos); 4513 return pos; 4514 } 4515 var createGrad = function(inc,sizeX, sizeY) { 4516 var grd=context.createLinearGradient(0,0,sizeX,sizeY); 4517 grd.addColorStop(moveColors(0, inc),"#FF0000"); 4518 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 4519 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 4520 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 4521 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 4522 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 4523 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 4524 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 4525 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 4526 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 4527 grd.addColorStop(moveColors(1, inc),"#FF0000"); 4528 return grd; 4529 } 4530 var shadowGlow = function() { 4531 context.shadowColor = customSettingsObj.fgcolor; 4532 context.shadowOffsetX = 0; 4533 context.shadowOffsetY = 0; 4534 context.shadowBlur = 10; 4535 } 4536 var drawBorder = function() { 4537 context.lineWidth = customSettingsObj.bordersize + 1; 4538 context.strokeStyle = customSettingsObj.bgcolor; 4539 context.stroke(); 4540 if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle') { 4541 // 4542 } else { 4543 context.fillStyle = customSettingsObj.fill; 4544 context.fill(); 4545 } 4546 context.beginPath(); 4547 context.save(); 4548 } 4549 var fillAnimation = function(animationType, current) { 4550 if(animationType == 1){ 4551 context.strokeStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 4552 context.stroke(); 4553 } else if(animationType == 2){ 4554 context.strokeStyle = customSettingsObj.fgcolor; 4555 if (type == 'line') { 4556 var grd=context.createLinearGradient(sizeX,0,0,0); 4557 grd.addColorStop(0,"white"); 4558 grd.addColorStop(1,customSettingsObj.fgcolor); 4559 context.strokeStyle = grd; 4560 shadowGlow(); 4561 } else if (type == 'vert-line') { 4562 var grd=context.createLinearGradient(0,0,0,sizeY); 4563 grd.addColorStop(0,"white"); 4564 grd.addColorStop(1,customSettingsObj.fgcolor); 4565 context.strokeStyle = grd; 4566 shadowGlow(); 4567 } else { 4568 var grd = context.createRadialGradient(sizeX/2, sizeY/2, (sizeX+customSettingsObj.bordersize*2)/2.5, sizeY/2, sizeX/2, (sizeY-customSettingsObj.bordersize*2)/2.5); 4569 grd.addColorStop(0, customSettingsObj.fgcolor); 4570 grd.addColorStop(0.5, 'white'); 4571 grd.addColorStop(1, customSettingsObj.fgcolor); 4572 context.strokeStyle = grd; 4573 shadowGlow(); 4574 } 4575 context.stroke(); 4576 context.restore(); 4577 } else if(animationType == 3){ 4578 if (type == 'line') { 4579 var grd = createGrad(inc,sizeX,sizeY); 4580 inc = increaseInc(inc,current); 4581 context.strokeStyle = grd; 4582 } else if (type == 'vert-line') { 4583 var grd=context.createLinearGradient(sizeX/2,0,sizeX/2,sizeY); 4584 grd.addColorStop(moveColors(0, inc),"#FF0000"); 4585 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 4586 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 4587 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 4588 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 4589 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 4590 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 4591 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 4592 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 4593 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 4594 grd.addColorStop(moveColors(1, inc),"#FF0000"); 4595 inc = increaseInc(inc,current); 4596 context.strokeStyle = grd; 4597 } else { 4598 var grd = createGrad(inc,sizeX,sizeY); 4599 inc = increaseInc(inc,current); 4600 context.strokeStyle = grd; 4601 } 4602 context.stroke();
4603 context.restore(); 4604 } else { 4605 context.strokeStyle = customSettingsObj.fgcolor; 4606 context.stroke(); 4607 } 4608 } 4609 // ---------------------- // 4610 // Animation 4611 // ---------------------- // 4612 function animate(current) { 4613 //Clear Canvas for next frame 4614 context.clearRect(0, 0, canvas.width, canvas.height); 4615 //Draw Background 4616 if (type == 'line' || type == 'vert-line') { 4617 context.rect(10, 10, sizeX-20, sizeY-20); 4618 } else if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle' || type == 'full' || type == 'half') { 4619 context.beginPath(); 4620 context.arc(x, y, radius, endAngle, startAngle, false); 4621 } 4622 context.fillStyle = customSettingsObj.fill; 4623 context.fill(); 4624 if (type == 'line') { 4625 context.beginPath(); 4626 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 4627 context.lineTo(sizeX-10,sizeY-(customSettingsObj.bordersize/2+10)); 4628 drawBorder(); 4629 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 4630 context.lineTo(Math.min((sizeX-20) * current+10,sizeX-10),sizeY-(customSettingsObj.bordersize/2+10)); 4631 fillAnimation(animationType,current); 4632 } else if (type == 'vert-line'){ 4633 context.beginPath(); 4634 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 4635 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),10); 4636 drawBorder(); 4637 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 4638 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),Math.max((sizeY-20) * (1-current)+10,10)); 4639 fillAnimation(animationType,current); 4640 } else if (type == 'full' || type=='half') { 4641 drawBorder(); 4642 context.arc(x, y, radius, -(quart) + additionalAngelPI, ((circ) * (Math.min(current,1)+.005)) - quart + additionalAngelPI, false); 4643 fillAnimation(animationType,current); 4644 } else if (type == 'grow-circle') { 4645 drawBorder(); 4646 var fillRadius = sizeX/2.5*Math.min(current,1); 4647 context.arc(sizeX/2, sizeY/2, Math.max(fillRadius-customSettingsObj.bordersize/2,0), endAngle, startAngle, false); 4648 if(animationType == 1){ 4649 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 4650 context.fill(); 4651 } else if(animationType == 2){ 4652 var grd=context.createLinearGradient(0,0,0,sizeY); 4653 grd.addColorStop(0,"white"); 4654 grd.addColorStop(1,customSettingsObj.fgcolor); 4655 shadowGlow(); 4656 context.fillStyle = grd; 4657 context.fill(); 4658 } else if(animationType == 3){ 4659 var grd = createGrad(inc,sizeX,sizeY); 4660 inc = increaseInc(inc,current); 4661 context.fillStyle = grd; 4662 context.fill(); 4663 } else { 4664 context.fillStyle = customSettingsObj.fgcolor; 4665 context.fill(); 4666 } 4667 context.restore(); 4668 } else if (type == 'fill-circle') { 4669 drawBorder(); 4670 var fillRadius = sizeX/2.5, 4671 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 4672 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 4673 if(animationType == 1){ 4674 context.clip(); 4675 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 4676 context.fillRect(0, fillLine, sizeX, sizeY); 4677 } else if(animationType == 2){ 4678 var grd=context.createLinearGradient(0,0,0,sizeY); 4679 grd.addColorStop(0,"white"); 4680 grd.addColorStop(1,customSettingsObj.fgcolor); 4681 shadowGlow(); 4682 context.clip(); 4683 context.fillStyle = grd; 4684 context.fillRect(0, fillLine, sizeX, sizeY); 4685 4686 } else if(animationType == 3){ 4687 context.clip(); 4688 var grd = createGrad(inc,sizeX, sizeY); 4689 inc = increaseInc(inc,current); 4690 context.fillStyle = grd; 4691 context.fillRect(0, fillLine, sizeX, sizeY); 4692 } else { 4693 context.clip(); 4694 context.fillStyle = customSettingsObj.fgcolor; 4695 context.fillRect(0, fillLine, sizeX, sizeY); 4696 }
4697 context.restore(); 4698 } else if (type == 'fill-circle-wave') { 4699 drawBorder(); 4700 var fillRadius = sizeX/2.5, 4701 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 4702 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 4703 var ypos=fillLine, xpos=0; 4704 counter += .1; 4705 counterLoop = counter; 4706 var increase = 2*Math.PI / 12; 4707 context.clip(); 4708 context.beginPath(); 4709 context.moveTo(sizeX,sizeY); 4710 context.lineTo(0,sizeY); 4711 context.lineTo(0,ypos); 4712 if (curPerc > endPercent) { 4713 calm-=.01; 4714 if(calm<0) calm=0; 4715 } 4716 for(i=0; i<=sizeX; i+=10){ 4717 xpos = i; 4718 ypos = ypos - Math.sin(counterLoop) * calm; 4719 counterLoop += increase; 4720 context.lineTo(xpos,ypos); 4721 } 4722 context.lineTo(sizeX,sizeY); 4723 context.closePath(); 4724 if(animationType == 1){ 4725 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 4726 context.fill(); 4727 } else if(animationType == 2){ 4728 var grd=context.createLinearGradient(0,0,0,sizeY); 4729 grd.addColorStop(0,"white"); 4730 grd.addColorStop(1,customSettingsObj.fgcolor); 4731 shadowGlow(); 4732 context.clip(); 4733 context.fillStyle = grd; 4734 context.fill(); 4735 } else if(animationType == 3){ 4736 context.clip(); 4737 var grd = createGrad(inc,sizeX,sizeY); 4738 inc = increaseInc(inc,current); 4739 context.fillStyle = grd; 4740 context.fill(); 4741 } else { 4742 context.clip(); 4743 context.fillStyle = customSettingsObj.fgcolor; 4744 context.fill(); 4745 } 4746 context.restore(); 4747 } 4748 4749 if (curPerc < endPercent) { 4750 curPerc += curStep; 4751 requestAnimationFrame(function () { 4752 context.strokeStyle = customSettingsObj.fgcolor; 4753 animate(Math.min(curPerc, endPercent) / 100); 4754 }, obj); 4755 } else if(finishFrames < 500) { 4756 curPerc += curStep; 4757 finishFrames+=1; 4758 requestAnimationFrame(function () { 4759 context.strokeStyle = customSettingsObj.fgcolor; 4760 animate(Math.min(curPerc, endPercent) / 100); 4761 }, obj); 4762 } 4763 4764 if (curPerc == endPercent && fireCallback && typeof(options) != "undefined") { 4765 if (opticStats.isFunction(options.complete)) { 4766 options.complete(); 4767 4768 fireCallback = false; 4769 } 4770 } 4771 } 4772 obj.waypoint(function(direction){ 4773 animate(curPerc / 100); 4774 this.destroy(); 4775 }, { offset: '100%' }); 4776 }); 4777 }; 4778}(opticStats)); 4779/* 4780 The MIT License (MIT) 4781 CountUp 4782+Copyright (c) 2014-2015 Jamie Perkins 4783 Permission is hereby granted, free of charge, to any person obtaining a copy of 4784 this software and associated documentation files (the "Software"), to deal in 4785*/ 4786!function(t,a){"function"==typeof define&&define.amd?define(a):"object"==typeof exports?module.exports=a(require,exports,module):t.CountUp=a()}(this,function(){var t=function(t,a,e,n,i,r){for(var o=0,s=["webkit","moz","ms","o"],u=0;u<s.length&&!window.requestAnimationFrame;++u)window.requestAnimationFrame=window[s[u]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[s[u]+"CancelAnimationFrame"]||window[s[u]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var a=(new Date).getTime(),e=Math.max(0,16-(a-o)),n=window.setTimeout(function(){t(a+e)},e);return o=a+e,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),this.options={useEasing:!0,useGrouping:!0,separator:",",decimal:"."};for(var m in r)r.hasOwnProperty(m)&&(this.options[m]=r[m]);""===this.options.separator&&(this.options.useGrouping=!1),this.options.prefix||(this.options.prefix=""),this.options.suffix||(this.options.suffix=""),this.d="string"==typeof t?document.getElementById(t):t,this.startVal=Number(a),this.endVal=Number(e),this.countDown=this.startVal>this.endVal,this.frameVal=this.startVal,this.decimals=Math.max(0,n||0),this.dec=Math.pow(10,this.decimals),this.duration=1e3*Number(i)||2e3;var l=this;this.version=function(){return"1.6.0"},this.printValue=function(t){var a=isNaN(t)?"--":l.formatNumber(t);"INPUT"==l.d.tagName?this.d.value=a:"text"==l.d.tagName||"tspan"==l.d.tagName?this.d.textContent=a:this.d.innerHTML=a},this.easeOutExpo=function(t,a,e,n){return e*(-Math.pow(2,-10*t/n)+1)*1024/1023+a},this.count=function(t){l.startTime||(l.startTime=t),l.timestamp=t;var a=t-l.startTime;l.remaining=l.duration-a,l.frameVal=l.options.useEasing?l.countDown?l.startVal-l.easeOutExpo(a,0,l.startVal-l.endVal,l.duration):l.easeOutExpo(a,l.startVal,l.endVal-l.startVal,l.duration):l.countDown?l.startVal-(l.startVal-l.endVal)*(a/l.duration):l.startVal+(l.endVal-l.startVal)*(a/l.duration),l.frameVal=l.countDown?l.frameVal<l.endVal?l.endVal:l.frameVal:l.frameVal>l.endVal?l.endVal:l.frameVal,l.frameVal=Math.round(l.frameVal*l.dec)/l.dec,l.printValue(l.frameVal),a<l.duration?l.rAF=requestAnimationFrame(l.count):l.callback&&l.callback()},this.start=function(t){return l.callback=t,l.rAF=requestAnimationFrame(l.count),!1},this.pauseResume=function(){l.paused?(l.paused=!1,delete l.startTime,l.duration=l.remaining,l.startVal=l.frameVal,requestAnimationFrame(l.count)):(l.paused=!0,cancelAnimationFrame(l.rAF))},this.reset=function(){l.paused=!1,delete l.startTime,l.startVal=a,cancelAnimationFrame(l.rAF),l.printValue(l.startVal)},this.update=function(t){cancelAnimationFrame(l.rAF),l.paused=!1,delete l.startTime,l.startVal=l.frameVal,l.endVal=Number(t),l.countDown=l.startVal>l.endVal,l.rAF=requestAnimationFrame(l.count)},this.formatNumber=function(t){t=t.toFixed(l.decimals),t+="";var a,e,n,i;if(a=t.split("."),e=a[0],n=a.length>1?l.options.decimal+a[1]:"",i=/(\d+)(\d{3})/,l.options.useGrouping)for(;i.test(e);)e=e.replace(i,"$1"+l.options.separator+"$2");return l.options.prefix+e+n+l.options.suffix},l.printValue(l.startVal)};return t}); 4787/*! 4788Waypoints - 4.0.0 4789Copyright © 2011-2015 Caleb Troughton 4790Licensed under the MIT license. 4791https://github.com/imakewebthings/waypoints/blob/master/licenses.txt 4792*/ 4793!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");
vendor: 6,526 bytes, line 4793
4793this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],r
4793ight:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.opticStatselement=e(t)}var e=opticStats,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.opticStatselement[i].apply(this.opticStatselement,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;opticStats&&(opticStats.fn.waypoint=t(opticStats)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); 4794 4795opticStats( document ).ready(function() { 4796 var speed = 3000, 4797 countNumberstacks_in_103 = "100", 4798 decimalNumber = '0', 4799 decimalNumber = decimalNumber.replace(/\D/g,''), 4800 decimalLength = decimalNumber.length, 4801 maxValuePercentstacks_in_103 = (countNumberstacks_in_103/100), 4802 speedA = (2000/speed)*maxValuePercentstacks_in_103; 4803 if (100 == 0) { 4804 if(countNumberstacks_in_103 < 0) { 4805 maxValuePercentstacks_in_103 = 1; 4806 } else { 4807 maxValuePercentstacks_in_103 = (0-countNumberstacks_in_103)/0; 4808 } 4809 } 4810 if('False' == 'False' ) { 4811 decimalLength = 0; 4812 } else { 4813 countNumberstacks_in_103 = countNumberstacks_in_103.replace(/\D/g,''); 4814 countNumberstacks_in_103 = countNumberstacks_in_103+"."+decimalNumber; 4815 } 4816 if('False' == 'True' ) { 4817 var items = readData_data(opticStats("#data")); 4818 countNumberstacks_in_103 = items['data-A1']; 4819 if(countNumberstacks_in_103 == null) { 4820 countNumberstacks_in_103 = '0'; 4821 } 4822 opticStats("#stat_stacks_in_103").data("percent", maxValuePercentstacks_in_103*100); 4823 // 4824 // 4825 if(countNumberstacks_in_103.indexOf(".") !== -1) { 4826 decimalNumber = countNumberstacks_in_103.substr(countNumberstacks_in_103.indexOf(".") + 1); 4827 decimalNumber = decimalNumber.replace(/\D/g,''); 4828 decimalLength = decimalNumber.length; 4829 countNumberstacks_in_103 = countNumberstacks_in_103.substr(0, countNumberstacks_in_103.indexOf('.')); 4830 } 4831 // 4832 // 4833 countNumberstacks_in_103 = countNumberstacks_in_103.replace(/[^0-9\-]/g,''); 4834 countNumberstacks_in_103 = countNumberstacks_in_103+"."+decimalNumber; 4835 maxValuePercentstacks_in_103 = (countNumberstacks_in_103/100); 4836 if (100 == 0) { 4837 if(countNumberstacks_in_103 < 0) { 4838 maxValuePercentstacks_in_103 = 1; 4839 } else { 4840 maxValuePercentstacks_in_103 = (0-countNumberstacks_in_103)/0; 4841 } 4842 } 4843 speedA = (2000/speed)*maxValuePercentstacks_in_103; 4844 opticStats("#stat_stacks_in_103").data("percent", maxValuePercentstacks_in_103*100); 4845 } else { 4846 var maxValuePercentstacks_in_103 = (countNumberstacks_in_103/100); 4847 if (100 == 0) { 4848 if(countNumberstacks_in_103 < 0) { 4849 maxValuePercentstacks_in_103 = 1; 4850 } else { 4851 maxValuePercentstacks_in_103 = (0-countNumberstacks_in_103)/0; 4852 } 4853 } 4854 speedA = (2000/speed)*maxValuePercentstacks_in_103; 4855 opticStats("#stat_stacks_in_103").data("percent", maxValuePercentstacks_in_103*100); 4856 } 4857 opticStats('#stat_stacks_in_103').attr("data-animationstep", speedA); 4858 opticStats('#stat_stacks_in_103').circliful(); 4859 opticStats('#stat_stacks_in_103').waypoint(function(direction){ 4860 4861 // 4862// opticStats('#stacks_in_103 .counter').counterUp({ 4863// delay: 10, 4864// time: speed 4865// }); 4866 4867 var options = { 4868 // 4869 // 4870 separator : ',', 4871 decimal : '.', 4872 // 4873 // 4874 // 4875 useEasing : false 4876 }; 4877 opticStats('#stacks_in_103 .counter').attr("id", "count_stacks_in_103"); 4878 var count = new CountUp('count_stacks_in_103', 0, countNumberstacks_in_103, decimalLength, (1.9/speedA)*(maxValuePercentstacks_in_103), options);//(1.75/speedA)*(maxValuePercentstacks_in_103) 4879 count.start(); 4880 // 4881 // 4882 opticStats('#stat_stacks_in_103 .circle-text').append("%"); 4883 opticStats('#stat_stacks_in_103 .circle-text-half').append("%"); 4884 // 4885 // 4886 // 4887 // 4888 // 4889 scale(); 4890 this.destroy(); 4891 }, { offset: '100%' }); 4892 4893 4894}); 4895 4896opticStats( window ).resize(function() { 4897 scale(); 4898}); 4899function scale() { 4900 var width = 200, 4901 currentWidth = opticStats('#stat_stacks_in_103').parent().outerWidth(); 4902 if(currentWidth < width) { 4903 var scale = currentWidth/width; 4904 opticStats('#stat_stacks_in_103').css({ 4905 "transform" : "scale("+scale+")", 4906 "transform-origin" : "0px", 4907 "-o-transform" : "scale("+scale+")", 4908 "-o-transform-origin" : "0px" 4909 }); 4910 } else { 4911 opticStats('#stat_stacks_in_103').css({ 4912 "transform" : "scale(1)", 4913 "-o-transform" : "scale(1)" 4914 }); 4915 } 4916} 4917 4918return stack;})(stacks.stacks_in_103); 4919stacks.stacks_in_219 = {}; 4920stacks.stacks_in_219 = (function(stack) { 4921var jQuery = stacks.jQuery;var $ = jQuery;var opticStats = $; 4922/* 4923jquery-plugin-circliful 4924+The MIT License (MIT) 4925+ 4926+Copyright (c) 2014 Patric Gutersohn 4927+ 4928+Permission is hereby granted, free of charge, to any person obtaining a copy of 4929+this software and associated documentation files (the "Software"), to deal in 4930+the Software without restriction, including without limitation the rights to 4931+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 4932+the Software, and to permit persons to whom the Software is furnished to do so, 4933+subject to the following conditions: 4934+ 4935+The above copyright notice and this permission notice shall be included in all 4936+copies or substantial portions of the Software. 4937+ 4938+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4939+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 4940+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 4941+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 4942+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 4943+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 4944*/ 4945"use strict"; 4946 4947(function (opticStats) { 4948 4949 opticStats.fn.circliful = function (options, callback) { 4950 4951 var settings = opticStats.extend({ 4952 // These are the defaults. 4953 startdegree: 0, 4954 fgcolor: "#556b2f", 4955 bgcolor: "#eee", 4956 fill: false, 4957 width: 15, 4958 dimension: 200, 4959 fontsize: 15, 4960 percent: 50, 4961 animationstep: 1.0, 4962 iconsize: '20px', 4963 iconcolor: '#999', 4964 border: 'default', 4965 complete: null, 4966 bordersize: 10 4967 }, options); 4968 4969 return this.each(function () { 4970 4971 var customSettings = ["fgcolor", "bgcolor", "fill", "width", "dimension", "fontsize", "animationstep", "endPercent", "icon", "iconcolor", "iconsize", "border", "startdegree", "bordersize"]; 4972 4973 var customSettingsObj = {}; 4974 var icon = ''; 4975 var percent; 4976 var endPercent = 0; 4977 var obj = opticStats(this); 4978 var fill = false;
4979 var text, info; 4980 4981 obj.addClass('circliful'); 4982 4983 checkDataAttributes(obj); 4984 4985 if (obj.data('text') != undefined) { 4986 4987 //remove non number characters 4988 4989 text = obj.data('text'); 4990 text = text.toString(); 4991 text = text.replace(/[^0-9.,]/g, ''); 4992 text = "<span class='counter'>" + text + "</span>"; 4993 4994 if (obj.data('icon') != undefined) { 4995 icon = opticStats('<i></i>') 4996 .addClass('osIcon fa ' + opticStats(this).data('icon')) 4997 .css({ 4998 'color': customSettingsObj.iconcolor, 4999 'font-size': customSettingsObj.iconsize, 5000 'line-height': customSettingsObj.iconsize + "px" 5001 }); 5002 } 5003 if (obj.data('icon-custom') != undefined) { 5004 icon = opticStats('<img src="'+opticStats(this).data("icon-custom")+'"></img>') 5005 .addClass('osIcon ') 5006 .css({ 5007 'width': customSettingsObj.iconsize, 5008 'height': customSettingsObj.iconsize 5009 }); 5010 } 5011 5012 if (obj.data('type') != undefined) { 5013 type = opticStats(this).data('type'); 5014 5015 if (type == 'half') { 5016 addCircleText(obj, 'circle-text-half', (customSettingsObj.dimension / 1.45)); 5017 } else { 5018 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 5019 } 5020 } else { 5021 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 5022 } 5023 } 5024 5025 if (opticStats(this).data("total") != undefined && opticStats(this).data("part") != undefined) { 5026 var total = opticStats(this).data("total") / 100; 5027 5028 percent = ((opticStats(this).data("part") / total) / 100).toFixed(3); 5029 endPercent = (opticStats(this).data("part") / total).toFixed(3); 5030 } else { 5031 if (opticStats(this).data("percent") != undefined) { 5032 percent = opticStats(this).data("percent") / 100; 5033 endPercent = opticStats(this).data("percent"); 5034 } else { 5035 percent = settings.percent / 100; 5036 } 5037 } 5038 5039 if (opticStats(this).data('info') != undefined) { 5040 info = opticStats(this).data('info'); 5041 5042 if (opticStats(this).data('type') != undefined) { 5043 type = opticStats(this).data('type'); 5044 5045 if (type == 'half') { 5046 addInfoText(obj, 0.9); 5047 } else { 5048 addInfoText(obj, 1.25); 5049 } 5050 } else { 5051 addInfoText(obj, 1.25); 5052 } 5053 } 5054 5055 opticStats(this).width(customSettingsObj.dimension + 'px'); 5056 if (type == 'line' || type == 'vert-line') { 5057 opticStats(this).height(opticStats(this).data('height') + 'px'); 5058 } else { 5059 opticStats(this).height(customSettingsObj.dimension + 'px'); 5060 } 5061 5062 5063 var sizeX = customSettingsObj.dimension, 5064 sizeY = customSettingsObj.dimension; 5065 if (type == 'line' || type == 'vert-line') { 5066 sizeY = opticStats(this).data('height'); 5067 } 5068 var canvas = opticStats('<canvas></canvas>').attr({ 5069 width: sizeX, 5070 height: sizeY 5071 }).appendTo(opticStats(this)).get(0); 5072 var context = canvas.getContext('2d'); 5073 5074 var dpr = window.devicePixelRatio; 5075 if ( dpr ) { 5076 var opticStatscanvas = opticStats(canvas); 5077 opticStatscanvas.css('width', sizeX); 5078 opticStatscanvas.css('height', sizeY); 5079 opticStatscanvas.attr('width', sizeX * dpr); 5080 opticStatscanvas.attr('height', sizeY * dpr); 5081 5082 context.scale(dpr, dpr); 5083 } 5084 5085 var container = opticStats(canvas).parent(); 5086 var x = sizeX / 2; 5087 var y = sizeY / 2; 5088 var degrees = customSettingsObj.percent * 360.0; 5089 var radians = degrees * (Math.PI / 180); 5090 var radius = sizeX / 2.5; 5091 var startAngle = 2.3 * Math.PI; 5092 var endAngle = 0; 5093 var counterClockwise = false; 5094 var curPerc = customSettingsObj.animationstep === 0.0 ? endPercent : 0.0; 5095 var curStep = Math.max(customSettingsObj.animationstep, 0.0); 5096 var circ = Math.PI * 2; 5097 var quart = Math.PI / 2; 5098 var type = ''; 5099 var fireCallback = true; 5100 var additionalAngelPI = (customSettingsObj.startdegree / 180) * Math.PI; 5101 5102 if (opticStats(this).data('type') != undefined) { 5103 type = opticStats(this).data('type'); 5104 if (type == 'half') { 5105 startAngle = 2.0 * Math.PI; 5106 endAngle = 3.14; 5107 circ = Math.PI; 5108 quart = Math.PI / 0.996; 5109 } else if (type == 'angle') { 5110 startAngle = 2.25 * Math.PI; 5111 endAngle = 2.4; 5112 circ = 1.53 + Math.PI; 5113 quart = 0.73 + Math.PI / 0.996; 5114 } 5115 } 5116 5117 /** 5118 * adds text to circle 5119 * 5120 * @param obj 5121 * @param cssClass 5122 * @param lineHeight 5123 */ 5124 opticStats(" > span", this).wrapAll("<div class='centerMe'><div></div></div>"); 5125 function addCircleText(obj, cssClass, lineHeight) { 5126 opticStats("<span></span>") 5127 .appendTo(obj) 5128 .addClass(cssClass) 5129 .html(text) 5130 .prepend(icon) 5131 .css({ 5132 //'line-height': lineHeight + 'px', 5133 'font-size': customSettingsObj.fontsize + 'px', 5134 'line-height': customSettingsObj.fontsize + 'px' 5135 }); 5136 } 5137 5138 /** 5139 * adds info text to circle 5140 * 5141 * @param obj 5142 * @param factor 5143 */ 5144 function addInfoText(obj, factor) { 5145 opticStats('<span></span>') 5146 .appendTo(obj) 5147 .addClass('circle-info-half') 5148 //.css( 5149 //'line-height', (customSettingsObj.dimension * factor) + 'px' 5150 //) 5151 .text(info); 5152 } 5153 5154 /** 5155 * checks which data attributes are defined 5156 * @param obj 5157 */ 5158 function checkDataAttributes(obj) { 5159 opticStats.each(customSettings, function (index, attribute) { 5160 if (obj.data(attribute) != undefined) { 5161 customSettingsObj[attribute] = obj.data(attribute); 5162 } else { 5163 customSettingsObj[attribute] = opticStats(settings).attr(attribute); 5164 } 5165 5166 if (attribute == 'fill' && obj.data('fill') != undefined) { 5167 fill = true; 5168 } 5169 }); 5170 } 5171 5172 //Animation Variables 5173 var inc = 0, counter=0,calm = 2,finishFrames=0, animationType = obj.data('animation-type'), slowTheInc = 0; 5174 // ---------------------- // 5175 // Animation Functions 5176 // ---------------------- // 5177 function blend(inColor,outColor,current){ 5178 var inColors = inColor.substring(inColor.indexOf('(') + 1, inColor.lastIndexOf(')')).split(/,\s*/), 5179 outColors = outColor.substring(outColor.indexOf('(') + 1, outColor.lastIndexOf(')')).split(/,\s*/), 5180 r,g,b,a,cur; 5181 for(var i=0; i<inColors.length; i++) { inColors[i] = parseInt(inColors[i], 10); } 5182 for(var i=0; i<outColors.length; i++) { outColors[i] = parseInt(outColors[i], 10); } 5183 if(current < .5 ) { 5184 cur = current*2; 5185 r = Math.min(255,Math.max(0, inColors[0] + (outColors[0] * cur))); 5186 g = Math.min(255,Math.max(0, inColors[1] + (outColors[1] * cur))); 5187 b = Math.min(255,Math.max(0, inColors[2] + (outColors[2] * cur))); 5188 } else { 5189 cur = (current-.5)*2; 5190 r = Math.min(255,Math.max(0,Math.max(inColors[0], outColors[0]) + ((outColors[0] - inColors[0]) * cur))); 5191 g = Math.min(255,Math.max(0,Math.max(inColors[1], outColors[1]) + ((outColors[1] - inColors[1]) * cur))); 5192 b = Math.min(255,Math.max(0,Math.max(inColors[2], outColors[2]) + ((outColors[2] - inColors[2]) * cur))); 5193 } 5194 var a = inColors[3]+((outColors[3] - inColors[3])*current);
5195 return 'rgba('+Math.floor(r)+', '+Math.floor(g)+', '+Math.floor(b)+', '+Math.floor(a)+')'; 5196 } 5197 if (type == 'line' || type == 'vert-line') { 5198 customSettingsObj.bordersize = customSettingsObj.bordersize*2; 5199 } 5200 var increaseInc = function(inc, current) { 5201 if (current >= 1) { 5202 // slowTheInc += 0.00002; 5203 // slowTheInc = Math.min(slowTheInc, 0.005); 5204 // inc = inc + (0.005-slowTheInc); 5205 } else { 5206 inc += 0.005; 5207 } 5208 return inc; 5209 } 5210 var moveColors = function(value, inc) { 5211 var pos = value+inc; 5212 pos = pos.toString(); 5213 pos = pos.split(".").pop(); 5214 pos = parseFloat("."+pos); 5215 return pos; 5216 } 5217 var createGrad = function(inc,sizeX, sizeY) { 5218 var grd=context.createLinearGradient(0,0,sizeX,sizeY); 5219 grd.addColorStop(moveColors(0, inc),"#FF0000"); 5220 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 5221 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 5222 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 5223 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 5224 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 5225 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 5226 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 5227 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 5228 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 5229 grd.addColorStop(moveColors(1, inc),"#FF0000"); 5230 return grd; 5231 } 5232 var shadowGlow = function() { 5233 context.shadowColor = customSettingsObj.fgcolor; 5234 context.shadowOffsetX = 0; 5235 context.shadowOffsetY = 0; 5236 context.shadowBlur = 10; 5237 } 5238 var drawBorder = function() { 5239 context.lineWidth = customSettingsObj.bordersize + 1; 5240 context.strokeStyle = customSettingsObj.bgcolor; 5241 context.stroke(); 5242 if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle') { 5243 // 5244 } else { 5245 context.fillStyle = customSettingsObj.fill; 5246 context.fill(); 5247 } 5248 context.beginPath(); 5249 context.save(); 5250 } 5251 var fillAnimation = function(animationType, current) { 5252 if(animationType == 1){ 5253 context.strokeStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 5254 context.stroke(); 5255 } else if(animationType == 2){ 5256 context.strokeStyle = customSettingsObj.fgcolor; 5257 if (type == 'line') { 5258 var grd=context.createLinearGradient(sizeX,0,0,0); 5259 grd.addColorStop(0,"white"); 5260 grd.addColorStop(1,customSettingsObj.fgcolor); 5261 context.strokeStyle = grd; 5262 shadowGlow(); 5263 } else if (type == 'vert-line') { 5264 var grd=context.createLinearGradient(0,0,0,sizeY); 5265 grd.addColorStop(0,"white"); 5266 grd.addColorStop(1,customSettingsObj.fgcolor); 5267 context.strokeStyle = grd; 5268 shadowGlow(); 5269 } else { 5270 var grd = context.createRadialGradient(sizeX/2, sizeY/2, (sizeX+customSettingsObj.bordersize*2)/2.5, sizeY/2, sizeX/2, (sizeY-customSettingsObj.bordersize*2)/2.5); 5271 grd.addColorStop(0, customSettingsObj.fgcolor); 5272 grd.addColorStop(0.5, 'white'); 5273 grd.addColorStop(1, customSettingsObj.fgcolor); 5274 context.strokeStyle = grd; 5275 shadowGlow(); 5276 } 5277 context.stroke(); 5278 context.restore(); 5279 } else if(animationType == 3){ 5280 if (type == 'line') { 5281 var grd = createGrad(inc,sizeX,sizeY); 5282 inc = increaseInc(inc,current); 5283 context.strokeStyle = grd; 5284 } else if (type == 'vert-line') { 5285 var grd=context.createLinearGradient(sizeX/2,0,sizeX/2,sizeY); 5286 grd.addColorStop(moveColors(0, inc),"#FF0000"); 5287 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 5288 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 5289 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 5290 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 5291 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 5292 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 5293 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 5294 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 5295 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 5296 grd.addColorStop(moveColors(1, inc),"#FF0000"); 5297 inc = increaseInc(inc,current); 5298 context.strokeStyle = grd; 5299 } else { 5300 var grd = createGrad(inc,sizeX,sizeY); 5301 inc = increaseInc(inc,current); 5302 context.strokeStyle = grd; 5303 } 5304 context.stroke();
5305 context.restore(); 5306 } else { 5307 context.strokeStyle = customSettingsObj.fgcolor; 5308 context.stroke(); 5309 } 5310 } 5311 // ---------------------- // 5312 // Animation 5313 // ---------------------- // 5314 function animate(current) { 5315 //Clear Canvas for next frame 5316 context.clearRect(0, 0, canvas.width, canvas.height); 5317 //Draw Background 5318 if (type == 'line' || type == 'vert-line') { 5319 context.rect(10, 10, sizeX-20, sizeY-20); 5320 } else if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle' || type == 'full' || type == 'half') { 5321 context.beginPath(); 5322 context.arc(x, y, radius, endAngle, startAngle, false); 5323 } 5324 context.fillStyle = customSettingsObj.fill; 5325 context.fill(); 5326 if (type == 'line') { 5327 context.beginPath(); 5328 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 5329 context.lineTo(sizeX-10,sizeY-(customSettingsObj.bordersize/2+10)); 5330 drawBorder(); 5331 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 5332 context.lineTo(Math.min((sizeX-20) * current+10,sizeX-10),sizeY-(customSettingsObj.bordersize/2+10)); 5333 fillAnimation(animationType,current); 5334 } else if (type == 'vert-line'){ 5335 context.beginPath(); 5336 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 5337 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),10); 5338 drawBorder(); 5339 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 5340 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),Math.max((sizeY-20) * (1-current)+10,10)); 5341 fillAnimation(animationType,current); 5342 } else if (type == 'full' || type=='half') { 5343 drawBorder(); 5344 context.arc(x, y, radius, -(quart) + additionalAngelPI, ((circ) * (Math.min(current,1)+.005)) - quart + additionalAngelPI, false); 5345 fillAnimation(animationType,current); 5346 } else if (type == 'grow-circle') { 5347 drawBorder(); 5348 var fillRadius = sizeX/2.5*Math.min(current,1); 5349 context.arc(sizeX/2, sizeY/2, Math.max(fillRadius-customSettingsObj.bordersize/2,0), endAngle, startAngle, false); 5350 if(animationType == 1){ 5351 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 5352 context.fill(); 5353 } else if(animationType == 2){ 5354 var grd=context.createLinearGradient(0,0,0,sizeY); 5355 grd.addColorStop(0,"white"); 5356 grd.addColorStop(1,customSettingsObj.fgcolor); 5357 shadowGlow(); 5358 context.fillStyle = grd; 5359 context.fill(); 5360 } else if(animationType == 3){ 5361 var grd = createGrad(inc,sizeX,sizeY); 5362 inc = increaseInc(inc,current); 5363 context.fillStyle = grd; 5364 context.fill(); 5365 } else { 5366 context.fillStyle = customSettingsObj.fgcolor; 5367 context.fill(); 5368 } 5369 context.restore(); 5370 } else if (type == 'fill-circle') { 5371 drawBorder(); 5372 var fillRadius = sizeX/2.5, 5373 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 5374 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 5375 if(animationType == 1){ 5376 context.clip(); 5377 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 5378 context.fillRect(0, fillLine, sizeX, sizeY); 5379 } else if(animationType == 2){ 5380 var grd=context.createLinearGradient(0,0,0,sizeY); 5381 grd.addColorStop(0,"white"); 5382 grd.addColorStop(1,customSettingsObj.fgcolor); 5383 shadowGlow(); 5384 context.clip(); 5385 context.fillStyle = grd; 5386 context.fillRect(0, fillLine, sizeX, sizeY); 5387 5388 } else if(animationType == 3){ 5389 context.clip(); 5390 var grd = createGrad(inc,sizeX, sizeY); 5391 inc = increaseInc(inc,current); 5392 context.fillStyle = grd; 5393 context.fillRect(0, fillLine, sizeX, sizeY); 5394 } else { 5395 context.clip(); 5396 context.fillStyle = customSettingsObj.fgcolor; 5397 context.fillRect(0, fillLine, sizeX, sizeY); 5398 }
5399 context.restore(); 5400 } else if (type == 'fill-circle-wave') { 5401 drawBorder(); 5402 var fillRadius = sizeX/2.5, 5403 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 5404 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 5405 var ypos=fillLine, xpos=0; 5406 counter += .1; 5407 counterLoop = counter; 5408 var increase = 2*Math.PI / 12; 5409 context.clip(); 5410 context.beginPath(); 5411 context.moveTo(sizeX,sizeY); 5412 context.lineTo(0,sizeY); 5413 context.lineTo(0,ypos); 5414 if (curPerc > endPercent) { 5415 calm-=.01; 5416 if(calm<0) calm=0; 5417 } 5418 for(i=0; i<=sizeX; i+=10){ 5419 xpos = i; 5420 ypos = ypos - Math.sin(counterLoop) * calm; 5421 counterLoop += increase; 5422 context.lineTo(xpos,ypos); 5423 } 5424 context.lineTo(sizeX,sizeY); 5425 context.closePath(); 5426 if(animationType == 1){ 5427 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 5428 context.fill(); 5429 } else if(animationType == 2){ 5430 var grd=context.createLinearGradient(0,0,0,sizeY); 5431 grd.addColorStop(0,"white"); 5432 grd.addColorStop(1,customSettingsObj.fgcolor); 5433 shadowGlow(); 5434 context.clip(); 5435 context.fillStyle = grd; 5436 context.fill(); 5437 } else if(animationType == 3){ 5438 context.clip(); 5439 var grd = createGrad(inc,sizeX,sizeY); 5440 inc = increaseInc(inc,current); 5441 context.fillStyle = grd; 5442 context.fill(); 5443 } else { 5444 context.clip(); 5445 context.fillStyle = customSettingsObj.fgcolor; 5446 context.fill(); 5447 } 5448 context.restore(); 5449 } 5450 5451 if (curPerc < endPercent) { 5452 curPerc += curStep; 5453 requestAnimationFrame(function () { 5454 context.strokeStyle = customSettingsObj.fgcolor; 5455 animate(Math.min(curPerc, endPercent) / 100); 5456 }, obj); 5457 } else if(finishFrames < 500) { 5458 curPerc += curStep; 5459 finishFrames+=1; 5460 requestAnimationFrame(function () { 5461 context.strokeStyle = customSettingsObj.fgcolor; 5462 animate(Math.min(curPerc, endPercent) / 100); 5463 }, obj); 5464 } 5465 5466 if (curPerc == endPercent && fireCallback && typeof(options) != "undefined") { 5467 if (opticStats.isFunction(options.complete)) { 5468 options.complete(); 5469 5470 fireCallback = false; 5471 } 5472 } 5473 } 5474 obj.waypoint(function(direction){ 5475 animate(curPerc / 100); 5476 this.destroy(); 5477 }, { offset: '100%' }); 5478 }); 5479 }; 5480}(opticStats)); 5481/* 5482 The MIT License (MIT) 5483 CountUp 5484+Copyright (c) 2014-2015 Jamie Perkins 5485 Permission is hereby granted, free of charge, to any person obtaining a copy of 5486 this software and associated documentation files (the "Software"), to deal in 5487*/ 5488!function(t,a){"function"==typeof define&&define.amd?define(a):"object"==typeof exports?module.exports=a(require,exports,module):t.CountUp=a()}(this,function(){var t=function(t,a,e,n,i,r){for(var o=0,s=["webkit","moz","ms","o"],u=0;u<s.length&&!window.requestAnimationFrame;++u)window.requestAnimationFrame=window[s[u]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[s[u]+"CancelAnimationFrame"]||window[s[u]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var a=(new Date).getTime(),e=Math.max(0,16-(a-o)),n=window.setTimeout(function(){t(a+e)},e);return o=a+e,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),this.options={useEasing:!0,useGrouping:!0,separator:",",decimal:"."};for(var m in r)r.hasOwnProperty(m)&&(this.options[m]=r[m]);""===this.options.separator&&(this.options.useGrouping=!1),this.options.prefix||(this.options.prefix=""),this.options.suffix||(this.options.suffix=""),this.d="string"==typeof t?document.getElementById(t):t,this.startVal=Number(a),this.endVal=Number(e),this.countDown=this.startVal>this.endVal,this.frameVal=this.startVal,this.decimals=Math.max(0,n||0),this.dec=Math.pow(10,this.decimals),this.duration=1e3*Number(i)||2e3;var l=this;this.version=function(){return"1.6.0"},this.printValue=function(t){var a=isNaN(t)?"--":l.formatNumber(t);"INPUT"==l.d.tagName?this.d.value=a:"text"==l.d.tagName||"tspan"==l.d.tagName?this.d.textContent=a:this.d.innerHTML=a},this.easeOutExpo=function(t,a,e,n){return e*(-Math.pow(2,-10*t/n)+1)*1024/1023+a},this.count=function(t){l.startTime||(l.startTime=t),l.timestamp=t;var a=t-l.startTime;l.remaining=l.duration-a,l.frameVal=l.options.useEasing?l.countDown?l.startVal-l.easeOutExpo(a,0,l.startVal-l.endVal,l.duration):l.easeOutExpo(a,l.startVal,l.endVal-l.startVal,l.duration):l.countDown?l.startVal-(l.startVal-l.endVal)*(a/l.duration):l.startVal+(l.endVal-l.startVal)*(a/l.duration),l.frameVal=l.countDown?l.frameVal<l.endVal?l.endVal:l.frameVal:l.frameVal>l.endVal?l.endVal:l.frameVal,l.frameVal=Math.round(l.frameVal*l.dec)/l.dec,l.printValue(l.frameVal),a<l.duration?l.rAF=requestAnimationFrame(l.count):l.callback&&l.callback()},this.start=function(t){return l.callback=t,l.rAF=requestAnimationFrame(l.count),!1},this.pauseResume=function(){l.paused?(l.paused=!1,delete l.startTime,l.duration=l.remaining,l.startVal=l.frameVal,requestAnimationFrame(l.count)):(l.paused=!0,cancelAnimationFrame(l.rAF))},this.reset=function(){l.paused=!1,delete l.startTime,l.startVal=a,cancelAnimationFrame(l.rAF),l.printValue(l.startVal)},this.update=function(t){cancelAnimationFrame(l.rAF),l.paused=!1,delete l.startTime,l.startVal=l.frameVal,l.endVal=Number(t),l.countDown=l.startVal>l.endVal,l.rAF=requestAnimationFrame(l.count)},this.formatNumber=function(t){t=t.toFixed(l.decimals),t+="";var a,e,n,i;if(a=t.split("."),e=a[0],n=a.length>1?l.options.decimal+a[1]:"",i=/(\d+)(\d{3})/,l.options.useGrouping)for(;i.test(e);)e=e.replace(i,"$1"+l.options.separator+"$2");return l.options.prefix+e+n+l.options.suffix},l.printValue(l.startVal)};return t}); 5489/*! 5490Waypoints - 4.0.0 5491Copyright © 2011-2015 Caleb Troughton 5492Licensed under the MIT license. 5493https://github.com/imakewebthings/waypoints/blob/master/licenses.txt 5494*/ 5495!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");
vendor: 6,526 bytes, line 5495
5495this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],r
5495ight:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.opticStatselement=e(t)}var e=opticStats,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.opticStatselement[i].apply(this.opticStatselement,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;opticStats&&(opticStats.fn.waypoint=t(opticStats)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); 5496 5497opticStats( document ).ready(function() { 5498 var speed = 3000, 5499 countNumberstacks_in_219 = "98", 5500 decimalNumber = '0', 5501 decimalNumber = decimalNumber.replace(/\D/g,''), 5502 decimalLength = decimalNumber.length, 5503 maxValuePercentstacks_in_219 = (countNumberstacks_in_219/100), 5504 speedA = (2000/speed)*maxValuePercentstacks_in_219; 5505 if (100 == 0) { 5506 if(countNumberstacks_in_219 < 0) { 5507 maxValuePercentstacks_in_219 = 1; 5508 } else { 5509 maxValuePercentstacks_in_219 = (0-countNumberstacks_in_219)/0; 5510 } 5511 } 5512 if('False' == 'False' ) { 5513 decimalLength = 0; 5514 } else { 5515 countNumberstacks_in_219 = countNumberstacks_in_219.replace(/\D/g,''); 5516 countNumberstacks_in_219 = countNumberstacks_in_219+"."+decimalNumber; 5517 } 5518 if('False' == 'True' ) { 5519 var items = readData_data(opticStats("#data")); 5520 countNumberstacks_in_219 = items['data-A1']; 5521 if(countNumberstacks_in_219 == null) { 5522 countNumberstacks_in_219 = '0'; 5523 } 5524 opticStats("#stat_stacks_in_219").data("percent", maxValuePercentstacks_in_219*100); 5525 // 5526 // 5527 if(countNumberstacks_in_219.indexOf(".") !== -1) { 5528 decimalNumber = countNumberstacks_in_219.substr(countNumberstacks_in_219.indexOf(".") + 1); 5529 decimalNumber = decimalNumber.replace(/\D/g,''); 5530 decimalLength = decimalNumber.length; 5531 countNumberstacks_in_219 = countNumberstacks_in_219.substr(0, countNumberstacks_in_219.indexOf('.')); 5532 } 5533 // 5534 // 5535 countNumberstacks_in_219 = countNumberstacks_in_219.replace(/[^0-9\-]/g,''); 5536 countNumberstacks_in_219 = countNumberstacks_in_219+"."+decimalNumber; 5537 maxValuePercentstacks_in_219 = (countNumberstacks_in_219/100); 5538 if (100 == 0) { 5539 if(countNumberstacks_in_219 < 0) { 5540 maxValuePercentstacks_in_219 = 1; 5541 } else { 5542 maxValuePercentstacks_in_219 = (0-countNumberstacks_in_219)/0; 5543 } 5544 } 5545 speedA = (2000/speed)*maxValuePercentstacks_in_219; 5546 opticStats("#stat_stacks_in_219").data("percent", maxValuePercentstacks_in_219*100); 5547 } else { 5548 var maxValuePercentstacks_in_219 = (countNumberstacks_in_219/100); 5549 if (100 == 0) { 5550 if(countNumberstacks_in_219 < 0) { 5551 maxValuePercentstacks_in_219 = 1; 5552 } else { 5553 maxValuePercentstacks_in_219 = (0-countNumberstacks_in_219)/0; 5554 } 5555 } 5556 speedA = (2000/speed)*maxValuePercentstacks_in_219; 5557 opticStats("#stat_stacks_in_219").data("percent", maxValuePercentstacks_in_219*100); 5558 } 5559 opticStats('#stat_stacks_in_219').attr("data-animationstep", speedA); 5560 opticStats('#stat_stacks_in_219').circliful(); 5561 opticStats('#stat_stacks_in_219').waypoint(function(direction){ 5562 5563 // 5564// opticStats('#stacks_in_219 .counter').counterUp({ 5565// delay: 10, 5566// time: speed 5567// }); 5568 5569 var options = { 5570 // 5571 // 5572 separator : ',', 5573 decimal : '.', 5574 // 5575 // 5576 // 5577 useEasing : false 5578 }; 5579 opticStats('#stacks_in_219 .counter').attr("id", "count_stacks_in_219"); 5580 var count = new CountUp('count_stacks_in_219', 0, countNumberstacks_in_219, decimalLength, (1.9/speedA)*(maxValuePercentstacks_in_219), options);//(1.75/speedA)*(maxValuePercentstacks_in_219) 5581 count.start(); 5582 // 5583 // 5584 opticStats('#stat_stacks_in_219 .circle-text').append("%"); 5585 opticStats('#stat_stacks_in_219 .circle-text-half').append("%"); 5586 // 5587 // 5588 // 5589 // 5590 // 5591 scale(); 5592 this.destroy(); 5593 }, { offset: '100%' }); 5594 5595 5596}); 5597 5598opticStats( window ).resize(function() { 5599 scale(); 5600}); 5601function scale() { 5602 var width = 200, 5603 currentWidth = opticStats('#stat_stacks_in_219').parent().outerWidth(); 5604 if(currentWidth < width) { 5605 var scale = currentWidth/width; 5606 opticStats('#stat_stacks_in_219').css({ 5607 "transform" : "scale("+scale+")", 5608 "transform-origin" : "0px", 5609 "-o-transform" : "scale("+scale+")", 5610 "-o-transform-origin" : "0px" 5611 }); 5612 } else { 5613 opticStats('#stat_stacks_in_219').css({ 5614 "transform" : "scale(1)", 5615 "-o-transform" : "scale(1)" 5616 }); 5617 } 5618} 5619 5620return stack;})(stacks.stacks_in_219); 5621stacks.stacks_in_98 = {}; 5622stacks.stacks_in_98 = (function(stack) { 5623var jQuery = stacks.jQuery;var $ = jQuery;var opticStats = $; 5624/* 5625jquery-plugin-circliful 5626+The MIT License (MIT) 5627+ 5628+Copyright (c) 2014 Patric Gutersohn 5629+ 5630+Permission is hereby granted, free of charge, to any person obtaining a copy of 5631+this software and associated documentation files (the "Software"), to deal in 5632+the Software without restriction, including without limitation the rights to 5633+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 5634+the Software, and to permit persons to whom the Software is furnished to do so, 5635+subject to the following conditions: 5636+ 5637+The above copyright notice and this permission notice shall be included in all 5638+copies or substantial portions of the Software. 5639+ 5640+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 5641+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 5642+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 5643+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 5644+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 5645+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 5646*/ 5647"use strict"; 5648 5649(function (opticStats) { 5650 5651 opticStats.fn.circliful = function (options, callback) { 5652 5653 var settings = opticStats.extend({ 5654 // These are the defaults. 5655 startdegree: 0, 5656 fgcolor: "#556b2f", 5657 bgcolor: "#eee", 5658 fill: false, 5659 width: 15, 5660 dimension: 200, 5661 fontsize: 15, 5662 percent: 50, 5663 animationstep: 1.0, 5664 iconsize: '20px', 5665 iconcolor: '#999', 5666 border: 'default', 5667 complete: null, 5668 bordersize: 10 5669 }, options); 5670 5671 return this.each(function () { 5672 5673 var customSettings = ["fgcolor", "bgcolor", "fill", "width", "dimension", "fontsize", "animationstep", "endPercent", "icon", "iconcolor", "iconsize", "border", "startdegree", "bordersize"]; 5674 5675 var customSettingsObj = {}; 5676 var icon = ''; 5677 var percent; 5678 var endPercent = 0; 5679 var obj = opticStats(this); 5680 var fill = false;
5681 var text, info; 5682 5683 obj.addClass('circliful'); 5684 5685 checkDataAttributes(obj); 5686 5687 if (obj.data('text') != undefined) { 5688 5689 //remove non number characters 5690 5691 text = obj.data('text'); 5692 text = text.toString(); 5693 text = text.replace(/[^0-9.,]/g, ''); 5694 text = "<span class='counter'>" + text + "</span>"; 5695 5696 if (obj.data('icon') != undefined) { 5697 icon = opticStats('<i></i>') 5698 .addClass('osIcon fa ' + opticStats(this).data('icon')) 5699 .css({ 5700 'color': customSettingsObj.iconcolor, 5701 'font-size': customSettingsObj.iconsize, 5702 'line-height': customSettingsObj.iconsize + "px" 5703 }); 5704 } 5705 if (obj.data('icon-custom') != undefined) { 5706 icon = opticStats('<img src="'+opticStats(this).data("icon-custom")+'"></img>') 5707 .addClass('osIcon ') 5708 .css({ 5709 'width': customSettingsObj.iconsize, 5710 'height': customSettingsObj.iconsize 5711 }); 5712 } 5713 5714 if (obj.data('type') != undefined) { 5715 type = opticStats(this).data('type'); 5716 5717 if (type == 'half') { 5718 addCircleText(obj, 'circle-text-half', (customSettingsObj.dimension / 1.45)); 5719 } else { 5720 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 5721 } 5722 } else { 5723 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 5724 } 5725 } 5726 5727 if (opticStats(this).data("total") != undefined && opticStats(this).data("part") != undefined) { 5728 var total = opticStats(this).data("total") / 100; 5729 5730 percent = ((opticStats(this).data("part") / total) / 100).toFixed(3); 5731 endPercent = (opticStats(this).data("part") / total).toFixed(3); 5732 } else { 5733 if (opticStats(this).data("percent") != undefined) { 5734 percent = opticStats(this).data("percent") / 100; 5735 endPercent = opticStats(this).data("percent"); 5736 } else { 5737 percent = settings.percent / 100; 5738 } 5739 } 5740 5741 if (opticStats(this).data('info') != undefined) { 5742 info = opticStats(this).data('info'); 5743 5744 if (opticStats(this).data('type') != undefined) { 5745 type = opticStats(this).data('type'); 5746 5747 if (type == 'half') { 5748 addInfoText(obj, 0.9); 5749 } else { 5750 addInfoText(obj, 1.25); 5751 } 5752 } else { 5753 addInfoText(obj, 1.25); 5754 } 5755 } 5756 5757 opticStats(this).width(customSettingsObj.dimension + 'px'); 5758 if (type == 'line' || type == 'vert-line') { 5759 opticStats(this).height(opticStats(this).data('height') + 'px'); 5760 } else { 5761 opticStats(this).height(customSettingsObj.dimension + 'px'); 5762 } 5763 5764 5765 var sizeX = customSettingsObj.dimension, 5766 sizeY = customSettingsObj.dimension; 5767 if (type == 'line' || type == 'vert-line') { 5768 sizeY = opticStats(this).data('height'); 5769 } 5770 var canvas = opticStats('<canvas></canvas>').attr({ 5771 width: sizeX, 5772 height: sizeY 5773 }).appendTo(opticStats(this)).get(0); 5774 var context = canvas.getContext('2d'); 5775 5776 var dpr = window.devicePixelRatio; 5777 if ( dpr ) { 5778 var opticStatscanvas = opticStats(canvas); 5779 opticStatscanvas.css('width', sizeX); 5780 opticStatscanvas.css('height', sizeY); 5781 opticStatscanvas.attr('width', sizeX * dpr); 5782 opticStatscanvas.attr('height', sizeY * dpr); 5783 5784 context.scale(dpr, dpr); 5785 } 5786 5787 var container = opticStats(canvas).parent(); 5788 var x = sizeX / 2; 5789 var y = sizeY / 2; 5790 var degrees = customSettingsObj.percent * 360.0; 5791 var radians = degrees * (Math.PI / 180); 5792 var radius = sizeX / 2.5; 5793 var startAngle = 2.3 * Math.PI; 5794 var endAngle = 0; 5795 var counterClockwise = false; 5796 var curPerc = customSettingsObj.animationstep === 0.0 ? endPercent : 0.0; 5797 var curStep = Math.max(customSettingsObj.animationstep, 0.0); 5798 var circ = Math.PI * 2; 5799 var quart = Math.PI / 2; 5800 var type = ''; 5801 var fireCallback = true; 5802 var additionalAngelPI = (customSettingsObj.startdegree / 180) * Math.PI; 5803 5804 if (opticStats(this).data('type') != undefined) { 5805 type = opticStats(this).data('type'); 5806 if (type == 'half') { 5807 startAngle = 2.0 * Math.PI; 5808 endAngle = 3.14; 5809 circ = Math.PI; 5810 quart = Math.PI / 0.996; 5811 } else if (type == 'angle') { 5812 startAngle = 2.25 * Math.PI; 5813 endAngle = 2.4; 5814 circ = 1.53 + Math.PI; 5815 quart = 0.73 + Math.PI / 0.996; 5816 } 5817 } 5818 5819 /** 5820 * adds text to circle 5821 * 5822 * @param obj 5823 * @param cssClass 5824 * @param lineHeight 5825 */ 5826 opticStats(" > span", this).wrapAll("<div class='centerMe'><div></div></div>"); 5827 function addCircleText(obj, cssClass, lineHeight) { 5828 opticStats("<span></span>") 5829 .appendTo(obj) 5830 .addClass(cssClass) 5831 .html(text) 5832 .prepend(icon) 5833 .css({ 5834 //'line-height': lineHeight + 'px', 5835 'font-size': customSettingsObj.fontsize + 'px', 5836 'line-height': customSettingsObj.fontsize + 'px' 5837 }); 5838 } 5839 5840 /** 5841 * adds info text to circle 5842 * 5843 * @param obj 5844 * @param factor 5845 */ 5846 function addInfoText(obj, factor) { 5847 opticStats('<span></span>') 5848 .appendTo(obj) 5849 .addClass('circle-info-half') 5850 //.css( 5851 //'line-height', (customSettingsObj.dimension * factor) + 'px' 5852 //) 5853 .text(info); 5854 } 5855 5856 /** 5857 * checks which data attributes are defined 5858 * @param obj 5859 */ 5860 function checkDataAttributes(obj) { 5861 opticStats.each(customSettings, function (index, attribute) { 5862 if (obj.data(attribute) != undefined) { 5863 customSettingsObj[attribute] = obj.data(attribute); 5864 } else { 5865 customSettingsObj[attribute] = opticStats(settings).attr(attribute); 5866 } 5867 5868 if (attribute == 'fill' && obj.data('fill') != undefined) { 5869 fill = true; 5870 } 5871 }); 5872 } 5873 5874 //Animation Variables 5875 var inc = 0, counter=0,calm = 2,finishFrames=0, animationType = obj.data('animation-type'), slowTheInc = 0; 5876 // ---------------------- // 5877 // Animation Functions 5878 // ---------------------- // 5879 function blend(inColor,outColor,current){ 5880 var inColors = inColor.substring(inColor.indexOf('(') + 1, inColor.lastIndexOf(')')).split(/,\s*/), 5881 outColors = outColor.substring(outColor.indexOf('(') + 1, outColor.lastIndexOf(')')).split(/,\s*/), 5882 r,g,b,a,cur; 5883 for(var i=0; i<inColors.length; i++) { inColors[i] = parseInt(inColors[i], 10); } 5884 for(var i=0; i<outColors.length; i++) { outColors[i] = parseInt(outColors[i], 10); } 5885 if(current < .5 ) { 5886 cur = current*2; 5887 r = Math.min(255,Math.max(0, inColors[0] + (outColors[0] * cur))); 5888 g = Math.min(255,Math.max(0, inColors[1] + (outColors[1] * cur))); 5889 b = Math.min(255,Math.max(0, inColors[2] + (outColors[2] * cur))); 5890 } else { 5891 cur = (current-.5)*2; 5892 r = Math.min(255,Math.max(0,Math.max(inColors[0], outColors[0]) + ((outColors[0] - inColors[0]) * cur))); 5893 g = Math.min(255,Math.max(0,Math.max(inColors[1], outColors[1]) + ((outColors[1] - inColors[1]) * cur))); 5894 b = Math.min(255,Math.max(0,Math.max(inColors[2], outColors[2]) + ((outColors[2] - inColors[2]) * cur))); 5895 } 5896 var a = inColors[3]+((outColors[3] - inColors[3])*current);
5897 return 'rgba('+Math.floor(r)+', '+Math.floor(g)+', '+Math.floor(b)+', '+Math.floor(a)+')'; 5898 } 5899 if (type == 'line' || type == 'vert-line') { 5900 customSettingsObj.bordersize = customSettingsObj.bordersize*2; 5901 } 5902 var increaseInc = function(inc, current) { 5903 if (current >= 1) { 5904 // slowTheInc += 0.00002; 5905 // slowTheInc = Math.min(slowTheInc, 0.005); 5906 // inc = inc + (0.005-slowTheInc); 5907 } else { 5908 inc += 0.005; 5909 } 5910 return inc; 5911 } 5912 var moveColors = function(value, inc) { 5913 var pos = value+inc; 5914 pos = pos.toString(); 5915 pos = pos.split(".").pop(); 5916 pos = parseFloat("."+pos); 5917 return pos; 5918 } 5919 var createGrad = function(inc,sizeX, sizeY) { 5920 var grd=context.createLinearGradient(0,0,sizeX,sizeY); 5921 grd.addColorStop(moveColors(0, inc),"#FF0000"); 5922 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 5923 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 5924 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 5925 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 5926 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 5927 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 5928 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 5929 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 5930 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 5931 grd.addColorStop(moveColors(1, inc),"#FF0000"); 5932 return grd; 5933 } 5934 var shadowGlow = function() { 5935 context.shadowColor = customSettingsObj.fgcolor; 5936 context.shadowOffsetX = 0; 5937 context.shadowOffsetY = 0; 5938 context.shadowBlur = 10; 5939 } 5940 var drawBorder = function() { 5941 context.lineWidth = customSettingsObj.bordersize + 1; 5942 context.strokeStyle = customSettingsObj.bgcolor; 5943 context.stroke(); 5944 if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle') { 5945 // 5946 } else { 5947 context.fillStyle = customSettingsObj.fill; 5948 context.fill(); 5949 } 5950 context.beginPath(); 5951 context.save(); 5952 } 5953 var fillAnimation = function(animationType, current) { 5954 if(animationType == 1){ 5955 context.strokeStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 5956 context.stroke(); 5957 } else if(animationType == 2){ 5958 context.strokeStyle = customSettingsObj.fgcolor; 5959 if (type == 'line') { 5960 var grd=context.createLinearGradient(sizeX,0,0,0); 5961 grd.addColorStop(0,"white"); 5962 grd.addColorStop(1,customSettingsObj.fgcolor); 5963 context.strokeStyle = grd; 5964 shadowGlow(); 5965 } else if (type == 'vert-line') { 5966 var grd=context.createLinearGradient(0,0,0,sizeY); 5967 grd.addColorStop(0,"white"); 5968 grd.addColorStop(1,customSettingsObj.fgcolor); 5969 context.strokeStyle = grd; 5970 shadowGlow(); 5971 } else { 5972 var grd = context.createRadialGradient(sizeX/2, sizeY/2, (sizeX+customSettingsObj.bordersize*2)/2.5, sizeY/2, sizeX/2, (sizeY-customSettingsObj.bordersize*2)/2.5); 5973 grd.addColorStop(0, customSettingsObj.fgcolor); 5974 grd.addColorStop(0.5, 'white'); 5975 grd.addColorStop(1, customSettingsObj.fgcolor); 5976 context.strokeStyle = grd; 5977 shadowGlow(); 5978 } 5979 context.stroke(); 5980 context.restore(); 5981 } else if(animationType == 3){ 5982 if (type == 'line') { 5983 var grd = createGrad(inc,sizeX,sizeY); 5984 inc = increaseInc(inc,current); 5985 context.strokeStyle = grd; 5986 } else if (type == 'vert-line') { 5987 var grd=context.createLinearGradient(sizeX/2,0,sizeX/2,sizeY); 5988 grd.addColorStop(moveColors(0, inc),"#FF0000"); 5989 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 5990 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 5991 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 5992 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 5993 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 5994 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 5995 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 5996 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 5997 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 5998 grd.addColorStop(moveColors(1, inc),"#FF0000"); 5999 inc = increaseInc(inc,current); 6000 context.strokeStyle = grd; 6001 } else { 6002 var grd = createGrad(inc,sizeX,sizeY); 6003 inc = increaseInc(inc,current); 6004 context.strokeStyle = grd; 6005 } 6006 context.stroke();
6007 context.restore(); 6008 } else { 6009 context.strokeStyle = customSettingsObj.fgcolor; 6010 context.stroke(); 6011 } 6012 } 6013 // ---------------------- // 6014 // Animation 6015 // ---------------------- // 6016 function animate(current) { 6017 //Clear Canvas for next frame 6018 context.clearRect(0, 0, canvas.width, canvas.height); 6019 //Draw Background 6020 if (type == 'line' || type == 'vert-line') { 6021 context.rect(10, 10, sizeX-20, sizeY-20); 6022 } else if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle' || type == 'full' || type == 'half') { 6023 context.beginPath(); 6024 context.arc(x, y, radius, endAngle, startAngle, false); 6025 } 6026 context.fillStyle = customSettingsObj.fill; 6027 context.fill(); 6028 if (type == 'line') { 6029 context.beginPath(); 6030 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 6031 context.lineTo(sizeX-10,sizeY-(customSettingsObj.bordersize/2+10)); 6032 drawBorder(); 6033 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 6034 context.lineTo(Math.min((sizeX-20) * current+10,sizeX-10),sizeY-(customSettingsObj.bordersize/2+10)); 6035 fillAnimation(animationType,current); 6036 } else if (type == 'vert-line'){ 6037 context.beginPath(); 6038 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 6039 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),10); 6040 drawBorder(); 6041 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 6042 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),Math.max((sizeY-20) * (1-current)+10,10)); 6043 fillAnimation(animationType,current); 6044 } else if (type == 'full' || type=='half') { 6045 drawBorder(); 6046 context.arc(x, y, radius, -(quart) + additionalAngelPI, ((circ) * (Math.min(current,1)+.005)) - quart + additionalAngelPI, false); 6047 fillAnimation(animationType,current); 6048 } else if (type == 'grow-circle') { 6049 drawBorder(); 6050 var fillRadius = sizeX/2.5*Math.min(current,1); 6051 context.arc(sizeX/2, sizeY/2, Math.max(fillRadius-customSettingsObj.bordersize/2,0), endAngle, startAngle, false); 6052 if(animationType == 1){ 6053 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 6054 context.fill(); 6055 } else if(animationType == 2){ 6056 var grd=context.createLinearGradient(0,0,0,sizeY); 6057 grd.addColorStop(0,"white"); 6058 grd.addColorStop(1,customSettingsObj.fgcolor); 6059 shadowGlow(); 6060 context.fillStyle = grd; 6061 context.fill(); 6062 } else if(animationType == 3){ 6063 var grd = createGrad(inc,sizeX,sizeY); 6064 inc = increaseInc(inc,current); 6065 context.fillStyle = grd; 6066 context.fill(); 6067 } else { 6068 context.fillStyle = customSettingsObj.fgcolor; 6069 context.fill(); 6070 } 6071 context.restore(); 6072 } else if (type == 'fill-circle') { 6073 drawBorder(); 6074 var fillRadius = sizeX/2.5, 6075 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 6076 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 6077 if(animationType == 1){ 6078 context.clip(); 6079 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 6080 context.fillRect(0, fillLine, sizeX, sizeY); 6081 } else if(animationType == 2){ 6082 var grd=context.createLinearGradient(0,0,0,sizeY); 6083 grd.addColorStop(0,"white"); 6084 grd.addColorStop(1,customSettingsObj.fgcolor); 6085 shadowGlow(); 6086 context.clip(); 6087 context.fillStyle = grd; 6088 context.fillRect(0, fillLine, sizeX, sizeY); 6089 6090 } else if(animationType == 3){ 6091 context.clip(); 6092 var grd = createGrad(inc,sizeX, sizeY); 6093 inc = increaseInc(inc,current); 6094 context.fillStyle = grd; 6095 context.fillRect(0, fillLine, sizeX, sizeY); 6096 } else { 6097 context.clip(); 6098 context.fillStyle = customSettingsObj.fgcolor; 6099 context.fillRect(0, fillLine, sizeX, sizeY); 6100 }
6101 context.restore(); 6102 } else if (type == 'fill-circle-wave') { 6103 drawBorder(); 6104 var fillRadius = sizeX/2.5, 6105 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 6106 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 6107 var ypos=fillLine, xpos=0; 6108 counter += .1; 6109 counterLoop = counter; 6110 var increase = 2*Math.PI / 12; 6111 context.clip(); 6112 context.beginPath(); 6113 context.moveTo(sizeX,sizeY); 6114 context.lineTo(0,sizeY); 6115 context.lineTo(0,ypos); 6116 if (curPerc > endPercent) { 6117 calm-=.01; 6118 if(calm<0) calm=0; 6119 } 6120 for(i=0; i<=sizeX; i+=10){ 6121 xpos = i; 6122 ypos = ypos - Math.sin(counterLoop) * calm; 6123 counterLoop += increase; 6124 context.lineTo(xpos,ypos); 6125 } 6126 context.lineTo(sizeX,sizeY); 6127 context.closePath(); 6128 if(animationType == 1){ 6129 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 6130 context.fill(); 6131 } else if(animationType == 2){ 6132 var grd=context.createLinearGradient(0,0,0,sizeY); 6133 grd.addColorStop(0,"white"); 6134 grd.addColorStop(1,customSettingsObj.fgcolor); 6135 shadowGlow(); 6136 context.clip(); 6137 context.fillStyle = grd; 6138 context.fill(); 6139 } else if(animationType == 3){ 6140 context.clip(); 6141 var grd = createGrad(inc,sizeX,sizeY); 6142 inc = increaseInc(inc,current); 6143 context.fillStyle = grd; 6144 context.fill(); 6145 } else { 6146 context.clip(); 6147 context.fillStyle = customSettingsObj.fgcolor; 6148 context.fill(); 6149 } 6150 context.restore(); 6151 } 6152 6153 if (curPerc < endPercent) { 6154 curPerc += curStep; 6155 requestAnimationFrame(function () { 6156 context.strokeStyle = customSettingsObj.fgcolor; 6157 animate(Math.min(curPerc, endPercent) / 100); 6158 }, obj); 6159 } else if(finishFrames < 500) { 6160 curPerc += curStep; 6161 finishFrames+=1; 6162 requestAnimationFrame(function () { 6163 context.strokeStyle = customSettingsObj.fgcolor; 6164 animate(Math.min(curPerc, endPercent) / 100); 6165 }, obj); 6166 } 6167 6168 if (curPerc == endPercent && fireCallback && typeof(options) != "undefined") { 6169 if (opticStats.isFunction(options.complete)) { 6170 options.complete(); 6171 6172 fireCallback = false; 6173 } 6174 } 6175 } 6176 obj.waypoint(function(direction){ 6177 animate(curPerc / 100); 6178 this.destroy(); 6179 }, { offset: '100%' }); 6180 }); 6181 }; 6182}(opticStats)); 6183/* 6184 The MIT License (MIT) 6185 CountUp 6186+Copyright (c) 2014-2015 Jamie Perkins 6187 Permission is hereby granted, free of charge, to any person obtaining a copy of 6188 this software and associated documentation files (the "Software"), to deal in 6189*/ 6190!function(t,a){"function"==typeof define&&define.amd?define(a):"object"==typeof exports?module.exports=a(require,exports,module):t.CountUp=a()}(this,function(){var t=function(t,a,e,n,i,r){for(var o=0,s=["webkit","moz","ms","o"],u=0;u<s.length&&!window.requestAnimationFrame;++u)window.requestAnimationFrame=window[s[u]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[s[u]+"CancelAnimationFrame"]||window[s[u]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var a=(new Date).getTime(),e=Math.max(0,16-(a-o)),n=window.setTimeout(function(){t(a+e)},e);return o=a+e,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),this.options={useEasing:!0,useGrouping:!0,separator:",",decimal:"."};for(var m in r)r.hasOwnProperty(m)&&(this.options[m]=r[m]);""===this.options.separator&&(this.options.useGrouping=!1),this.options.prefix||(this.options.prefix=""),this.options.suffix||(this.options.suffix=""),this.d="string"==typeof t?document.getElementById(t):t,this.startVal=Number(a),this.endVal=Number(e),this.countDown=this.startVal>this.endVal,this.frameVal=this.startVal,this.decimals=Math.max(0,n||0),this.dec=Math.pow(10,this.decimals),this.duration=1e3*Number(i)||2e3;var l=this;this.version=function(){return"1.6.0"},this.printValue=function(t){var a=isNaN(t)?"--":l.formatNumber(t);"INPUT"==l.d.tagName?this.d.value=a:"text"==l.d.tagName||"tspan"==l.d.tagName?this.d.textContent=a:this.d.innerHTML=a},this.easeOutExpo=function(t,a,e,n){return e*(-Math.pow(2,-10*t/n)+1)*1024/1023+a},this.count=function(t){l.startTime||(l.startTime=t),l.timestamp=t;var a=t-l.startTime;l.remaining=l.duration-a,l.frameVal=l.options.useEasing?l.countDown?l.startVal-l.easeOutExpo(a,0,l.startVal-l.endVal,l.duration):l.easeOutExpo(a,l.startVal,l.endVal-l.startVal,l.duration):l.countDown?l.startVal-(l.startVal-l.endVal)*(a/l.duration):l.startVal+(l.endVal-l.startVal)*(a/l.duration),l.frameVal=l.countDown?l.frameVal<l.endVal?l.endVal:l.frameVal:l.frameVal>l.endVal?l.endVal:l.frameVal,l.frameVal=Math.round(l.frameVal*l.dec)/l.dec,l.printValue(l.frameVal),a<l.duration?l.rAF=requestAnimationFrame(l.count):l.callback&&l.callback()},this.start=function(t){return l.callback=t,l.rAF=requestAnimationFrame(l.count),!1},this.pauseResume=function(){l.paused?(l.paused=!1,delete l.startTime,l.duration=l.remaining,l.startVal=l.frameVal,requestAnimationFrame(l.count)):(l.paused=!0,cancelAnimationFrame(l.rAF))},this.reset=function(){l.paused=!1,delete l.startTime,l.startVal=a,cancelAnimationFrame(l.rAF),l.printValue(l.startVal)},this.update=function(t){cancelAnimationFrame(l.rAF),l.paused=!1,delete l.startTime,l.startVal=l.frameVal,l.endVal=Number(t),l.countDown=l.startVal>l.endVal,l.rAF=requestAnimationFrame(l.count)},this.formatNumber=function(t){t=t.toFixed(l.decimals),t+="";var a,e,n,i;if(a=t.split("."),e=a[0],n=a.length>1?l.options.decimal+a[1]:"",i=/(\d+)(\d{3})/,l.options.useGrouping)for(;i.test(e);)e=e.replace(i,"$1"+l.options.separator+"$2");return l.options.prefix+e+n+l.options.suffix},l.printValue(l.startVal)};return t}); 6191/*! 6192Waypoints - 4.0.0 6193Copyright © 2011-2015 Caleb Troughton 6194Licensed under the MIT license. 6195https://github.com/imakewebthings/waypoints/blob/master/licenses.txt 6196*/ 6197!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");
vendor: 6,526 bytes, line 6197
6197this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],r
6197ight:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.opticStatselement=e(t)}var e=opticStats,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.opticStatselement[i].apply(this.opticStatselement,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;opticStats&&(opticStats.fn.waypoint=t(opticStats)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); 6198 6199opticStats( document ).ready(function() { 6200 var speed = 3000, 6201 countNumberstacks_in_98 = "98", 6202 decimalNumber = '0', 6203 decimalNumber = decimalNumber.replace(/\D/g,''), 6204 decimalLength = decimalNumber.length, 6205 maxValuePercentstacks_in_98 = (countNumberstacks_in_98/100), 6206 speedA = (2000/speed)*maxValuePercentstacks_in_98; 6207 if (100 == 0) { 6208 if(countNumberstacks_in_98 < 0) { 6209 maxValuePercentstacks_in_98 = 1; 6210 } else { 6211 maxValuePercentstacks_in_98 = (0-countNumberstacks_in_98)/0; 6212 } 6213 } 6214 if('False' == 'False' ) { 6215 decimalLength = 0; 6216 } else { 6217 countNumberstacks_in_98 = countNumberstacks_in_98.replace(/\D/g,''); 6218 countNumberstacks_in_98 = countNumberstacks_in_98+"."+decimalNumber; 6219 } 6220 if('False' == 'True' ) { 6221 var items = readData_data(opticStats("#data")); 6222 countNumberstacks_in_98 = items['data-A1']; 6223 if(countNumberstacks_in_98 == null) { 6224 countNumberstacks_in_98 = '0'; 6225 } 6226 opticStats("#stat_stacks_in_98").data("percent", maxValuePercentstacks_in_98*100); 6227 // 6228 // 6229 if(countNumberstacks_in_98.indexOf(".") !== -1) { 6230 decimalNumber = countNumberstacks_in_98.substr(countNumberstacks_in_98.indexOf(".") + 1); 6231 decimalNumber = decimalNumber.replace(/\D/g,''); 6232 decimalLength = decimalNumber.length; 6233 countNumberstacks_in_98 = countNumberstacks_in_98.substr(0, countNumberstacks_in_98.indexOf('.')); 6234 } 6235 // 6236 // 6237 countNumberstacks_in_98 = countNumberstacks_in_98.replace(/[^0-9\-]/g,''); 6238 countNumberstacks_in_98 = countNumberstacks_in_98+"."+decimalNumber; 6239 maxValuePercentstacks_in_98 = (countNumberstacks_in_98/100); 6240 if (100 == 0) { 6241 if(countNumberstacks_in_98 < 0) { 6242 maxValuePercentstacks_in_98 = 1; 6243 } else { 6244 maxValuePercentstacks_in_98 = (0-countNumberstacks_in_98)/0; 6245 } 6246 } 6247 speedA = (2000/speed)*maxValuePercentstacks_in_98; 6248 opticStats("#stat_stacks_in_98").data("percent", maxValuePercentstacks_in_98*100); 6249 } else { 6250 var maxValuePercentstacks_in_98 = (countNumberstacks_in_98/100); 6251 if (100 == 0) { 6252 if(countNumberstacks_in_98 < 0) { 6253 maxValuePercentstacks_in_98 = 1; 6254 } else { 6255 maxValuePercentstacks_in_98 = (0-countNumberstacks_in_98)/0; 6256 } 6257 } 6258 speedA = (2000/speed)*maxValuePercentstacks_in_98; 6259 opticStats("#stat_stacks_in_98").data("percent", maxValuePercentstacks_in_98*100); 6260 } 6261 opticStats('#stat_stacks_in_98').attr("data-animationstep", speedA); 6262 opticStats('#stat_stacks_in_98').circliful(); 6263 opticStats('#stat_stacks_in_98').waypoint(function(direction){ 6264 6265 // 6266// opticStats('#stacks_in_98 .counter').counterUp({ 6267// delay: 10, 6268// time: speed 6269// }); 6270 6271 var options = { 6272 // 6273 // 6274 separator : ',', 6275 decimal : '.', 6276 // 6277 // 6278 // 6279 useEasing : false 6280 }; 6281 opticStats('#stacks_in_98 .counter').attr("id", "count_stacks_in_98"); 6282 var count = new CountUp('count_stacks_in_98', 0, countNumberstacks_in_98, decimalLength, (1.9/speedA)*(maxValuePercentstacks_in_98), options);//(1.75/speedA)*(maxValuePercentstacks_in_98) 6283 count.start(); 6284 // 6285 // 6286 opticStats('#stat_stacks_in_98 .circle-text').append("%"); 6287 opticStats('#stat_stacks_in_98 .circle-text-half').append("%"); 6288 // 6289 // 6290 // 6291 // 6292 // 6293 scale(); 6294 this.destroy(); 6295 }, { offset: '100%' }); 6296 6297 6298}); 6299 6300opticStats( window ).resize(function() { 6301 scale(); 6302}); 6303function scale() { 6304 var width = 200, 6305 currentWidth = opticStats('#stat_stacks_in_98').parent().outerWidth(); 6306 if(currentWidth < width) { 6307 var scale = currentWidth/width; 6308 opticStats('#stat_stacks_in_98').css({ 6309 "transform" : "scale("+scale+")", 6310 "transform-origin" : "0px", 6311 "-o-transform" : "scale("+scale+")", 6312 "-o-transform-origin" : "0px" 6313 }); 6314 } else { 6315 opticStats('#stat_stacks_in_98').css({ 6316 "transform" : "scale(1)", 6317 "-o-transform" : "scale(1)" 6318 }); 6319 } 6320} 6321 6322return stack;})(stacks.stacks_in_98); 6323stacks.stacks_in_211 = {}; 6324stacks.stacks_in_211 = (function(stack) { 6325var jQuery = stacks.jQuery;var $ = jQuery;var opticStats = $; 6326/* 6327jquery-plugin-circliful 6328+The MIT License (MIT) 6329+ 6330+Copyright (c) 2014 Patric Gutersohn 6331+ 6332+Permission is hereby granted, free of charge, to any person obtaining a copy of 6333+this software and associated documentation files (the "Software"), to deal in 6334+the Software without restriction, including without limitation the rights to 6335+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 6336+the Software, and to permit persons to whom the Software is furnished to do so, 6337+subject to the following conditions: 6338+ 6339+The above copyright notice and this permission notice shall be included in all 6340+copies or substantial portions of the Software. 6341+ 6342+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 6343+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 6344+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 6345+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 6346+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 6347+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 6348*/ 6349"use strict"; 6350 6351(function (opticStats) { 6352 6353 opticStats.fn.circliful = function (options, callback) { 6354 6355 var settings = opticStats.extend({ 6356 // These are the defaults. 6357 startdegree: 0, 6358 fgcolor: "#556b2f", 6359 bgcolor: "#eee", 6360 fill: false, 6361 width: 15, 6362 dimension: 200, 6363 fontsize: 15, 6364 percent: 50, 6365 animationstep: 1.0, 6366 iconsize: '20px', 6367 iconcolor: '#999', 6368 border: 'default', 6369 complete: null, 6370 bordersize: 10 6371 }, options); 6372 6373 return this.each(function () { 6374 6375 var customSettings = ["fgcolor", "bgcolor", "fill", "width", "dimension", "fontsize", "animationstep", "endPercent", "icon", "iconcolor", "iconsize", "border", "startdegree", "bordersize"]; 6376 6377 var customSettingsObj = {}; 6378 var icon = ''; 6379 var percent; 6380 var endPercent = 0; 6381 var obj = opticStats(this); 6382 var fill = false;
6383 var text, info; 6384 6385 obj.addClass('circliful'); 6386 6387 checkDataAttributes(obj); 6388 6389 if (obj.data('text') != undefined) { 6390 6391 //remove non number characters 6392 6393 text = obj.data('text'); 6394 text = text.toString(); 6395 text = text.replace(/[^0-9.,]/g, ''); 6396 text = "<span class='counter'>" + text + "</span>"; 6397 6398 if (obj.data('icon') != undefined) { 6399 icon = opticStats('<i></i>') 6400 .addClass('osIcon fa ' + opticStats(this).data('icon')) 6401 .css({ 6402 'color': customSettingsObj.iconcolor, 6403 'font-size': customSettingsObj.iconsize, 6404 'line-height': customSettingsObj.iconsize + "px" 6405 }); 6406 } 6407 if (obj.data('icon-custom') != undefined) { 6408 icon = opticStats('<img src="'+opticStats(this).data("icon-custom")+'"></img>') 6409 .addClass('osIcon ') 6410 .css({ 6411 'width': customSettingsObj.iconsize, 6412 'height': customSettingsObj.iconsize 6413 }); 6414 } 6415 6416 if (obj.data('type') != undefined) { 6417 type = opticStats(this).data('type'); 6418 6419 if (type == 'half') { 6420 addCircleText(obj, 'circle-text-half', (customSettingsObj.dimension / 1.45)); 6421 } else { 6422 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 6423 } 6424 } else { 6425 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 6426 } 6427 } 6428 6429 if (opticStats(this).data("total") != undefined && opticStats(this).data("part") != undefined) { 6430 var total = opticStats(this).data("total") / 100; 6431 6432 percent = ((opticStats(this).data("part") / total) / 100).toFixed(3); 6433 endPercent = (opticStats(this).data("part") / total).toFixed(3); 6434 } else { 6435 if (opticStats(this).data("percent") != undefined) { 6436 percent = opticStats(this).data("percent") / 100; 6437 endPercent = opticStats(this).data("percent"); 6438 } else { 6439 percent = settings.percent / 100; 6440 } 6441 } 6442 6443 if (opticStats(this).data('info') != undefined) { 6444 info = opticStats(this).data('info'); 6445 6446 if (opticStats(this).data('type') != undefined) { 6447 type = opticStats(this).data('type'); 6448 6449 if (type == 'half') { 6450 addInfoText(obj, 0.9); 6451 } else { 6452 addInfoText(obj, 1.25); 6453 } 6454 } else { 6455 addInfoText(obj, 1.25); 6456 } 6457 } 6458 6459 opticStats(this).width(customSettingsObj.dimension + 'px'); 6460 if (type == 'line' || type == 'vert-line') { 6461 opticStats(this).height(opticStats(this).data('height') + 'px'); 6462 } else { 6463 opticStats(this).height(customSettingsObj.dimension + 'px'); 6464 } 6465 6466 6467 var sizeX = customSettingsObj.dimension, 6468 sizeY = customSettingsObj.dimension; 6469 if (type == 'line' || type == 'vert-line') { 6470 sizeY = opticStats(this).data('height'); 6471 } 6472 var canvas = opticStats('<canvas></canvas>').attr({ 6473 width: sizeX, 6474 height: sizeY 6475 }).appendTo(opticStats(this)).get(0); 6476 var context = canvas.getContext('2d'); 6477 6478 var dpr = window.devicePixelRatio; 6479 if ( dpr ) { 6480 var opticStatscanvas = opticStats(canvas); 6481 opticStatscanvas.css('width', sizeX); 6482 opticStatscanvas.css('height', sizeY); 6483 opticStatscanvas.attr('width', sizeX * dpr); 6484 opticStatscanvas.attr('height', sizeY * dpr); 6485 6486 context.scale(dpr, dpr); 6487 } 6488 6489 var container = opticStats(canvas).parent(); 6490 var x = sizeX / 2; 6491 var y = sizeY / 2; 6492 var degrees = customSettingsObj.percent * 360.0; 6493 var radians = degrees * (Math.PI / 180); 6494 var radius = sizeX / 2.5; 6495 var startAngle = 2.3 * Math.PI; 6496 var endAngle = 0; 6497 var counterClockwise = false; 6498 var curPerc = customSettingsObj.animationstep === 0.0 ? endPercent : 0.0; 6499 var curStep = Math.max(customSettingsObj.animationstep, 0.0); 6500 var circ = Math.PI * 2; 6501 var quart = Math.PI / 2; 6502 var type = ''; 6503 var fireCallback = true; 6504 var additionalAngelPI = (customSettingsObj.startdegree / 180) * Math.PI; 6505 6506 if (opticStats(this).data('type') != undefined) { 6507 type = opticStats(this).data('type'); 6508 if (type == 'half') { 6509 startAngle = 2.0 * Math.PI; 6510 endAngle = 3.14; 6511 circ = Math.PI; 6512 quart = Math.PI / 0.996; 6513 } else if (type == 'angle') { 6514 startAngle = 2.25 * Math.PI; 6515 endAngle = 2.4; 6516 circ = 1.53 + Math.PI; 6517 quart = 0.73 + Math.PI / 0.996; 6518 } 6519 } 6520 6521 /** 6522 * adds text to circle 6523 * 6524 * @param obj 6525 * @param cssClass 6526 * @param lineHeight 6527 */ 6528 opticStats(" > span", this).wrapAll("<div class='centerMe'><div></div></div>"); 6529 function addCircleText(obj, cssClass, lineHeight) { 6530 opticStats("<span></span>") 6531 .appendTo(obj) 6532 .addClass(cssClass) 6533 .html(text) 6534 .prepend(icon) 6535 .css({ 6536 //'line-height': lineHeight + 'px', 6537 'font-size': customSettingsObj.fontsize + 'px', 6538 'line-height': customSettingsObj.fontsize + 'px' 6539 }); 6540 } 6541 6542 /** 6543 * adds info text to circle 6544 * 6545 * @param obj 6546 * @param factor 6547 */ 6548 function addInfoText(obj, factor) { 6549 opticStats('<span></span>') 6550 .appendTo(obj) 6551 .addClass('circle-info-half') 6552 //.css( 6553 //'line-height', (customSettingsObj.dimension * factor) + 'px' 6554 //) 6555 .text(info); 6556 } 6557 6558 /** 6559 * checks which data attributes are defined 6560 * @param obj 6561 */ 6562 function checkDataAttributes(obj) { 6563 opticStats.each(customSettings, function (index, attribute) { 6564 if (obj.data(attribute) != undefined) { 6565 customSettingsObj[attribute] = obj.data(attribute); 6566 } else { 6567 customSettingsObj[attribute] = opticStats(settings).attr(attribute); 6568 } 6569 6570 if (attribute == 'fill' && obj.data('fill') != undefined) { 6571 fill = true; 6572 } 6573 }); 6574 } 6575 6576 //Animation Variables 6577 var inc = 0, counter=0,calm = 2,finishFrames=0, animationType = obj.data('animation-type'), slowTheInc = 0; 6578 // ---------------------- // 6579 // Animation Functions 6580 // ---------------------- // 6581 function blend(inColor,outColor,current){ 6582 var inColors = inColor.substring(inColor.indexOf('(') + 1, inColor.lastIndexOf(')')).split(/,\s*/), 6583 outColors = outColor.substring(outColor.indexOf('(') + 1, outColor.lastIndexOf(')')).split(/,\s*/), 6584 r,g,b,a,cur; 6585 for(var i=0; i<inColors.length; i++) { inColors[i] = parseInt(inColors[i], 10); } 6586 for(var i=0; i<outColors.length; i++) { outColors[i] = parseInt(outColors[i], 10); } 6587 if(current < .5 ) { 6588 cur = current*2; 6589 r = Math.min(255,Math.max(0, inColors[0] + (outColors[0] * cur))); 6590 g = Math.min(255,Math.max(0, inColors[1] + (outColors[1] * cur))); 6591 b = Math.min(255,Math.max(0, inColors[2] + (outColors[2] * cur))); 6592 } else { 6593 cur = (current-.5)*2; 6594 r = Math.min(255,Math.max(0,Math.max(inColors[0], outColors[0]) + ((outColors[0] - inColors[0]) * cur))); 6595 g = Math.min(255,Math.max(0,Math.max(inColors[1], outColors[1]) + ((outColors[1] - inColors[1]) * cur))); 6596 b = Math.min(255,Math.max(0,Math.max(inColors[2], outColors[2]) + ((outColors[2] - inColors[2]) * cur))); 6597 } 6598 var a = inColors[3]+((outColors[3] - inColors[3])*current);
6599 return 'rgba('+Math.floor(r)+', '+Math.floor(g)+', '+Math.floor(b)+', '+Math.floor(a)+')'; 6600 } 6601 if (type == 'line' || type == 'vert-line') { 6602 customSettingsObj.bordersize = customSettingsObj.bordersize*2; 6603 } 6604 var increaseInc = function(inc, current) { 6605 if (current >= 1) { 6606 // slowTheInc += 0.00002; 6607 // slowTheInc = Math.min(slowTheInc, 0.005); 6608 // inc = inc + (0.005-slowTheInc); 6609 } else { 6610 inc += 0.005; 6611 } 6612 return inc; 6613 } 6614 var moveColors = function(value, inc) { 6615 var pos = value+inc; 6616 pos = pos.toString(); 6617 pos = pos.split(".").pop(); 6618 pos = parseFloat("."+pos); 6619 return pos; 6620 } 6621 var createGrad = function(inc,sizeX, sizeY) { 6622 var grd=context.createLinearGradient(0,0,sizeX,sizeY); 6623 grd.addColorStop(moveColors(0, inc),"#FF0000"); 6624 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 6625 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 6626 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 6627 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 6628 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 6629 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 6630 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 6631 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 6632 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 6633 grd.addColorStop(moveColors(1, inc),"#FF0000"); 6634 return grd; 6635 } 6636 var shadowGlow = function() { 6637 context.shadowColor = customSettingsObj.fgcolor; 6638 context.shadowOffsetX = 0; 6639 context.shadowOffsetY = 0; 6640 context.shadowBlur = 10; 6641 } 6642 var drawBorder = function() { 6643 context.lineWidth = customSettingsObj.bordersize + 1; 6644 context.strokeStyle = customSettingsObj.bgcolor; 6645 context.stroke(); 6646 if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle') { 6647 // 6648 } else { 6649 context.fillStyle = customSettingsObj.fill; 6650 context.fill(); 6651 } 6652 context.beginPath(); 6653 context.save(); 6654 } 6655 var fillAnimation = function(animationType, current) { 6656 if(animationType == 1){ 6657 context.strokeStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 6658 context.stroke(); 6659 } else if(animationType == 2){ 6660 context.strokeStyle = customSettingsObj.fgcolor; 6661 if (type == 'line') { 6662 var grd=context.createLinearGradient(sizeX,0,0,0); 6663 grd.addColorStop(0,"white"); 6664 grd.addColorStop(1,customSettingsObj.fgcolor); 6665 context.strokeStyle = grd; 6666 shadowGlow(); 6667 } else if (type == 'vert-line') { 6668 var grd=context.createLinearGradient(0,0,0,sizeY); 6669 grd.addColorStop(0,"white"); 6670 grd.addColorStop(1,customSettingsObj.fgcolor); 6671 context.strokeStyle = grd; 6672 shadowGlow(); 6673 } else { 6674 var grd = context.createRadialGradient(sizeX/2, sizeY/2, (sizeX+customSettingsObj.bordersize*2)/2.5, sizeY/2, sizeX/2, (sizeY-customSettingsObj.bordersize*2)/2.5); 6675 grd.addColorStop(0, customSettingsObj.fgcolor); 6676 grd.addColorStop(0.5, 'white'); 6677 grd.addColorStop(1, customSettingsObj.fgcolor); 6678 context.strokeStyle = grd; 6679 shadowGlow(); 6680 } 6681 context.stroke(); 6682 context.restore(); 6683 } else if(animationType == 3){ 6684 if (type == 'line') { 6685 var grd = createGrad(inc,sizeX,sizeY); 6686 inc = increaseInc(inc,current); 6687 context.strokeStyle = grd; 6688 } else if (type == 'vert-line') { 6689 var grd=context.createLinearGradient(sizeX/2,0,sizeX/2,sizeY); 6690 grd.addColorStop(moveColors(0, inc),"#FF0000"); 6691 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 6692 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 6693 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 6694 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 6695 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 6696 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 6697 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 6698 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 6699 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 6700 grd.addColorStop(moveColors(1, inc),"#FF0000"); 6701 inc = increaseInc(inc,current); 6702 context.strokeStyle = grd; 6703 } else { 6704 var grd = createGrad(inc,sizeX,sizeY); 6705 inc = increaseInc(inc,current); 6706 context.strokeStyle = grd; 6707 } 6708 context.stroke();
6709 context.restore(); 6710 } else { 6711 context.strokeStyle = customSettingsObj.fgcolor; 6712 context.stroke(); 6713 } 6714 } 6715 // ---------------------- // 6716 // Animation 6717 // ---------------------- // 6718 function animate(current) { 6719 //Clear Canvas for next frame 6720 context.clearRect(0, 0, canvas.width, canvas.height); 6721 //Draw Background 6722 if (type == 'line' || type == 'vert-line') { 6723 context.rect(10, 10, sizeX-20, sizeY-20); 6724 } else if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle' || type == 'full' || type == 'half') { 6725 context.beginPath(); 6726 context.arc(x, y, radius, endAngle, startAngle, false); 6727 } 6728 context.fillStyle = customSettingsObj.fill; 6729 context.fill(); 6730 if (type == 'line') { 6731 context.beginPath(); 6732 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 6733 context.lineTo(sizeX-10,sizeY-(customSettingsObj.bordersize/2+10)); 6734 drawBorder(); 6735 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 6736 context.lineTo(Math.min((sizeX-20) * current+10,sizeX-10),sizeY-(customSettingsObj.bordersize/2+10)); 6737 fillAnimation(animationType,current); 6738 } else if (type == 'vert-line'){ 6739 context.beginPath(); 6740 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 6741 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),10); 6742 drawBorder(); 6743 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 6744 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),Math.max((sizeY-20) * (1-current)+10,10)); 6745 fillAnimation(animationType,current); 6746 } else if (type == 'full' || type=='half') { 6747 drawBorder(); 6748 context.arc(x, y, radius, -(quart) + additionalAngelPI, ((circ) * (Math.min(current,1)+.005)) - quart + additionalAngelPI, false); 6749 fillAnimation(animationType,current); 6750 } else if (type == 'grow-circle') { 6751 drawBorder(); 6752 var fillRadius = sizeX/2.5*Math.min(current,1); 6753 context.arc(sizeX/2, sizeY/2, Math.max(fillRadius-customSettingsObj.bordersize/2,0), endAngle, startAngle, false); 6754 if(animationType == 1){ 6755 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 6756 context.fill(); 6757 } else if(animationType == 2){ 6758 var grd=context.createLinearGradient(0,0,0,sizeY); 6759 grd.addColorStop(0,"white"); 6760 grd.addColorStop(1,customSettingsObj.fgcolor); 6761 shadowGlow(); 6762 context.fillStyle = grd; 6763 context.fill(); 6764 } else if(animationType == 3){ 6765 var grd = createGrad(inc,sizeX,sizeY); 6766 inc = increaseInc(inc,current); 6767 context.fillStyle = grd; 6768 context.fill(); 6769 } else { 6770 context.fillStyle = customSettingsObj.fgcolor; 6771 context.fill(); 6772 } 6773 context.restore(); 6774 } else if (type == 'fill-circle') { 6775 drawBorder(); 6776 var fillRadius = sizeX/2.5, 6777 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 6778 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 6779 if(animationType == 1){ 6780 context.clip(); 6781 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 6782 context.fillRect(0, fillLine, sizeX, sizeY); 6783 } else if(animationType == 2){ 6784 var grd=context.createLinearGradient(0,0,0,sizeY); 6785 grd.addColorStop(0,"white"); 6786 grd.addColorStop(1,customSettingsObj.fgcolor); 6787 shadowGlow(); 6788 context.clip(); 6789 context.fillStyle = grd; 6790 context.fillRect(0, fillLine, sizeX, sizeY); 6791 6792 } else if(animationType == 3){ 6793 context.clip(); 6794 var grd = createGrad(inc,sizeX, sizeY); 6795 inc = increaseInc(inc,current); 6796 context.fillStyle = grd; 6797 context.fillRect(0, fillLine, sizeX, sizeY); 6798 } else { 6799 context.clip(); 6800 context.fillStyle = customSettingsObj.fgcolor; 6801 context.fillRect(0, fillLine, sizeX, sizeY); 6802 }
6803 context.restore(); 6804 } else if (type == 'fill-circle-wave') { 6805 drawBorder(); 6806 var fillRadius = sizeX/2.5, 6807 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 6808 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 6809 var ypos=fillLine, xpos=0; 6810 counter += .1; 6811 counterLoop = counter; 6812 var increase = 2*Math.PI / 12; 6813 context.clip(); 6814 context.beginPath(); 6815 context.moveTo(sizeX,sizeY); 6816 context.lineTo(0,sizeY); 6817 context.lineTo(0,ypos); 6818 if (curPerc > endPercent) { 6819 calm-=.01; 6820 if(calm<0) calm=0; 6821 } 6822 for(i=0; i<=sizeX; i+=10){ 6823 xpos = i; 6824 ypos = ypos - Math.sin(counterLoop) * calm; 6825 counterLoop += increase; 6826 context.lineTo(xpos,ypos); 6827 } 6828 context.lineTo(sizeX,sizeY); 6829 context.closePath(); 6830 if(animationType == 1){ 6831 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 6832 context.fill(); 6833 } else if(animationType == 2){ 6834 var grd=context.createLinearGradient(0,0,0,sizeY); 6835 grd.addColorStop(0,"white"); 6836 grd.addColorStop(1,customSettingsObj.fgcolor); 6837 shadowGlow(); 6838 context.clip(); 6839 context.fillStyle = grd; 6840 context.fill(); 6841 } else if(animationType == 3){ 6842 context.clip(); 6843 var grd = createGrad(inc,sizeX,sizeY); 6844 inc = increaseInc(inc,current); 6845 context.fillStyle = grd; 6846 context.fill(); 6847 } else { 6848 context.clip(); 6849 context.fillStyle = customSettingsObj.fgcolor; 6850 context.fill(); 6851 } 6852 context.restore(); 6853 } 6854 6855 if (curPerc < endPercent) { 6856 curPerc += curStep; 6857 requestAnimationFrame(function () { 6858 context.strokeStyle = customSettingsObj.fgcolor; 6859 animate(Math.min(curPerc, endPercent) / 100); 6860 }, obj); 6861 } else if(finishFrames < 500) { 6862 curPerc += curStep; 6863 finishFrames+=1; 6864 requestAnimationFrame(function () { 6865 context.strokeStyle = customSettingsObj.fgcolor; 6866 animate(Math.min(curPerc, endPercent) / 100); 6867 }, obj); 6868 } 6869 6870 if (curPerc == endPercent && fireCallback && typeof(options) != "undefined") { 6871 if (opticStats.isFunction(options.complete)) { 6872 options.complete(); 6873 6874 fireCallback = false; 6875 } 6876 } 6877 } 6878 obj.waypoint(function(direction){ 6879 animate(curPerc / 100); 6880 this.destroy(); 6881 }, { offset: '100%' }); 6882 }); 6883 }; 6884}(opticStats)); 6885/* 6886 The MIT License (MIT) 6887 CountUp 6888+Copyright (c) 2014-2015 Jamie Perkins 6889 Permission is hereby granted, free of charge, to any person obtaining a copy of 6890 this software and associated documentation files (the "Software"), to deal in 6891*/ 6892!function(t,a){"function"==typeof define&&define.amd?define(a):"object"==typeof exports?module.exports=a(require,exports,module):t.CountUp=a()}(this,function(){var t=function(t,a,e,n,i,r){for(var o=0,s=["webkit","moz","ms","o"],u=0;u<s.length&&!window.requestAnimationFrame;++u)window.requestAnimationFrame=window[s[u]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[s[u]+"CancelAnimationFrame"]||window[s[u]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var a=(new Date).getTime(),e=Math.max(0,16-(a-o)),n=window.setTimeout(function(){t(a+e)},e);return o=a+e,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),this.options={useEasing:!0,useGrouping:!0,separator:",",decimal:"."};for(var m in r)r.hasOwnProperty(m)&&(this.options[m]=r[m]);""===this.options.separator&&(this.options.useGrouping=!1),this.options.prefix||(this.options.prefix=""),this.options.suffix||(this.options.suffix=""),this.d="string"==typeof t?document.getElementById(t):t,this.startVal=Number(a),this.endVal=Number(e),this.countDown=this.startVal>this.endVal,this.frameVal=this.startVal,this.decimals=Math.max(0,n||0),this.dec=Math.pow(10,this.decimals),this.duration=1e3*Number(i)||2e3;var l=this;this.version=function(){return"1.6.0"},this.printValue=function(t){var a=isNaN(t)?"--":l.formatNumber(t);"INPUT"==l.d.tagName?this.d.value=a:"text"==l.d.tagName||"tspan"==l.d.tagName?this.d.textContent=a:this.d.innerHTML=a},this.easeOutExpo=function(t,a,e,n){return e*(-Math.pow(2,-10*t/n)+1)*1024/1023+a},this.count=function(t){l.startTime||(l.startTime=t),l.timestamp=t;var a=t-l.startTime;l.remaining=l.duration-a,l.frameVal=l.options.useEasing?l.countDown?l.startVal-l.easeOutExpo(a,0,l.startVal-l.endVal,l.duration):l.easeOutExpo(a,l.startVal,l.endVal-l.startVal,l.duration):l.countDown?l.startVal-(l.startVal-l.endVal)*(a/l.duration):l.startVal+(l.endVal-l.startVal)*(a/l.duration),l.frameVal=l.countDown?l.frameVal<l.endVal?l.endVal:l.frameVal:l.frameVal>l.endVal?l.endVal:l.frameVal,l.frameVal=Math.round(l.frameVal*l.dec)/l.dec,l.printValue(l.frameVal),a<l.duration?l.rAF=requestAnimationFrame(l.count):l.callback&&l.callback()},this.start=function(t){return l.callback=t,l.rAF=requestAnimationFrame(l.count),!1},this.pauseResume=function(){l.paused?(l.paused=!1,delete l.startTime,l.duration=l.remaining,l.startVal=l.frameVal,requestAnimationFrame(l.count)):(l.paused=!0,cancelAnimationFrame(l.rAF))},this.reset=function(){l.paused=!1,delete l.startTime,l.startVal=a,cancelAnimationFrame(l.rAF),l.printValue(l.startVal)},this.update=function(t){cancelAnimationFrame(l.rAF),l.paused=!1,delete l.startTime,l.startVal=l.frameVal,l.endVal=Number(t),l.countDown=l.startVal>l.endVal,l.rAF=requestAnimationFrame(l.count)},this.formatNumber=function(t){t=t.toFixed(l.decimals),t+="";var a,e,n,i;if(a=t.split("."),e=a[0],n=a.length>1?l.options.decimal+a[1]:"",i=/(\d+)(\d{3})/,l.options.useGrouping)for(;i.test(e);)e=e.replace(i,"$1"+l.options.separator+"$2");return l.options.prefix+e+n+l.options.suffix},l.printValue(l.startVal)};return t}); 6893/*! 6894Waypoints - 4.0.0 6895Copyright © 2011-2015 Caleb Troughton 6896Licensed under the MIT license. 6897https://github.com/imakewebthings/waypoints/blob/master/licenses.txt 6898*/ 6899!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");
vendor: 6,526 bytes, line 6899
6899this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],r
6899ight:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.opticStatselement=e(t)}var e=opticStats,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.opticStatselement[i].apply(this.opticStatselement,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;opticStats&&(opticStats.fn.waypoint=t(opticStats)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); 6900 6901opticStats( document ).ready(function() { 6902 var speed = 3000, 6903 countNumberstacks_in_211 = "60", 6904 decimalNumber = '0', 6905 decimalNumber = decimalNumber.replace(/\D/g,''), 6906 decimalLength = decimalNumber.length, 6907 maxValuePercentstacks_in_211 = (countNumberstacks_in_211/100), 6908 speedA = (2000/speed)*maxValuePercentstacks_in_211; 6909 if (100 == 0) { 6910 if(countNumberstacks_in_211 < 0) { 6911 maxValuePercentstacks_in_211 = 1; 6912 } else { 6913 maxValuePercentstacks_in_211 = (0-countNumberstacks_in_211)/0; 6914 } 6915 } 6916 if('False' == 'False' ) { 6917 decimalLength = 0; 6918 } else { 6919 countNumberstacks_in_211 = countNumberstacks_in_211.replace(/\D/g,''); 6920 countNumberstacks_in_211 = countNumberstacks_in_211+"."+decimalNumber; 6921 } 6922 if('False' == 'True' ) { 6923 var items = readData_data(opticStats("#data")); 6924 countNumberstacks_in_211 = items['data-A1']; 6925 if(countNumberstacks_in_211 == null) { 6926 countNumberstacks_in_211 = '0'; 6927 } 6928 opticStats("#stat_stacks_in_211").data("percent", maxValuePercentstacks_in_211*100); 6929 // 6930 // 6931 if(countNumberstacks_in_211.indexOf(".") !== -1) { 6932 decimalNumber = countNumberstacks_in_211.substr(countNumberstacks_in_211.indexOf(".") + 1); 6933 decimalNumber = decimalNumber.replace(/\D/g,''); 6934 decimalLength = decimalNumber.length; 6935 countNumberstacks_in_211 = countNumberstacks_in_211.substr(0, countNumberstacks_in_211.indexOf('.')); 6936 } 6937 // 6938 // 6939 countNumberstacks_in_211 = countNumberstacks_in_211.replace(/[^0-9\-]/g,''); 6940 countNumberstacks_in_211 = countNumberstacks_in_211+"."+decimalNumber; 6941 maxValuePercentstacks_in_211 = (countNumberstacks_in_211/100); 6942 if (100 == 0) { 6943 if(countNumberstacks_in_211 < 0) { 6944 maxValuePercentstacks_in_211 = 1; 6945 } else { 6946 maxValuePercentstacks_in_211 = (0-countNumberstacks_in_211)/0; 6947 } 6948 } 6949 speedA = (2000/speed)*maxValuePercentstacks_in_211; 6950 opticStats("#stat_stacks_in_211").data("percent", maxValuePercentstacks_in_211*100); 6951 } else { 6952 var maxValuePercentstacks_in_211 = (countNumberstacks_in_211/100); 6953 if (100 == 0) { 6954 if(countNumberstacks_in_211 < 0) { 6955 maxValuePercentstacks_in_211 = 1; 6956 } else { 6957 maxValuePercentstacks_in_211 = (0-countNumberstacks_in_211)/0; 6958 } 6959 } 6960 speedA = (2000/speed)*maxValuePercentstacks_in_211; 6961 opticStats("#stat_stacks_in_211").data("percent", maxValuePercentstacks_in_211*100); 6962 } 6963 opticStats('#stat_stacks_in_211').attr("data-animationstep", speedA); 6964 opticStats('#stat_stacks_in_211').circliful(); 6965 opticStats('#stat_stacks_in_211').waypoint(function(direction){ 6966 6967 // 6968// opticStats('#stacks_in_211 .counter').counterUp({ 6969// delay: 10, 6970// time: speed 6971// }); 6972 6973 var options = { 6974 // 6975 // 6976 separator : ',', 6977 decimal : '.', 6978 // 6979 // 6980 // 6981 useEasing : false 6982 }; 6983 opticStats('#stacks_in_211 .counter').attr("id", "count_stacks_in_211"); 6984 var count = new CountUp('count_stacks_in_211', 0, countNumberstacks_in_211, decimalLength, (1.9/speedA)*(maxValuePercentstacks_in_211), options);//(1.75/speedA)*(maxValuePercentstacks_in_211) 6985 count.start(); 6986 // 6987 // 6988 opticStats('#stat_stacks_in_211 .circle-text').append("%"); 6989 opticStats('#stat_stacks_in_211 .circle-text-half').append("%"); 6990 // 6991 // 6992 // 6993 // 6994 // 6995 scale(); 6996 this.destroy(); 6997 }, { offset: '100%' }); 6998 6999 7000}); 7001 7002opticStats( window ).resize(function() { 7003 scale(); 7004}); 7005function scale() { 7006 var width = 200, 7007 currentWidth = opticStats('#stat_stacks_in_211').parent().outerWidth(); 7008 if(currentWidth < width) { 7009 var scale = currentWidth/width; 7010 opticStats('#stat_stacks_in_211').css({ 7011 "transform" : "scale("+scale+")", 7012 "transform-origin" : "0px", 7013 "-o-transform" : "scale("+scale+")", 7014 "-o-transform-origin" : "0px" 7015 }); 7016 } else { 7017 opticStats('#stat_stacks_in_211').css({ 7018 "transform" : "scale(1)", 7019 "-o-transform" : "scale(1)" 7020 }); 7021 } 7022} 7023 7024return stack;})(stacks.stacks_in_211); 7025stacks.stacks_in_213 = {}; 7026stacks.stacks_in_213 = (function(stack) { 7027var jQuery = stacks.jQuery;var $ = jQuery;var opticStats = $; 7028/* 7029jquery-plugin-circliful 7030+The MIT License (MIT) 7031+ 7032+Copyright (c) 2014 Patric Gutersohn 7033+ 7034+Permission is hereby granted, free of charge, to any person obtaining a copy of 7035+this software and associated documentation files (the "Software"), to deal in 7036+the Software without restriction, including without limitation the rights to 7037+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7038+the Software, and to permit persons to whom the Software is furnished to do so, 7039+subject to the following conditions: 7040+ 7041+The above copyright notice and this permission notice shall be included in all 7042+copies or substantial portions of the Software. 7043+ 7044+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 7045+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 7046+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 7047+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 7048+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 7049+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 7050*/ 7051"use strict"; 7052 7053(function (opticStats) { 7054 7055 opticStats.fn.circliful = function (options, callback) { 7056 7057 var settings = opticStats.extend({ 7058 // These are the defaults. 7059 startdegree: 0, 7060 fgcolor: "#556b2f", 7061 bgcolor: "#eee", 7062 fill: false, 7063 width: 15, 7064 dimension: 200, 7065 fontsize: 15, 7066 percent: 50, 7067 animationstep: 1.0, 7068 iconsize: '20px', 7069 iconcolor: '#999', 7070 border: 'default', 7071 complete: null, 7072 bordersize: 10 7073 }, options); 7074 7075 return this.each(function () { 7076 7077 var customSettings = ["fgcolor", "bgcolor", "fill", "width", "dimension", "fontsize", "animationstep", "endPercent", "icon", "iconcolor", "iconsize", "border", "startdegree", "bordersize"]; 7078 7079 var customSettingsObj = {}; 7080 var icon = ''; 7081 var percent; 7082 var endPercent = 0; 7083 var obj = opticStats(this); 7084 var fill = false;
7085 var text, info; 7086 7087 obj.addClass('circliful'); 7088 7089 checkDataAttributes(obj); 7090 7091 if (obj.data('text') != undefined) { 7092 7093 //remove non number characters 7094 7095 text = obj.data('text'); 7096 text = text.toString(); 7097 text = text.replace(/[^0-9.,]/g, ''); 7098 text = "<span class='counter'>" + text + "</span>"; 7099 7100 if (obj.data('icon') != undefined) { 7101 icon = opticStats('<i></i>') 7102 .addClass('osIcon fa ' + opticStats(this).data('icon')) 7103 .css({ 7104 'color': customSettingsObj.iconcolor, 7105 'font-size': customSettingsObj.iconsize, 7106 'line-height': customSettingsObj.iconsize + "px" 7107 }); 7108 } 7109 if (obj.data('icon-custom') != undefined) { 7110 icon = opticStats('<img src="'+opticStats(this).data("icon-custom")+'"></img>') 7111 .addClass('osIcon ') 7112 .css({ 7113 'width': customSettingsObj.iconsize, 7114 'height': customSettingsObj.iconsize 7115 }); 7116 } 7117 7118 if (obj.data('type') != undefined) { 7119 type = opticStats(this).data('type'); 7120 7121 if (type == 'half') { 7122 addCircleText(obj, 'circle-text-half', (customSettingsObj.dimension / 1.45)); 7123 } else { 7124 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 7125 } 7126 } else { 7127 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 7128 } 7129 } 7130 7131 if (opticStats(this).data("total") != undefined && opticStats(this).data("part") != undefined) { 7132 var total = opticStats(this).data("total") / 100; 7133 7134 percent = ((opticStats(this).data("part") / total) / 100).toFixed(3); 7135 endPercent = (opticStats(this).data("part") / total).toFixed(3); 7136 } else { 7137 if (opticStats(this).data("percent") != undefined) { 7138 percent = opticStats(this).data("percent") / 100; 7139 endPercent = opticStats(this).data("percent"); 7140 } else { 7141 percent = settings.percent / 100; 7142 } 7143 } 7144 7145 if (opticStats(this).data('info') != undefined) { 7146 info = opticStats(this).data('info'); 7147 7148 if (opticStats(this).data('type') != undefined) { 7149 type = opticStats(this).data('type'); 7150 7151 if (type == 'half') { 7152 addInfoText(obj, 0.9); 7153 } else { 7154 addInfoText(obj, 1.25); 7155 } 7156 } else { 7157 addInfoText(obj, 1.25); 7158 } 7159 } 7160 7161 opticStats(this).width(customSettingsObj.dimension + 'px'); 7162 if (type == 'line' || type == 'vert-line') { 7163 opticStats(this).height(opticStats(this).data('height') + 'px'); 7164 } else { 7165 opticStats(this).height(customSettingsObj.dimension + 'px'); 7166 } 7167 7168 7169 var sizeX = customSettingsObj.dimension, 7170 sizeY = customSettingsObj.dimension; 7171 if (type == 'line' || type == 'vert-line') { 7172 sizeY = opticStats(this).data('height'); 7173 } 7174 var canvas = opticStats('<canvas></canvas>').attr({ 7175 width: sizeX, 7176 height: sizeY 7177 }).appendTo(opticStats(this)).get(0); 7178 var context = canvas.getContext('2d'); 7179 7180 var dpr = window.devicePixelRatio; 7181 if ( dpr ) { 7182 var opticStatscanvas = opticStats(canvas); 7183 opticStatscanvas.css('width', sizeX); 7184 opticStatscanvas.css('height', sizeY); 7185 opticStatscanvas.attr('width', sizeX * dpr); 7186 opticStatscanvas.attr('height', sizeY * dpr); 7187 7188 context.scale(dpr, dpr); 7189 } 7190 7191 var container = opticStats(canvas).parent(); 7192 var x = sizeX / 2; 7193 var y = sizeY / 2; 7194 var degrees = customSettingsObj.percent * 360.0; 7195 var radians = degrees * (Math.PI / 180); 7196 var radius = sizeX / 2.5; 7197 var startAngle = 2.3 * Math.PI; 7198 var endAngle = 0; 7199 var counterClockwise = false; 7200 var curPerc = customSettingsObj.animationstep === 0.0 ? endPercent : 0.0; 7201 var curStep = Math.max(customSettingsObj.animationstep, 0.0); 7202 var circ = Math.PI * 2; 7203 var quart = Math.PI / 2; 7204 var type = ''; 7205 var fireCallback = true; 7206 var additionalAngelPI = (customSettingsObj.startdegree / 180) * Math.PI; 7207 7208 if (opticStats(this).data('type') != undefined) { 7209 type = opticStats(this).data('type'); 7210 if (type == 'half') { 7211 startAngle = 2.0 * Math.PI; 7212 endAngle = 3.14; 7213 circ = Math.PI; 7214 quart = Math.PI / 0.996; 7215 } else if (type == 'angle') { 7216 startAngle = 2.25 * Math.PI; 7217 endAngle = 2.4; 7218 circ = 1.53 + Math.PI; 7219 quart = 0.73 + Math.PI / 0.996; 7220 } 7221 } 7222 7223 /** 7224 * adds text to circle 7225 * 7226 * @param obj 7227 * @param cssClass 7228 * @param lineHeight 7229 */ 7230 opticStats(" > span", this).wrapAll("<div class='centerMe'><div></div></div>"); 7231 function addCircleText(obj, cssClass, lineHeight) { 7232 opticStats("<span></span>") 7233 .appendTo(obj) 7234 .addClass(cssClass) 7235 .html(text) 7236 .prepend(icon) 7237 .css({ 7238 //'line-height': lineHeight + 'px', 7239 'font-size': customSettingsObj.fontsize + 'px', 7240 'line-height': customSettingsObj.fontsize + 'px' 7241 }); 7242 } 7243 7244 /** 7245 * adds info text to circle 7246 * 7247 * @param obj 7248 * @param factor 7249 */ 7250 function addInfoText(obj, factor) { 7251 opticStats('<span></span>') 7252 .appendTo(obj) 7253 .addClass('circle-info-half') 7254 //.css( 7255 //'line-height', (customSettingsObj.dimension * factor) + 'px' 7256 //) 7257 .text(info); 7258 } 7259 7260 /** 7261 * checks which data attributes are defined 7262 * @param obj 7263 */ 7264 function checkDataAttributes(obj) { 7265 opticStats.each(customSettings, function (index, attribute) { 7266 if (obj.data(attribute) != undefined) { 7267 customSettingsObj[attribute] = obj.data(attribute); 7268 } else { 7269 customSettingsObj[attribute] = opticStats(settings).attr(attribute); 7270 } 7271 7272 if (attribute == 'fill' && obj.data('fill') != undefined) { 7273 fill = true; 7274 } 7275 }); 7276 } 7277 7278 //Animation Variables 7279 var inc = 0, counter=0,calm = 2,finishFrames=0, animationType = obj.data('animation-type'), slowTheInc = 0; 7280 // ---------------------- // 7281 // Animation Functions 7282 // ---------------------- // 7283 function blend(inColor,outColor,current){ 7284 var inColors = inColor.substring(inColor.indexOf('(') + 1, inColor.lastIndexOf(')')).split(/,\s*/), 7285 outColors = outColor.substring(outColor.indexOf('(') + 1, outColor.lastIndexOf(')')).split(/,\s*/), 7286 r,g,b,a,cur; 7287 for(var i=0; i<inColors.length; i++) { inColors[i] = parseInt(inColors[i], 10); } 7288 for(var i=0; i<outColors.length; i++) { outColors[i] = parseInt(outColors[i], 10); } 7289 if(current < .5 ) { 7290 cur = current*2; 7291 r = Math.min(255,Math.max(0, inColors[0] + (outColors[0] * cur))); 7292 g = Math.min(255,Math.max(0, inColors[1] + (outColors[1] * cur))); 7293 b = Math.min(255,Math.max(0, inColors[2] + (outColors[2] * cur))); 7294 } else { 7295 cur = (current-.5)*2; 7296 r = Math.min(255,Math.max(0,Math.max(inColors[0], outColors[0]) + ((outColors[0] - inColors[0]) * cur))); 7297 g = Math.min(255,Math.max(0,Math.max(inColors[1], outColors[1]) + ((outColors[1] - inColors[1]) * cur))); 7298 b = Math.min(255,Math.max(0,Math.max(inColors[2], outColors[2]) + ((outColors[2] - inColors[2]) * cur))); 7299 } 7300 var a = inColors[3]+((outColors[3] - inColors[3])*current);
7301 return 'rgba('+Math.floor(r)+', '+Math.floor(g)+', '+Math.floor(b)+', '+Math.floor(a)+')'; 7302 } 7303 if (type == 'line' || type == 'vert-line') { 7304 customSettingsObj.bordersize = customSettingsObj.bordersize*2; 7305 } 7306 var increaseInc = function(inc, current) { 7307 if (current >= 1) { 7308 // slowTheInc += 0.00002; 7309 // slowTheInc = Math.min(slowTheInc, 0.005); 7310 // inc = inc + (0.005-slowTheInc); 7311 } else { 7312 inc += 0.005; 7313 } 7314 return inc; 7315 } 7316 var moveColors = function(value, inc) { 7317 var pos = value+inc; 7318 pos = pos.toString(); 7319 pos = pos.split(".").pop(); 7320 pos = parseFloat("."+pos); 7321 return pos; 7322 } 7323 var createGrad = function(inc,sizeX, sizeY) { 7324 var grd=context.createLinearGradient(0,0,sizeX,sizeY); 7325 grd.addColorStop(moveColors(0, inc),"#FF0000"); 7326 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 7327 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 7328 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 7329 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 7330 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 7331 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 7332 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 7333 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 7334 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 7335 grd.addColorStop(moveColors(1, inc),"#FF0000"); 7336 return grd; 7337 } 7338 var shadowGlow = function() { 7339 context.shadowColor = customSettingsObj.fgcolor; 7340 context.shadowOffsetX = 0; 7341 context.shadowOffsetY = 0; 7342 context.shadowBlur = 10; 7343 } 7344 var drawBorder = function() { 7345 context.lineWidth = customSettingsObj.bordersize + 1; 7346 context.strokeStyle = customSettingsObj.bgcolor; 7347 context.stroke(); 7348 if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle') { 7349 // 7350 } else { 7351 context.fillStyle = customSettingsObj.fill; 7352 context.fill(); 7353 } 7354 context.beginPath(); 7355 context.save(); 7356 } 7357 var fillAnimation = function(animationType, current) { 7358 if(animationType == 1){ 7359 context.strokeStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 7360 context.stroke(); 7361 } else if(animationType == 2){ 7362 context.strokeStyle = customSettingsObj.fgcolor; 7363 if (type == 'line') { 7364 var grd=context.createLinearGradient(sizeX,0,0,0); 7365 grd.addColorStop(0,"white"); 7366 grd.addColorStop(1,customSettingsObj.fgcolor); 7367 context.strokeStyle = grd; 7368 shadowGlow(); 7369 } else if (type == 'vert-line') { 7370 var grd=context.createLinearGradient(0,0,0,sizeY); 7371 grd.addColorStop(0,"white"); 7372 grd.addColorStop(1,customSettingsObj.fgcolor); 7373 context.strokeStyle = grd; 7374 shadowGlow(); 7375 } else { 7376 var grd = context.createRadialGradient(sizeX/2, sizeY/2, (sizeX+customSettingsObj.bordersize*2)/2.5, sizeY/2, sizeX/2, (sizeY-customSettingsObj.bordersize*2)/2.5); 7377 grd.addColorStop(0, customSettingsObj.fgcolor); 7378 grd.addColorStop(0.5, 'white'); 7379 grd.addColorStop(1, customSettingsObj.fgcolor); 7380 context.strokeStyle = grd; 7381 shadowGlow(); 7382 } 7383 context.stroke(); 7384 context.restore(); 7385 } else if(animationType == 3){ 7386 if (type == 'line') { 7387 var grd = createGrad(inc,sizeX,sizeY); 7388 inc = increaseInc(inc,current); 7389 context.strokeStyle = grd; 7390 } else if (type == 'vert-line') { 7391 var grd=context.createLinearGradient(sizeX/2,0,sizeX/2,sizeY); 7392 grd.addColorStop(moveColors(0, inc),"#FF0000"); 7393 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 7394 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 7395 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 7396 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 7397 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 7398 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 7399 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 7400 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 7401 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 7402 grd.addColorStop(moveColors(1, inc),"#FF0000"); 7403 inc = increaseInc(inc,current); 7404 context.strokeStyle = grd; 7405 } else { 7406 var grd = createGrad(inc,sizeX,sizeY); 7407 inc = increaseInc(inc,current); 7408 context.strokeStyle = grd; 7409 } 7410 context.stroke();
7411 context.restore(); 7412 } else { 7413 context.strokeStyle = customSettingsObj.fgcolor; 7414 context.stroke(); 7415 } 7416 } 7417 // ---------------------- // 7418 // Animation 7419 // ---------------------- // 7420 function animate(current) { 7421 //Clear Canvas for next frame 7422 context.clearRect(0, 0, canvas.width, canvas.height); 7423 //Draw Background 7424 if (type == 'line' || type == 'vert-line') { 7425 context.rect(10, 10, sizeX-20, sizeY-20); 7426 } else if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle' || type == 'full' || type == 'half') { 7427 context.beginPath(); 7428 context.arc(x, y, radius, endAngle, startAngle, false); 7429 } 7430 context.fillStyle = customSettingsObj.fill; 7431 context.fill(); 7432 if (type == 'line') { 7433 context.beginPath(); 7434 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 7435 context.lineTo(sizeX-10,sizeY-(customSettingsObj.bordersize/2+10)); 7436 drawBorder(); 7437 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 7438 context.lineTo(Math.min((sizeX-20) * current+10,sizeX-10),sizeY-(customSettingsObj.bordersize/2+10)); 7439 fillAnimation(animationType,current); 7440 } else if (type == 'vert-line'){ 7441 context.beginPath(); 7442 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 7443 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),10); 7444 drawBorder(); 7445 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 7446 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),Math.max((sizeY-20) * (1-current)+10,10)); 7447 fillAnimation(animationType,current); 7448 } else if (type == 'full' || type=='half') { 7449 drawBorder(); 7450 context.arc(x, y, radius, -(quart) + additionalAngelPI, ((circ) * (Math.min(current,1)+.005)) - quart + additionalAngelPI, false); 7451 fillAnimation(animationType,current); 7452 } else if (type == 'grow-circle') { 7453 drawBorder(); 7454 var fillRadius = sizeX/2.5*Math.min(current,1); 7455 context.arc(sizeX/2, sizeY/2, Math.max(fillRadius-customSettingsObj.bordersize/2,0), endAngle, startAngle, false); 7456 if(animationType == 1){ 7457 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 7458 context.fill(); 7459 } else if(animationType == 2){ 7460 var grd=context.createLinearGradient(0,0,0,sizeY); 7461 grd.addColorStop(0,"white"); 7462 grd.addColorStop(1,customSettingsObj.fgcolor); 7463 shadowGlow(); 7464 context.fillStyle = grd; 7465 context.fill(); 7466 } else if(animationType == 3){ 7467 var grd = createGrad(inc,sizeX,sizeY); 7468 inc = increaseInc(inc,current); 7469 context.fillStyle = grd; 7470 context.fill(); 7471 } else { 7472 context.fillStyle = customSettingsObj.fgcolor; 7473 context.fill(); 7474 } 7475 context.restore(); 7476 } else if (type == 'fill-circle') { 7477 drawBorder(); 7478 var fillRadius = sizeX/2.5, 7479 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 7480 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 7481 if(animationType == 1){ 7482 context.clip(); 7483 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 7484 context.fillRect(0, fillLine, sizeX, sizeY); 7485 } else if(animationType == 2){ 7486 var grd=context.createLinearGradient(0,0,0,sizeY); 7487 grd.addColorStop(0,"white"); 7488 grd.addColorStop(1,customSettingsObj.fgcolor); 7489 shadowGlow(); 7490 context.clip(); 7491 context.fillStyle = grd; 7492 context.fillRect(0, fillLine, sizeX, sizeY); 7493 7494 } else if(animationType == 3){ 7495 context.clip(); 7496 var grd = createGrad(inc,sizeX, sizeY); 7497 inc = increaseInc(inc,current); 7498 context.fillStyle = grd; 7499 context.fillRect(0, fillLine, sizeX, sizeY); 7500 } else { 7501 context.clip(); 7502 context.fillStyle = customSettingsObj.fgcolor; 7503 context.fillRect(0, fillLine, sizeX, sizeY); 7504 }
7505 context.restore(); 7506 } else if (type == 'fill-circle-wave') { 7507 drawBorder(); 7508 var fillRadius = sizeX/2.5, 7509 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 7510 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 7511 var ypos=fillLine, xpos=0; 7512 counter += .1; 7513 counterLoop = counter; 7514 var increase = 2*Math.PI / 12; 7515 context.clip(); 7516 context.beginPath(); 7517 context.moveTo(sizeX,sizeY); 7518 context.lineTo(0,sizeY); 7519 context.lineTo(0,ypos); 7520 if (curPerc > endPercent) { 7521 calm-=.01; 7522 if(calm<0) calm=0; 7523 } 7524 for(i=0; i<=sizeX; i+=10){ 7525 xpos = i; 7526 ypos = ypos - Math.sin(counterLoop) * calm; 7527 counterLoop += increase; 7528 context.lineTo(xpos,ypos); 7529 } 7530 context.lineTo(sizeX,sizeY); 7531 context.closePath(); 7532 if(animationType == 1){ 7533 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 7534 context.fill(); 7535 } else if(animationType == 2){ 7536 var grd=context.createLinearGradient(0,0,0,sizeY); 7537 grd.addColorStop(0,"white"); 7538 grd.addColorStop(1,customSettingsObj.fgcolor); 7539 shadowGlow(); 7540 context.clip(); 7541 context.fillStyle = grd; 7542 context.fill(); 7543 } else if(animationType == 3){ 7544 context.clip(); 7545 var grd = createGrad(inc,sizeX,sizeY); 7546 inc = increaseInc(inc,current); 7547 context.fillStyle = grd; 7548 context.fill(); 7549 } else { 7550 context.clip(); 7551 context.fillStyle = customSettingsObj.fgcolor; 7552 context.fill(); 7553 } 7554 context.restore(); 7555 } 7556 7557 if (curPerc < endPercent) { 7558 curPerc += curStep; 7559 requestAnimationFrame(function () { 7560 context.strokeStyle = customSettingsObj.fgcolor; 7561 animate(Math.min(curPerc, endPercent) / 100); 7562 }, obj); 7563 } else if(finishFrames < 500) { 7564 curPerc += curStep; 7565 finishFrames+=1; 7566 requestAnimationFrame(function () { 7567 context.strokeStyle = customSettingsObj.fgcolor; 7568 animate(Math.min(curPerc, endPercent) / 100); 7569 }, obj); 7570 } 7571 7572 if (curPerc == endPercent && fireCallback && typeof(options) != "undefined") { 7573 if (opticStats.isFunction(options.complete)) { 7574 options.complete(); 7575 7576 fireCallback = false; 7577 } 7578 } 7579 } 7580 obj.waypoint(function(direction){ 7581 animate(curPerc / 100); 7582 this.destroy(); 7583 }, { offset: '100%' }); 7584 }); 7585 }; 7586}(opticStats)); 7587/* 7588 The MIT License (MIT) 7589 CountUp 7590+Copyright (c) 2014-2015 Jamie Perkins 7591 Permission is hereby granted, free of charge, to any person obtaining a copy of 7592 this software and associated documentation files (the "Software"), to deal in 7593*/ 7594!function(t,a){"function"==typeof define&&define.amd?define(a):"object"==typeof exports?module.exports=a(require,exports,module):t.CountUp=a()}(this,function(){var t=function(t,a,e,n,i,r){for(var o=0,s=["webkit","moz","ms","o"],u=0;u<s.length&&!window.requestAnimationFrame;++u)window.requestAnimationFrame=window[s[u]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[s[u]+"CancelAnimationFrame"]||window[s[u]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var a=(new Date).getTime(),e=Math.max(0,16-(a-o)),n=window.setTimeout(function(){t(a+e)},e);return o=a+e,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),this.options={useEasing:!0,useGrouping:!0,separator:",",decimal:"."};for(var m in r)r.hasOwnProperty(m)&&(this.options[m]=r[m]);""===this.options.separator&&(this.options.useGrouping=!1),this.options.prefix||(this.options.prefix=""),this.options.suffix||(this.options.suffix=""),this.d="string"==typeof t?document.getElementById(t):t,this.startVal=Number(a),this.endVal=Number(e),this.countDown=this.startVal>this.endVal,this.frameVal=this.startVal,this.decimals=Math.max(0,n||0),this.dec=Math.pow(10,this.decimals),this.duration=1e3*Number(i)||2e3;var l=this;this.version=function(){return"1.6.0"},this.printValue=function(t){var a=isNaN(t)?"--":l.formatNumber(t);"INPUT"==l.d.tagName?this.d.value=a:"text"==l.d.tagName||"tspan"==l.d.tagName?this.d.textContent=a:this.d.innerHTML=a},this.easeOutExpo=function(t,a,e,n){return e*(-Math.pow(2,-10*t/n)+1)*1024/1023+a},this.count=function(t){l.startTime||(l.startTime=t),l.timestamp=t;var a=t-l.startTime;l.remaining=l.duration-a,l.frameVal=l.options.useEasing?l.countDown?l.startVal-l.easeOutExpo(a,0,l.startVal-l.endVal,l.duration):l.easeOutExpo(a,l.startVal,l.endVal-l.startVal,l.duration):l.countDown?l.startVal-(l.startVal-l.endVal)*(a/l.duration):l.startVal+(l.endVal-l.startVal)*(a/l.duration),l.frameVal=l.countDown?l.frameVal<l.endVal?l.endVal:l.frameVal:l.frameVal>l.endVal?l.endVal:l.frameVal,l.frameVal=Math.round(l.frameVal*l.dec)/l.dec,l.printValue(l.frameVal),a<l.duration?l.rAF=requestAnimationFrame(l.count):l.callback&&l.callback()},this.start=function(t){return l.callback=t,l.rAF=requestAnimationFrame(l.count),!1},this.pauseResume=function(){l.paused?(l.paused=!1,delete l.startTime,l.duration=l.remaining,l.startVal=l.frameVal,requestAnimationFrame(l.count)):(l.paused=!0,cancelAnimationFrame(l.rAF))},this.reset=function(){l.paused=!1,delete l.startTime,l.startVal=a,cancelAnimationFrame(l.rAF),l.printValue(l.startVal)},this.update=function(t){cancelAnimationFrame(l.rAF),l.paused=!1,delete l.startTime,l.startVal=l.frameVal,l.endVal=Number(t),l.countDown=l.startVal>l.endVal,l.rAF=requestAnimationFrame(l.count)},this.formatNumber=function(t){t=t.toFixed(l.decimals),t+="";var a,e,n,i;if(a=t.split("."),e=a[0],n=a.length>1?l.options.decimal+a[1]:"",i=/(\d+)(\d{3})/,l.options.useGrouping)for(;i.test(e);)e=e.replace(i,"$1"+l.options.separator+"$2");return l.options.prefix+e+n+l.options.suffix},l.printValue(l.startVal)};return t}); 7595/*! 7596Waypoints - 4.0.0 7597Copyright © 2011-2015 Caleb Troughton 7598Licensed under the MIT license. 7599https://github.com/imakewebthings/waypoints/blob/master/licenses.txt 7600*/ 7601!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");
vendor: 6,526 bytes, line 7601
7601this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],r
7601ight:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.opticStatselement=e(t)}var e=opticStats,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.opticStatselement[i].apply(this.opticStatselement,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;opticStats&&(opticStats.fn.waypoint=t(opticStats)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); 7602 7603opticStats( document ).ready(function() { 7604 var speed = 3000, 7605 countNumberstacks_in_213 = "10", 7606 decimalNumber = '0', 7607 decimalNumber = decimalNumber.replace(/\D/g,''), 7608 decimalLength = decimalNumber.length, 7609 maxValuePercentstacks_in_213 = (countNumberstacks_in_213/100), 7610 speedA = (2000/speed)*maxValuePercentstacks_in_213; 7611 if (100 == 0) { 7612 if(countNumberstacks_in_213 < 0) { 7613 maxValuePercentstacks_in_213 = 1; 7614 } else { 7615 maxValuePercentstacks_in_213 = (0-countNumberstacks_in_213)/0; 7616 } 7617 } 7618 if('False' == 'False' ) { 7619 decimalLength = 0; 7620 } else { 7621 countNumberstacks_in_213 = countNumberstacks_in_213.replace(/\D/g,''); 7622 countNumberstacks_in_213 = countNumberstacks_in_213+"."+decimalNumber; 7623 } 7624 if('False' == 'True' ) { 7625 var items = readData_data(opticStats("#data")); 7626 countNumberstacks_in_213 = items['data-A1']; 7627 if(countNumberstacks_in_213 == null) { 7628 countNumberstacks_in_213 = '0'; 7629 } 7630 opticStats("#stat_stacks_in_213").data("percent", maxValuePercentstacks_in_213*100); 7631 // 7632 // 7633 if(countNumberstacks_in_213.indexOf(".") !== -1) { 7634 decimalNumber = countNumberstacks_in_213.substr(countNumberstacks_in_213.indexOf(".") + 1); 7635 decimalNumber = decimalNumber.replace(/\D/g,''); 7636 decimalLength = decimalNumber.length; 7637 countNumberstacks_in_213 = countNumberstacks_in_213.substr(0, countNumberstacks_in_213.indexOf('.')); 7638 } 7639 // 7640 // 7641 countNumberstacks_in_213 = countNumberstacks_in_213.replace(/[^0-9\-]/g,''); 7642 countNumberstacks_in_213 = countNumberstacks_in_213+"."+decimalNumber; 7643 maxValuePercentstacks_in_213 = (countNumberstacks_in_213/100); 7644 if (100 == 0) { 7645 if(countNumberstacks_in_213 < 0) { 7646 maxValuePercentstacks_in_213 = 1; 7647 } else { 7648 maxValuePercentstacks_in_213 = (0-countNumberstacks_in_213)/0; 7649 } 7650 } 7651 speedA = (2000/speed)*maxValuePercentstacks_in_213; 7652 opticStats("#stat_stacks_in_213").data("percent", maxValuePercentstacks_in_213*100); 7653 } else { 7654 var maxValuePercentstacks_in_213 = (countNumberstacks_in_213/100); 7655 if (100 == 0) { 7656 if(countNumberstacks_in_213 < 0) { 7657 maxValuePercentstacks_in_213 = 1; 7658 } else { 7659 maxValuePercentstacks_in_213 = (0-countNumberstacks_in_213)/0; 7660 } 7661 } 7662 speedA = (2000/speed)*maxValuePercentstacks_in_213; 7663 opticStats("#stat_stacks_in_213").data("percent", maxValuePercentstacks_in_213*100); 7664 } 7665 opticStats('#stat_stacks_in_213').attr("data-animationstep", speedA); 7666 opticStats('#stat_stacks_in_213').circliful(); 7667 opticStats('#stat_stacks_in_213').waypoint(function(direction){ 7668 7669 // 7670// opticStats('#stacks_in_213 .counter').counterUp({ 7671// delay: 10, 7672// time: speed 7673// }); 7674 7675 var options = { 7676 // 7677 // 7678 separator : ',', 7679 decimal : '.', 7680 // 7681 // 7682 // 7683 useEasing : false 7684 }; 7685 opticStats('#stacks_in_213 .counter').attr("id", "count_stacks_in_213"); 7686 var count = new CountUp('count_stacks_in_213', 0, countNumberstacks_in_213, decimalLength, (1.9/speedA)*(maxValuePercentstacks_in_213), options);//(1.75/speedA)*(maxValuePercentstacks_in_213) 7687 count.start(); 7688 // 7689 // 7690 opticStats('#stat_stacks_in_213 .circle-text').append("%"); 7691 opticStats('#stat_stacks_in_213 .circle-text-half').append("%"); 7692 // 7693 // 7694 // 7695 // 7696 // 7697 scale(); 7698 this.destroy(); 7699 }, { offset: '100%' }); 7700 7701 7702}); 7703 7704opticStats( window ).resize(function() { 7705 scale(); 7706}); 7707function scale() { 7708 var width = 200, 7709 currentWidth = opticStats('#stat_stacks_in_213').parent().outerWidth(); 7710 if(currentWidth < width) { 7711 var scale = currentWidth/width; 7712 opticStats('#stat_stacks_in_213').css({ 7713 "transform" : "scale("+scale+")", 7714 "transform-origin" : "0px", 7715 "-o-transform" : "scale("+scale+")", 7716 "-o-transform-origin" : "0px" 7717 }); 7718 } else { 7719 opticStats('#stat_stacks_in_213').css({ 7720 "transform" : "scale(1)", 7721 "-o-transform" : "scale(1)" 7722 }); 7723 } 7724} 7725 7726return stack;})(stacks.stacks_in_213); 7727stacks.stacks_in_192 = {}; 7728stacks.stacks_in_192 = (function(stack) { 7729var jQuery = stacks.jQuery;var $ = jQuery;var opticStats = $; 7730/* 7731jquery-plugin-circliful 7732+The MIT License (MIT) 7733+ 7734+Copyright (c) 2014 Patric Gutersohn 7735+ 7736+Permission is hereby granted, free of charge, to any person obtaining a copy of 7737+this software and associated documentation files (the "Software"), to deal in 7738+the Software without restriction, including without limitation the rights to 7739+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7740+the Software, and to permit persons to whom the Software is furnished to do so, 7741+subject to the following conditions: 7742+ 7743+The above copyright notice and this permission notice shall be included in all 7744+copies or substantial portions of the Software. 7745+ 7746+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 7747+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 7748+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 7749+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 7750+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 7751+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 7752*/ 7753"use strict"; 7754 7755(function (opticStats) { 7756 7757 opticStats.fn.circliful = function (options, callback) { 7758 7759 var settings = opticStats.extend({ 7760 // These are the defaults. 7761 startdegree: 0, 7762 fgcolor: "#556b2f", 7763 bgcolor: "#eee", 7764 fill: false, 7765 width: 15, 7766 dimension: 200, 7767 fontsize: 15, 7768 percent: 50, 7769 animationstep: 1.0, 7770 iconsize: '20px', 7771 iconcolor: '#999', 7772 border: 'default', 7773 complete: null, 7774 bordersize: 10 7775 }, options); 7776 7777 return this.each(function () { 7778 7779 var customSettings = ["fgcolor", "bgcolor", "fill", "width", "dimension", "fontsize", "animationstep", "endPercent", "icon", "iconcolor", "iconsize", "border", "startdegree", "bordersize"]; 7780 7781 var customSettingsObj = {}; 7782 var icon = ''; 7783 var percent; 7784 var endPercent = 0; 7785 var obj = opticStats(this); 7786 var fill = false;
7787 var text, info; 7788 7789 obj.addClass('circliful'); 7790 7791 checkDataAttributes(obj); 7792 7793 if (obj.data('text') != undefined) { 7794 7795 //remove non number characters 7796 7797 text = obj.data('text'); 7798 text = text.toString(); 7799 text = text.replace(/[^0-9.,]/g, ''); 7800 text = "<span class='counter'>" + text + "</span>"; 7801 7802 if (obj.data('icon') != undefined) { 7803 icon = opticStats('<i></i>') 7804 .addClass('osIcon fa ' + opticStats(this).data('icon')) 7805 .css({ 7806 'color': customSettingsObj.iconcolor, 7807 'font-size': customSettingsObj.iconsize, 7808 'line-height': customSettingsObj.iconsize + "px" 7809 }); 7810 } 7811 if (obj.data('icon-custom') != undefined) { 7812 icon = opticStats('<img src="'+opticStats(this).data("icon-custom")+'"></img>') 7813 .addClass('osIcon ') 7814 .css({ 7815 'width': customSettingsObj.iconsize, 7816 'height': customSettingsObj.iconsize 7817 }); 7818 } 7819 7820 if (obj.data('type') != undefined) { 7821 type = opticStats(this).data('type'); 7822 7823 if (type == 'half') { 7824 addCircleText(obj, 'circle-text-half', (customSettingsObj.dimension / 1.45)); 7825 } else { 7826 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 7827 } 7828 } else { 7829 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 7830 } 7831 } 7832 7833 if (opticStats(this).data("total") != undefined && opticStats(this).data("part") != undefined) { 7834 var total = opticStats(this).data("total") / 100; 7835 7836 percent = ((opticStats(this).data("part") / total) / 100).toFixed(3); 7837 endPercent = (opticStats(this).data("part") / total).toFixed(3); 7838 } else { 7839 if (opticStats(this).data("percent") != undefined) { 7840 percent = opticStats(this).data("percent") / 100; 7841 endPercent = opticStats(this).data("percent"); 7842 } else { 7843 percent = settings.percent / 100; 7844 } 7845 } 7846 7847 if (opticStats(this).data('info') != undefined) { 7848 info = opticStats(this).data('info'); 7849 7850 if (opticStats(this).data('type') != undefined) { 7851 type = opticStats(this).data('type'); 7852 7853 if (type == 'half') { 7854 addInfoText(obj, 0.9); 7855 } else { 7856 addInfoText(obj, 1.25); 7857 } 7858 } else { 7859 addInfoText(obj, 1.25); 7860 } 7861 } 7862 7863 opticStats(this).width(customSettingsObj.dimension + 'px'); 7864 if (type == 'line' || type == 'vert-line') { 7865 opticStats(this).height(opticStats(this).data('height') + 'px'); 7866 } else { 7867 opticStats(this).height(customSettingsObj.dimension + 'px'); 7868 } 7869 7870 7871 var sizeX = customSettingsObj.dimension, 7872 sizeY = customSettingsObj.dimension; 7873 if (type == 'line' || type == 'vert-line') { 7874 sizeY = opticStats(this).data('height'); 7875 } 7876 var canvas = opticStats('<canvas></canvas>').attr({ 7877 width: sizeX, 7878 height: sizeY 7879 }).appendTo(opticStats(this)).get(0); 7880 var context = canvas.getContext('2d'); 7881 7882 var dpr = window.devicePixelRatio; 7883 if ( dpr ) { 7884 var opticStatscanvas = opticStats(canvas); 7885 opticStatscanvas.css('width', sizeX); 7886 opticStatscanvas.css('height', sizeY); 7887 opticStatscanvas.attr('width', sizeX * dpr); 7888 opticStatscanvas.attr('height', sizeY * dpr); 7889 7890 context.scale(dpr, dpr); 7891 } 7892 7893 var container = opticStats(canvas).parent(); 7894 var x = sizeX / 2; 7895 var y = sizeY / 2; 7896 var degrees = customSettingsObj.percent * 360.0; 7897 var radians = degrees * (Math.PI / 180); 7898 var radius = sizeX / 2.5; 7899 var startAngle = 2.3 * Math.PI; 7900 var endAngle = 0; 7901 var counterClockwise = false; 7902 var curPerc = customSettingsObj.animationstep === 0.0 ? endPercent : 0.0; 7903 var curStep = Math.max(customSettingsObj.animationstep, 0.0); 7904 var circ = Math.PI * 2; 7905 var quart = Math.PI / 2; 7906 var type = ''; 7907 var fireCallback = true; 7908 var additionalAngelPI = (customSettingsObj.startdegree / 180) * Math.PI; 7909 7910 if (opticStats(this).data('type') != undefined) { 7911 type = opticStats(this).data('type'); 7912 if (type == 'half') { 7913 startAngle = 2.0 * Math.PI; 7914 endAngle = 3.14; 7915 circ = Math.PI; 7916 quart = Math.PI / 0.996; 7917 } else if (type == 'angle') { 7918 startAngle = 2.25 * Math.PI; 7919 endAngle = 2.4; 7920 circ = 1.53 + Math.PI; 7921 quart = 0.73 + Math.PI / 0.996; 7922 } 7923 } 7924 7925 /** 7926 * adds text to circle 7927 * 7928 * @param obj 7929 * @param cssClass 7930 * @param lineHeight 7931 */ 7932 opticStats(" > span", this).wrapAll("<div class='centerMe'><div></div></div>"); 7933 function addCircleText(obj, cssClass, lineHeight) { 7934 opticStats("<span></span>") 7935 .appendTo(obj) 7936 .addClass(cssClass) 7937 .html(text) 7938 .prepend(icon) 7939 .css({ 7940 //'line-height': lineHeight + 'px', 7941 'font-size': customSettingsObj.fontsize + 'px', 7942 'line-height': customSettingsObj.fontsize + 'px' 7943 }); 7944 } 7945 7946 /** 7947 * adds info text to circle 7948 * 7949 * @param obj 7950 * @param factor 7951 */ 7952 function addInfoText(obj, factor) { 7953 opticStats('<span></span>') 7954 .appendTo(obj) 7955 .addClass('circle-info-half') 7956 //.css( 7957 //'line-height', (customSettingsObj.dimension * factor) + 'px' 7958 //) 7959 .text(info); 7960 } 7961 7962 /** 7963 * checks which data attributes are defined 7964 * @param obj 7965 */ 7966 function checkDataAttributes(obj) { 7967 opticStats.each(customSettings, function (index, attribute) { 7968 if (obj.data(attribute) != undefined) { 7969 customSettingsObj[attribute] = obj.data(attribute); 7970 } else { 7971 customSettingsObj[attribute] = opticStats(settings).attr(attribute); 7972 } 7973 7974 if (attribute == 'fill' && obj.data('fill') != undefined) { 7975 fill = true; 7976 } 7977 }); 7978 } 7979 7980 //Animation Variables 7981 var inc = 0, counter=0,calm = 2,finishFrames=0, animationType = obj.data('animation-type'), slowTheInc = 0; 7982 // ---------------------- // 7983 // Animation Functions 7984 // ---------------------- // 7985 function blend(inColor,outColor,current){ 7986 var inColors = inColor.substring(inColor.indexOf('(') + 1, inColor.lastIndexOf(')')).split(/,\s*/), 7987 outColors = outColor.substring(outColor.indexOf('(') + 1, outColor.lastIndexOf(')')).split(/,\s*/), 7988 r,g,b,a,cur; 7989 for(var i=0; i<inColors.length; i++) { inColors[i] = parseInt(inColors[i], 10); } 7990 for(var i=0; i<outColors.length; i++) { outColors[i] = parseInt(outColors[i], 10); } 7991 if(current < .5 ) { 7992 cur = current*2; 7993 r = Math.min(255,Math.max(0, inColors[0] + (outColors[0] * cur))); 7994 g = Math.min(255,Math.max(0, inColors[1] + (outColors[1] * cur))); 7995 b = Math.min(255,Math.max(0, inColors[2] + (outColors[2] * cur))); 7996 } else { 7997 cur = (current-.5)*2; 7998 r = Math.min(255,Math.max(0,Math.max(inColors[0], outColors[0]) + ((outColors[0] - inColors[0]) * cur))); 7999 g = Math.min(255,Math.max(0,Math.max(inColors[1], outColors[1]) + ((outColors[1] - inColors[1]) * cur))); 8000 b = Math.min(255,Math.max(0,Math.max(inColors[2], outColors[2]) + ((outColors[2] - inColors[2]) * cur))); 8001 } 8002 var a = inColors[3]+((outColors[3] - inColors[3])*current);
8003 return 'rgba('+Math.floor(r)+', '+Math.floor(g)+', '+Math.floor(b)+', '+Math.floor(a)+')'; 8004 } 8005 if (type == 'line' || type == 'vert-line') { 8006 customSettingsObj.bordersize = customSettingsObj.bordersize*2; 8007 } 8008 var increaseInc = function(inc, current) { 8009 if (current >= 1) { 8010 // slowTheInc += 0.00002; 8011 // slowTheInc = Math.min(slowTheInc, 0.005); 8012 // inc = inc + (0.005-slowTheInc); 8013 } else { 8014 inc += 0.005; 8015 } 8016 return inc; 8017 } 8018 var moveColors = function(value, inc) { 8019 var pos = value+inc; 8020 pos = pos.toString(); 8021 pos = pos.split(".").pop(); 8022 pos = parseFloat("."+pos); 8023 return pos; 8024 } 8025 var createGrad = function(inc,sizeX, sizeY) { 8026 var grd=context.createLinearGradient(0,0,sizeX,sizeY); 8027 grd.addColorStop(moveColors(0, inc),"#FF0000"); 8028 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 8029 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 8030 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 8031 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 8032 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 8033 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 8034 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 8035 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 8036 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 8037 grd.addColorStop(moveColors(1, inc),"#FF0000"); 8038 return grd; 8039 } 8040 var shadowGlow = function() { 8041 context.shadowColor = customSettingsObj.fgcolor; 8042 context.shadowOffsetX = 0; 8043 context.shadowOffsetY = 0; 8044 context.shadowBlur = 10; 8045 } 8046 var drawBorder = function() { 8047 context.lineWidth = customSettingsObj.bordersize + 1; 8048 context.strokeStyle = customSettingsObj.bgcolor; 8049 context.stroke(); 8050 if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle') { 8051 // 8052 } else { 8053 context.fillStyle = customSettingsObj.fill; 8054 context.fill(); 8055 } 8056 context.beginPath(); 8057 context.save(); 8058 } 8059 var fillAnimation = function(animationType, current) { 8060 if(animationType == 1){ 8061 context.strokeStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 8062 context.stroke(); 8063 } else if(animationType == 2){ 8064 context.strokeStyle = customSettingsObj.fgcolor; 8065 if (type == 'line') { 8066 var grd=context.createLinearGradient(sizeX,0,0,0); 8067 grd.addColorStop(0,"white"); 8068 grd.addColorStop(1,customSettingsObj.fgcolor); 8069 context.strokeStyle = grd; 8070 shadowGlow(); 8071 } else if (type == 'vert-line') { 8072 var grd=context.createLinearGradient(0,0,0,sizeY); 8073 grd.addColorStop(0,"white"); 8074 grd.addColorStop(1,customSettingsObj.fgcolor); 8075 context.strokeStyle = grd; 8076 shadowGlow(); 8077 } else { 8078 var grd = context.createRadialGradient(sizeX/2, sizeY/2, (sizeX+customSettingsObj.bordersize*2)/2.5, sizeY/2, sizeX/2, (sizeY-customSettingsObj.bordersize*2)/2.5); 8079 grd.addColorStop(0, customSettingsObj.fgcolor); 8080 grd.addColorStop(0.5, 'white'); 8081 grd.addColorStop(1, customSettingsObj.fgcolor); 8082 context.strokeStyle = grd; 8083 shadowGlow(); 8084 } 8085 context.stroke(); 8086 context.restore(); 8087 } else if(animationType == 3){ 8088 if (type == 'line') { 8089 var grd = createGrad(inc,sizeX,sizeY); 8090 inc = increaseInc(inc,current); 8091 context.strokeStyle = grd; 8092 } else if (type == 'vert-line') { 8093 var grd=context.createLinearGradient(sizeX/2,0,sizeX/2,sizeY); 8094 grd.addColorStop(moveColors(0, inc),"#FF0000"); 8095 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 8096 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 8097 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 8098 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 8099 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 8100 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 8101 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 8102 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 8103 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 8104 grd.addColorStop(moveColors(1, inc),"#FF0000"); 8105 inc = increaseInc(inc,current); 8106 context.strokeStyle = grd; 8107 } else { 8108 var grd = createGrad(inc,sizeX,sizeY); 8109 inc = increaseInc(inc,current); 8110 context.strokeStyle = grd; 8111 } 8112 context.stroke();
8113 context.restore(); 8114 } else { 8115 context.strokeStyle = customSettingsObj.fgcolor; 8116 context.stroke(); 8117 } 8118 } 8119 // ---------------------- // 8120 // Animation 8121 // ---------------------- // 8122 function animate(current) { 8123 //Clear Canvas for next frame 8124 context.clearRect(0, 0, canvas.width, canvas.height); 8125 //Draw Background 8126 if (type == 'line' || type == 'vert-line') { 8127 context.rect(10, 10, sizeX-20, sizeY-20); 8128 } else if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle' || type == 'full' || type == 'half') { 8129 context.beginPath(); 8130 context.arc(x, y, radius, endAngle, startAngle, false); 8131 } 8132 context.fillStyle = customSettingsObj.fill; 8133 context.fill(); 8134 if (type == 'line') { 8135 context.beginPath(); 8136 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 8137 context.lineTo(sizeX-10,sizeY-(customSettingsObj.bordersize/2+10)); 8138 drawBorder(); 8139 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 8140 context.lineTo(Math.min((sizeX-20) * current+10,sizeX-10),sizeY-(customSettingsObj.bordersize/2+10)); 8141 fillAnimation(animationType,current); 8142 } else if (type == 'vert-line'){ 8143 context.beginPath(); 8144 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 8145 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),10); 8146 drawBorder(); 8147 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 8148 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),Math.max((sizeY-20) * (1-current)+10,10)); 8149 fillAnimation(animationType,current); 8150 } else if (type == 'full' || type=='half') { 8151 drawBorder(); 8152 context.arc(x, y, radius, -(quart) + additionalAngelPI, ((circ) * (Math.min(current,1)+.005)) - quart + additionalAngelPI, false); 8153 fillAnimation(animationType,current); 8154 } else if (type == 'grow-circle') { 8155 drawBorder(); 8156 var fillRadius = sizeX/2.5*Math.min(current,1); 8157 context.arc(sizeX/2, sizeY/2, Math.max(fillRadius-customSettingsObj.bordersize/2,0), endAngle, startAngle, false); 8158 if(animationType == 1){ 8159 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 8160 context.fill(); 8161 } else if(animationType == 2){ 8162 var grd=context.createLinearGradient(0,0,0,sizeY); 8163 grd.addColorStop(0,"white"); 8164 grd.addColorStop(1,customSettingsObj.fgcolor); 8165 shadowGlow(); 8166 context.fillStyle = grd; 8167 context.fill(); 8168 } else if(animationType == 3){ 8169 var grd = createGrad(inc,sizeX,sizeY); 8170 inc = increaseInc(inc,current); 8171 context.fillStyle = grd; 8172 context.fill(); 8173 } else { 8174 context.fillStyle = customSettingsObj.fgcolor; 8175 context.fill(); 8176 } 8177 context.restore(); 8178 } else if (type == 'fill-circle') { 8179 drawBorder(); 8180 var fillRadius = sizeX/2.5, 8181 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 8182 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 8183 if(animationType == 1){ 8184 context.clip(); 8185 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 8186 context.fillRect(0, fillLine, sizeX, sizeY); 8187 } else if(animationType == 2){ 8188 var grd=context.createLinearGradient(0,0,0,sizeY); 8189 grd.addColorStop(0,"white"); 8190 grd.addColorStop(1,customSettingsObj.fgcolor); 8191 shadowGlow(); 8192 context.clip(); 8193 context.fillStyle = grd; 8194 context.fillRect(0, fillLine, sizeX, sizeY); 8195 8196 } else if(animationType == 3){ 8197 context.clip(); 8198 var grd = createGrad(inc,sizeX, sizeY); 8199 inc = increaseInc(inc,current); 8200 context.fillStyle = grd; 8201 context.fillRect(0, fillLine, sizeX, sizeY); 8202 } else { 8203 context.clip(); 8204 context.fillStyle = customSettingsObj.fgcolor; 8205 context.fillRect(0, fillLine, sizeX, sizeY); 8206 }
8207 context.restore(); 8208 } else if (type == 'fill-circle-wave') { 8209 drawBorder(); 8210 var fillRadius = sizeX/2.5, 8211 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 8212 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 8213 var ypos=fillLine, xpos=0; 8214 counter += .1; 8215 counterLoop = counter; 8216 var increase = 2*Math.PI / 12; 8217 context.clip(); 8218 context.beginPath(); 8219 context.moveTo(sizeX,sizeY); 8220 context.lineTo(0,sizeY); 8221 context.lineTo(0,ypos); 8222 if (curPerc > endPercent) { 8223 calm-=.01; 8224 if(calm<0) calm=0; 8225 } 8226 for(i=0; i<=sizeX; i+=10){ 8227 xpos = i; 8228 ypos = ypos - Math.sin(counterLoop) * calm; 8229 counterLoop += increase; 8230 context.lineTo(xpos,ypos); 8231 } 8232 context.lineTo(sizeX,sizeY); 8233 context.closePath(); 8234 if(animationType == 1){ 8235 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 8236 context.fill(); 8237 } else if(animationType == 2){ 8238 var grd=context.createLinearGradient(0,0,0,sizeY); 8239 grd.addColorStop(0,"white"); 8240 grd.addColorStop(1,customSettingsObj.fgcolor); 8241 shadowGlow(); 8242 context.clip(); 8243 context.fillStyle = grd; 8244 context.fill(); 8245 } else if(animationType == 3){ 8246 context.clip(); 8247 var grd = createGrad(inc,sizeX,sizeY); 8248 inc = increaseInc(inc,current); 8249 context.fillStyle = grd; 8250 context.fill(); 8251 } else { 8252 context.clip(); 8253 context.fillStyle = customSettingsObj.fgcolor; 8254 context.fill(); 8255 } 8256 context.restore(); 8257 } 8258 8259 if (curPerc < endPercent) { 8260 curPerc += curStep; 8261 requestAnimationFrame(function () { 8262 context.strokeStyle = customSettingsObj.fgcolor; 8263 animate(Math.min(curPerc, endPercent) / 100); 8264 }, obj); 8265 } else if(finishFrames < 500) { 8266 curPerc += curStep; 8267 finishFrames+=1; 8268 requestAnimationFrame(function () { 8269 context.strokeStyle = customSettingsObj.fgcolor; 8270 animate(Math.min(curPerc, endPercent) / 100); 8271 }, obj); 8272 } 8273 8274 if (curPerc == endPercent && fireCallback && typeof(options) != "undefined") { 8275 if (opticStats.isFunction(options.complete)) { 8276 options.complete(); 8277 8278 fireCallback = false; 8279 } 8280 } 8281 } 8282 obj.waypoint(function(direction){ 8283 animate(curPerc / 100); 8284 this.destroy(); 8285 }, { offset: '100%' }); 8286 }); 8287 }; 8288}(opticStats)); 8289/* 8290 The MIT License (MIT) 8291 CountUp 8292+Copyright (c) 2014-2015 Jamie Perkins 8293 Permission is hereby granted, free of charge, to any person obtaining a copy of 8294 this software and associated documentation files (the "Software"), to deal in 8295*/ 8296!function(t,a){"function"==typeof define&&define.amd?define(a):"object"==typeof exports?module.exports=a(require,exports,module):t.CountUp=a()}(this,function(){var t=function(t,a,e,n,i,r){for(var o=0,s=["webkit","moz","ms","o"],u=0;u<s.length&&!window.requestAnimationFrame;++u)window.requestAnimationFrame=window[s[u]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[s[u]+"CancelAnimationFrame"]||window[s[u]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var a=(new Date).getTime(),e=Math.max(0,16-(a-o)),n=window.setTimeout(function(){t(a+e)},e);return o=a+e,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),this.options={useEasing:!0,useGrouping:!0,separator:",",decimal:"."};for(var m in r)r.hasOwnProperty(m)&&(this.options[m]=r[m]);""===this.options.separator&&(this.options.useGrouping=!1),this.options.prefix||(this.options.prefix=""),this.options.suffix||(this.options.suffix=""),this.d="string"==typeof t?document.getElementById(t):t,this.startVal=Number(a),this.endVal=Number(e),this.countDown=this.startVal>this.endVal,this.frameVal=this.startVal,this.decimals=Math.max(0,n||0),this.dec=Math.pow(10,this.decimals),this.duration=1e3*Number(i)||2e3;var l=this;this.version=function(){return"1.6.0"},this.printValue=function(t){var a=isNaN(t)?"--":l.formatNumber(t);"INPUT"==l.d.tagName?this.d.value=a:"text"==l.d.tagName||"tspan"==l.d.tagName?this.d.textContent=a:this.d.innerHTML=a},this.easeOutExpo=function(t,a,e,n){return e*(-Math.pow(2,-10*t/n)+1)*1024/1023+a},this.count=function(t){l.startTime||(l.startTime=t),l.timestamp=t;var a=t-l.startTime;l.remaining=l.duration-a,l.frameVal=l.options.useEasing?l.countDown?l.startVal-l.easeOutExpo(a,0,l.startVal-l.endVal,l.duration):l.easeOutExpo(a,l.startVal,l.endVal-l.startVal,l.duration):l.countDown?l.startVal-(l.startVal-l.endVal)*(a/l.duration):l.startVal+(l.endVal-l.startVal)*(a/l.duration),l.frameVal=l.countDown?l.frameVal<l.endVal?l.endVal:l.frameVal:l.frameVal>l.endVal?l.endVal:l.frameVal,l.frameVal=Math.round(l.frameVal*l.dec)/l.dec,l.printValue(l.frameVal),a<l.duration?l.rAF=requestAnimationFrame(l.count):l.callback&&l.callback()},this.start=function(t){return l.callback=t,l.rAF=requestAnimationFrame(l.count),!1},this.pauseResume=function(){l.paused?(l.paused=!1,delete l.startTime,l.duration=l.remaining,l.startVal=l.frameVal,requestAnimationFrame(l.count)):(l.paused=!0,cancelAnimationFrame(l.rAF))},this.reset=function(){l.paused=!1,delete l.startTime,l.startVal=a,cancelAnimationFrame(l.rAF),l.printValue(l.startVal)},this.update=function(t){cancelAnimationFrame(l.rAF),l.paused=!1,delete l.startTime,l.startVal=l.frameVal,l.endVal=Number(t),l.countDown=l.startVal>l.endVal,l.rAF=requestAnimationFrame(l.count)},this.formatNumber=function(t){t=t.toFixed(l.decimals),t+="";var a,e,n,i;if(a=t.split("."),e=a[0],n=a.length>1?l.options.decimal+a[1]:"",i=/(\d+)(\d{3})/,l.options.useGrouping)for(;i.test(e);)e=e.replace(i,"$1"+l.options.separator+"$2");return l.options.prefix+e+n+l.options.suffix},l.printValue(l.startVal)};return t}); 8297/*! 8298Waypoints - 4.0.0 8299Copyright © 2011-2015 Caleb Troughton 8300Licensed under the MIT license. 8301https://github.com/imakewebthings/waypoints/blob/master/licenses.txt 8302*/ 8303!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");
vendor: 6,526 bytes, line 8303
8303this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],r
8303ight:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.opticStatselement=e(t)}var e=opticStats,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.opticStatselement[i].apply(this.opticStatselement,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;opticStats&&(opticStats.fn.waypoint=t(opticStats)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); 8304 8305opticStats( document ).ready(function() { 8306 var speed = 3000, 8307 countNumberstacks_in_192 = "100", 8308 decimalNumber = '0', 8309 decimalNumber = decimalNumber.replace(/\D/g,''), 8310 decimalLength = decimalNumber.length, 8311 maxValuePercentstacks_in_192 = (countNumberstacks_in_192/100), 8312 speedA = (2000/speed)*maxValuePercentstacks_in_192; 8313 if (100 == 0) { 8314 if(countNumberstacks_in_192 < 0) { 8315 maxValuePercentstacks_in_192 = 1; 8316 } else { 8317 maxValuePercentstacks_in_192 = (0-countNumberstacks_in_192)/0; 8318 } 8319 } 8320 if('False' == 'False' ) { 8321 decimalLength = 0; 8322 } else { 8323 countNumberstacks_in_192 = countNumberstacks_in_192.replace(/\D/g,''); 8324 countNumberstacks_in_192 = countNumberstacks_in_192+"."+decimalNumber; 8325 } 8326 if('False' == 'True' ) { 8327 var items = readData_data(opticStats("#data")); 8328 countNumberstacks_in_192 = items['data-A1']; 8329 if(countNumberstacks_in_192 == null) { 8330 countNumberstacks_in_192 = '0'; 8331 } 8332 opticStats("#stat_stacks_in_192").data("percent", maxValuePercentstacks_in_192*100); 8333 // 8334 // 8335 if(countNumberstacks_in_192.indexOf(".") !== -1) { 8336 decimalNumber = countNumberstacks_in_192.substr(countNumberstacks_in_192.indexOf(".") + 1); 8337 decimalNumber = decimalNumber.replace(/\D/g,''); 8338 decimalLength = decimalNumber.length; 8339 countNumberstacks_in_192 = countNumberstacks_in_192.substr(0, countNumberstacks_in_192.indexOf('.')); 8340 } 8341 // 8342 // 8343 countNumberstacks_in_192 = countNumberstacks_in_192.replace(/[^0-9\-]/g,''); 8344 countNumberstacks_in_192 = countNumberstacks_in_192+"."+decimalNumber; 8345 maxValuePercentstacks_in_192 = (countNumberstacks_in_192/100); 8346 if (100 == 0) { 8347 if(countNumberstacks_in_192 < 0) { 8348 maxValuePercentstacks_in_192 = 1; 8349 } else { 8350 maxValuePercentstacks_in_192 = (0-countNumberstacks_in_192)/0; 8351 } 8352 } 8353 speedA = (2000/speed)*maxValuePercentstacks_in_192; 8354 opticStats("#stat_stacks_in_192").data("percent", maxValuePercentstacks_in_192*100); 8355 } else { 8356 var maxValuePercentstacks_in_192 = (countNumberstacks_in_192/100); 8357 if (100 == 0) { 8358 if(countNumberstacks_in_192 < 0) { 8359 maxValuePercentstacks_in_192 = 1; 8360 } else { 8361 maxValuePercentstacks_in_192 = (0-countNumberstacks_in_192)/0; 8362 } 8363 } 8364 speedA = (2000/speed)*maxValuePercentstacks_in_192; 8365 opticStats("#stat_stacks_in_192").data("percent", maxValuePercentstacks_in_192*100); 8366 } 8367 opticStats('#stat_stacks_in_192').attr("data-animationstep", speedA); 8368 opticStats('#stat_stacks_in_192').circliful(); 8369 opticStats('#stat_stacks_in_192').waypoint(function(direction){ 8370 8371 // 8372// opticStats('#stacks_in_192 .counter').counterUp({ 8373// delay: 10, 8374// time: speed 8375// }); 8376 8377 var options = { 8378 // 8379 // 8380 separator : ',', 8381 decimal : '.', 8382 // 8383 // 8384 // 8385 useEasing : false 8386 }; 8387 opticStats('#stacks_in_192 .counter').attr("id", "count_stacks_in_192"); 8388 var count = new CountUp('count_stacks_in_192', 0, countNumberstacks_in_192, decimalLength, (1.9/speedA)*(maxValuePercentstacks_in_192), options);//(1.75/speedA)*(maxValuePercentstacks_in_192) 8389 count.start(); 8390 // 8391 // 8392 opticStats('#stat_stacks_in_192 .circle-text').append("%"); 8393 opticStats('#stat_stacks_in_192 .circle-text-half').append("%"); 8394 // 8395 // 8396 // 8397 // 8398 // 8399 scale(); 8400 this.destroy(); 8401 }, { offset: '100%' }); 8402 8403 8404}); 8405 8406opticStats( window ).resize(function() { 8407 scale(); 8408}); 8409function scale() { 8410 var width = 200, 8411 currentWidth = opticStats('#stat_stacks_in_192').parent().outerWidth(); 8412 if(currentWidth < width) { 8413 var scale = currentWidth/width; 8414 opticStats('#stat_stacks_in_192').css({ 8415 "transform" : "scale("+scale+")", 8416 "transform-origin" : "0px", 8417 "-o-transform" : "scale("+scale+")", 8418 "-o-transform-origin" : "0px" 8419 }); 8420 } else { 8421 opticStats('#stat_stacks_in_192').css({ 8422 "transform" : "scale(1)", 8423 "-o-transform" : "scale(1)" 8424 }); 8425 } 8426} 8427 8428return stack;})(stacks.stacks_in_192); 8429stacks.stacks_in_196 = {}; 8430stacks.stacks_in_196 = (function(stack) { 8431var jQuery = stacks.jQuery;var $ = jQuery;var opticStats = $; 8432/* 8433jquery-plugin-circliful 8434+The MIT License (MIT) 8435+ 8436+Copyright (c) 2014 Patric Gutersohn 8437+ 8438+Permission is hereby granted, free of charge, to any person obtaining a copy of 8439+this software and associated documentation files (the "Software"), to deal in 8440+the Software without restriction, including without limitation the rights to 8441+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8442+the Software, and to permit persons to whom the Software is furnished to do so, 8443+subject to the following conditions: 8444+ 8445+The above copyright notice and this permission notice shall be included in all 8446+copies or substantial portions of the Software. 8447+ 8448+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 8449+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 8450+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 8451+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 8452+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 8453+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8454*/ 8455"use strict"; 8456 8457(function (opticStats) { 8458 8459 opticStats.fn.circliful = function (options, callback) { 8460 8461 var settings = opticStats.extend({ 8462 // These are the defaults. 8463 startdegree: 0, 8464 fgcolor: "#556b2f", 8465 bgcolor: "#eee", 8466 fill: false, 8467 width: 15, 8468 dimension: 200, 8469 fontsize: 15, 8470 percent: 50, 8471 animationstep: 1.0, 8472 iconsize: '20px', 8473 iconcolor: '#999', 8474 border: 'default', 8475 complete: null, 8476 bordersize: 10 8477 }, options); 8478 8479 return this.each(function () { 8480 8481 var customSettings = ["fgcolor", "bgcolor", "fill", "width", "dimension", "fontsize", "animationstep", "endPercent", "icon", "iconcolor", "iconsize", "border", "startdegree", "bordersize"]; 8482 8483 var customSettingsObj = {}; 8484 var icon = ''; 8485 var percent; 8486 var endPercent = 0; 8487 var obj = opticStats(this); 8488 var fill = false;
8489 var text, info; 8490 8491 obj.addClass('circliful'); 8492 8493 checkDataAttributes(obj); 8494 8495 if (obj.data('text') != undefined) { 8496 8497 //remove non number characters 8498 8499 text = obj.data('text'); 8500 text = text.toString(); 8501 text = text.replace(/[^0-9.,]/g, ''); 8502 text = "<span class='counter'>" + text + "</span>"; 8503 8504 if (obj.data('icon') != undefined) { 8505 icon = opticStats('<i></i>') 8506 .addClass('osIcon fa ' + opticStats(this).data('icon')) 8507 .css({ 8508 'color': customSettingsObj.iconcolor, 8509 'font-size': customSettingsObj.iconsize, 8510 'line-height': customSettingsObj.iconsize + "px" 8511 }); 8512 } 8513 if (obj.data('icon-custom') != undefined) { 8514 icon = opticStats('<img src="'+opticStats(this).data("icon-custom")+'"></img>') 8515 .addClass('osIcon ') 8516 .css({ 8517 'width': customSettingsObj.iconsize, 8518 'height': customSettingsObj.iconsize 8519 }); 8520 } 8521 8522 if (obj.data('type') != undefined) { 8523 type = opticStats(this).data('type'); 8524 8525 if (type == 'half') { 8526 addCircleText(obj, 'circle-text-half', (customSettingsObj.dimension / 1.45)); 8527 } else { 8528 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 8529 } 8530 } else { 8531 addCircleText(obj, 'circle-text', customSettingsObj.dimension); 8532 } 8533 } 8534 8535 if (opticStats(this).data("total") != undefined && opticStats(this).data("part") != undefined) { 8536 var total = opticStats(this).data("total") / 100; 8537 8538 percent = ((opticStats(this).data("part") / total) / 100).toFixed(3); 8539 endPercent = (opticStats(this).data("part") / total).toFixed(3); 8540 } else { 8541 if (opticStats(this).data("percent") != undefined) { 8542 percent = opticStats(this).data("percent") / 100; 8543 endPercent = opticStats(this).data("percent"); 8544 } else { 8545 percent = settings.percent / 100; 8546 } 8547 } 8548 8549 if (opticStats(this).data('info') != undefined) { 8550 info = opticStats(this).data('info'); 8551 8552 if (opticStats(this).data('type') != undefined) { 8553 type = opticStats(this).data('type'); 8554 8555 if (type == 'half') { 8556 addInfoText(obj, 0.9); 8557 } else { 8558 addInfoText(obj, 1.25); 8559 } 8560 } else { 8561 addInfoText(obj, 1.25); 8562 } 8563 } 8564 8565 opticStats(this).width(customSettingsObj.dimension + 'px'); 8566 if (type == 'line' || type == 'vert-line') { 8567 opticStats(this).height(opticStats(this).data('height') + 'px'); 8568 } else { 8569 opticStats(this).height(customSettingsObj.dimension + 'px'); 8570 } 8571 8572 8573 var sizeX = customSettingsObj.dimension, 8574 sizeY = customSettingsObj.dimension; 8575 if (type == 'line' || type == 'vert-line') { 8576 sizeY = opticStats(this).data('height'); 8577 } 8578 var canvas = opticStats('<canvas></canvas>').attr({ 8579 width: sizeX, 8580 height: sizeY 8581 }).appendTo(opticStats(this)).get(0); 8582 var context = canvas.getContext('2d'); 8583 8584 var dpr = window.devicePixelRatio; 8585 if ( dpr ) { 8586 var opticStatscanvas = opticStats(canvas); 8587 opticStatscanvas.css('width', sizeX); 8588 opticStatscanvas.css('height', sizeY); 8589 opticStatscanvas.attr('width', sizeX * dpr); 8590 opticStatscanvas.attr('height', sizeY * dpr); 8591 8592 context.scale(dpr, dpr); 8593 } 8594 8595 var container = opticStats(canvas).parent(); 8596 var x = sizeX / 2; 8597 var y = sizeY / 2; 8598 var degrees = customSettingsObj.percent * 360.0; 8599 var radians = degrees * (Math.PI / 180); 8600 var radius = sizeX / 2.5; 8601 var startAngle = 2.3 * Math.PI; 8602 var endAngle = 0; 8603 var counterClockwise = false; 8604 var curPerc = customSettingsObj.animationstep === 0.0 ? endPercent : 0.0; 8605 var curStep = Math.max(customSettingsObj.animationstep, 0.0); 8606 var circ = Math.PI * 2; 8607 var quart = Math.PI / 2; 8608 var type = ''; 8609 var fireCallback = true; 8610 var additionalAngelPI = (customSettingsObj.startdegree / 180) * Math.PI; 8611 8612 if (opticStats(this).data('type') != undefined) { 8613 type = opticStats(this).data('type'); 8614 if (type == 'half') { 8615 startAngle = 2.0 * Math.PI; 8616 endAngle = 3.14; 8617 circ = Math.PI; 8618 quart = Math.PI / 0.996; 8619 } else if (type == 'angle') { 8620 startAngle = 2.25 * Math.PI; 8621 endAngle = 2.4; 8622 circ = 1.53 + Math.PI; 8623 quart = 0.73 + Math.PI / 0.996; 8624 } 8625 } 8626 8627 /** 8628 * adds text to circle 8629 * 8630 * @param obj 8631 * @param cssClass 8632 * @param lineHeight 8633 */ 8634 opticStats(" > span", this).wrapAll("<div class='centerMe'><div></div></div>"); 8635 function addCircleText(obj, cssClass, lineHeight) { 8636 opticStats("<span></span>") 8637 .appendTo(obj) 8638 .addClass(cssClass) 8639 .html(text) 8640 .prepend(icon) 8641 .css({ 8642 //'line-height': lineHeight + 'px', 8643 'font-size': customSettingsObj.fontsize + 'px', 8644 'line-height': customSettingsObj.fontsize + 'px' 8645 }); 8646 } 8647 8648 /** 8649 * adds info text to circle 8650 * 8651 * @param obj 8652 * @param factor 8653 */ 8654 function addInfoText(obj, factor) { 8655 opticStats('<span></span>') 8656 .appendTo(obj) 8657 .addClass('circle-info-half') 8658 //.css( 8659 //'line-height', (customSettingsObj.dimension * factor) + 'px' 8660 //) 8661 .text(info); 8662 } 8663 8664 /** 8665 * checks which data attributes are defined 8666 * @param obj 8667 */ 8668 function checkDataAttributes(obj) { 8669 opticStats.each(customSettings, function (index, attribute) { 8670 if (obj.data(attribute) != undefined) { 8671 customSettingsObj[attribute] = obj.data(attribute); 8672 } else { 8673 customSettingsObj[attribute] = opticStats(settings).attr(attribute); 8674 } 8675 8676 if (attribute == 'fill' && obj.data('fill') != undefined) { 8677 fill = true; 8678 } 8679 }); 8680 } 8681 8682 //Animation Variables 8683 var inc = 0, counter=0,calm = 2,finishFrames=0, animationType = obj.data('animation-type'), slowTheInc = 0; 8684 // ---------------------- // 8685 // Animation Functions 8686 // ---------------------- // 8687 function blend(inColor,outColor,current){ 8688 var inColors = inColor.substring(inColor.indexOf('(') + 1, inColor.lastIndexOf(')')).split(/,\s*/), 8689 outColors = outColor.substring(outColor.indexOf('(') + 1, outColor.lastIndexOf(')')).split(/,\s*/), 8690 r,g,b,a,cur; 8691 for(var i=0; i<inColors.length; i++) { inColors[i] = parseInt(inColors[i], 10); } 8692 for(var i=0; i<outColors.length; i++) { outColors[i] = parseInt(outColors[i], 10); } 8693 if(current < .5 ) { 8694 cur = current*2; 8695 r = Math.min(255,Math.max(0, inColors[0] + (outColors[0] * cur))); 8696 g = Math.min(255,Math.max(0, inColors[1] + (outColors[1] * cur))); 8697 b = Math.min(255,Math.max(0, inColors[2] + (outColors[2] * cur))); 8698 } else { 8699 cur = (current-.5)*2; 8700 r = Math.min(255,Math.max(0,Math.max(inColors[0], outColors[0]) + ((outColors[0] - inColors[0]) * cur))); 8701 g = Math.min(255,Math.max(0,Math.max(inColors[1], outColors[1]) + ((outColors[1] - inColors[1]) * cur))); 8702 b = Math.min(255,Math.max(0,Math.max(inColors[2], outColors[2]) + ((outColors[2] - inColors[2]) * cur))); 8703 } 8704 var a = inColors[3]+((outColors[3] - inColors[3])*current);
8705 return 'rgba('+Math.floor(r)+', '+Math.floor(g)+', '+Math.floor(b)+', '+Math.floor(a)+')'; 8706 } 8707 if (type == 'line' || type == 'vert-line') { 8708 customSettingsObj.bordersize = customSettingsObj.bordersize*2; 8709 } 8710 var increaseInc = function(inc, current) { 8711 if (current >= 1) { 8712 // slowTheInc += 0.00002; 8713 // slowTheInc = Math.min(slowTheInc, 0.005); 8714 // inc = inc + (0.005-slowTheInc); 8715 } else { 8716 inc += 0.005; 8717 } 8718 return inc; 8719 } 8720 var moveColors = function(value, inc) { 8721 var pos = value+inc; 8722 pos = pos.toString(); 8723 pos = pos.split(".").pop(); 8724 pos = parseFloat("."+pos); 8725 return pos; 8726 } 8727 var createGrad = function(inc,sizeX, sizeY) { 8728 var grd=context.createLinearGradient(0,0,sizeX,sizeY); 8729 grd.addColorStop(moveColors(0, inc),"#FF0000"); 8730 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 8731 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 8732 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 8733 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 8734 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 8735 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 8736 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 8737 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 8738 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 8739 grd.addColorStop(moveColors(1, inc),"#FF0000"); 8740 return grd; 8741 } 8742 var shadowGlow = function() { 8743 context.shadowColor = customSettingsObj.fgcolor; 8744 context.shadowOffsetX = 0; 8745 context.shadowOffsetY = 0; 8746 context.shadowBlur = 10; 8747 } 8748 var drawBorder = function() { 8749 context.lineWidth = customSettingsObj.bordersize + 1; 8750 context.strokeStyle = customSettingsObj.bgcolor; 8751 context.stroke(); 8752 if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle') { 8753 // 8754 } else { 8755 context.fillStyle = customSettingsObj.fill; 8756 context.fill(); 8757 } 8758 context.beginPath(); 8759 context.save(); 8760 } 8761 var fillAnimation = function(animationType, current) { 8762 if(animationType == 1){ 8763 context.strokeStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 8764 context.stroke(); 8765 } else if(animationType == 2){ 8766 context.strokeStyle = customSettingsObj.fgcolor; 8767 if (type == 'line') { 8768 var grd=context.createLinearGradient(sizeX,0,0,0); 8769 grd.addColorStop(0,"white"); 8770 grd.addColorStop(1,customSettingsObj.fgcolor); 8771 context.strokeStyle = grd; 8772 shadowGlow(); 8773 } else if (type == 'vert-line') { 8774 var grd=context.createLinearGradient(0,0,0,sizeY); 8775 grd.addColorStop(0,"white"); 8776 grd.addColorStop(1,customSettingsObj.fgcolor); 8777 context.strokeStyle = grd; 8778 shadowGlow(); 8779 } else { 8780 var grd = context.createRadialGradient(sizeX/2, sizeY/2, (sizeX+customSettingsObj.bordersize*2)/2.5, sizeY/2, sizeX/2, (sizeY-customSettingsObj.bordersize*2)/2.5); 8781 grd.addColorStop(0, customSettingsObj.fgcolor); 8782 grd.addColorStop(0.5, 'white'); 8783 grd.addColorStop(1, customSettingsObj.fgcolor); 8784 context.strokeStyle = grd; 8785 shadowGlow(); 8786 } 8787 context.stroke(); 8788 context.restore(); 8789 } else if(animationType == 3){ 8790 if (type == 'line') { 8791 var grd = createGrad(inc,sizeX,sizeY); 8792 inc = increaseInc(inc,current); 8793 context.strokeStyle = grd; 8794 } else if (type == 'vert-line') { 8795 var grd=context.createLinearGradient(sizeX/2,0,sizeX/2,sizeY); 8796 grd.addColorStop(moveColors(0, inc),"#FF0000"); 8797 grd.addColorStop(moveColors(.1, inc),"#FFFF00"); 8798 grd.addColorStop(moveColors(.2, inc),"#00FF00"); 8799 grd.addColorStop(moveColors(.3, inc),"#0000FF"); 8800 grd.addColorStop(moveColors(.4, inc),"#FF00FF"); 8801 grd.addColorStop(moveColors(.5, inc),"#FF0000"); 8802 grd.addColorStop(moveColors(.6, inc),"#FFFF00"); 8803 grd.addColorStop(moveColors(.7, inc),"#00FF00"); 8804 grd.addColorStop(moveColors(.8, inc),"#0000FF"); 8805 grd.addColorStop(moveColors(.9, inc),"#FF00FF"); 8806 grd.addColorStop(moveColors(1, inc),"#FF0000"); 8807 inc = increaseInc(inc,current); 8808 context.strokeStyle = grd; 8809 } else { 8810 var grd = createGrad(inc,sizeX,sizeY); 8811 inc = increaseInc(inc,current); 8812 context.strokeStyle = grd; 8813 } 8814 context.stroke();
8815 context.restore(); 8816 } else { 8817 context.strokeStyle = customSettingsObj.fgcolor; 8818 context.stroke(); 8819 } 8820 } 8821 // ---------------------- // 8822 // Animation 8823 // ---------------------- // 8824 function animate(current) { 8825 //Clear Canvas for next frame 8826 context.clearRect(0, 0, canvas.width, canvas.height); 8827 //Draw Background 8828 if (type == 'line' || type == 'vert-line') { 8829 context.rect(10, 10, sizeX-20, sizeY-20); 8830 } else if (type == 'fill-circle-wave' || type == 'grow-circle' || type == 'fill-circle' || type == 'full' || type == 'half') { 8831 context.beginPath(); 8832 context.arc(x, y, radius, endAngle, startAngle, false); 8833 } 8834 context.fillStyle = customSettingsObj.fill; 8835 context.fill(); 8836 if (type == 'line') { 8837 context.beginPath(); 8838 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 8839 context.lineTo(sizeX-10,sizeY-(customSettingsObj.bordersize/2+10)); 8840 drawBorder(); 8841 context.moveTo(10,sizeY-(customSettingsObj.bordersize/2+10)); 8842 context.lineTo(Math.min((sizeX-20) * current+10,sizeX-10),sizeY-(customSettingsObj.bordersize/2+10)); 8843 fillAnimation(animationType,current); 8844 } else if (type == 'vert-line'){ 8845 context.beginPath(); 8846 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 8847 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),10); 8848 drawBorder(); 8849 context.moveTo(sizeX-(customSettingsObj.bordersize/2+10),sizeY-10); 8850 context.lineTo(sizeX-(customSettingsObj.bordersize/2+10),Math.max((sizeY-20) * (1-current)+10,10)); 8851 fillAnimation(animationType,current); 8852 } else if (type == 'full' || type=='half') { 8853 drawBorder(); 8854 context.arc(x, y, radius, -(quart) + additionalAngelPI, ((circ) * (Math.min(current,1)+.005)) - quart + additionalAngelPI, false); 8855 fillAnimation(animationType,current); 8856 } else if (type == 'grow-circle') { 8857 drawBorder(); 8858 var fillRadius = sizeX/2.5*Math.min(current,1); 8859 context.arc(sizeX/2, sizeY/2, Math.max(fillRadius-customSettingsObj.bordersize/2,0), endAngle, startAngle, false); 8860 if(animationType == 1){ 8861 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)',current); 8862 context.fill(); 8863 } else if(animationType == 2){ 8864 var grd=context.createLinearGradient(0,0,0,sizeY); 8865 grd.addColorStop(0,"white"); 8866 grd.addColorStop(1,customSettingsObj.fgcolor); 8867 shadowGlow(); 8868 context.fillStyle = grd; 8869 context.fill(); 8870 } else if(animationType == 3){ 8871 var grd = createGrad(inc,sizeX,sizeY); 8872 inc = increaseInc(inc,current); 8873 context.fillStyle = grd; 8874 context.fill(); 8875 } else { 8876 context.fillStyle = customSettingsObj.fgcolor; 8877 context.fill(); 8878 } 8879 context.restore(); 8880 } else if (type == 'fill-circle') { 8881 drawBorder(); 8882 var fillRadius = sizeX/2.5, 8883 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 8884 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 8885 if(animationType == 1){ 8886 context.clip(); 8887 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 8888 context.fillRect(0, fillLine, sizeX, sizeY); 8889 } else if(animationType == 2){ 8890 var grd=context.createLinearGradient(0,0,0,sizeY); 8891 grd.addColorStop(0,"white"); 8892 grd.addColorStop(1,customSettingsObj.fgcolor); 8893 shadowGlow(); 8894 context.clip(); 8895 context.fillStyle = grd; 8896 context.fillRect(0, fillLine, sizeX, sizeY); 8897 8898 } else if(animationType == 3){ 8899 context.clip(); 8900 var grd = createGrad(inc,sizeX, sizeY); 8901 inc = increaseInc(inc,current); 8902 context.fillStyle = grd; 8903 context.fillRect(0, fillLine, sizeX, sizeY); 8904 } else { 8905 context.clip(); 8906 context.fillStyle = customSettingsObj.fgcolor; 8907 context.fillRect(0, fillLine, sizeX, sizeY); 8908 }
8909 context.restore(); 8910 } else if (type == 'fill-circle-wave') { 8911 drawBorder(); 8912 var fillRadius = sizeX/2.5, 8913 fillLine = 0.8*(sizeX*(1-current))+(sizeX*.1); 8914 context.arc(sizeX/2, sizeY/2, fillRadius-customSettingsObj.bordersize/2, endAngle, startAngle, false); 8915 var ypos=fillLine, xpos=0; 8916 counter += .1; 8917 counterLoop = counter; 8918 var increase = 2*Math.PI / 12; 8919 context.clip(); 8920 context.beginPath(); 8921 context.moveTo(sizeX,sizeY); 8922 context.lineTo(0,sizeY); 8923 context.lineTo(0,ypos); 8924 if (curPerc > endPercent) { 8925 calm-=.01; 8926 if(calm<0) calm=0; 8927 } 8928 for(i=0; i<=sizeX; i+=10){ 8929 xpos = i; 8930 ypos = ypos - Math.sin(counterLoop) * calm; 8931 counterLoop += increase; 8932 context.lineTo(xpos,ypos); 8933 } 8934 context.lineTo(sizeX,sizeY); 8935 context.closePath(); 8936 if(animationType == 1){ 8937 context.fillStyle = blend('rgba(255,0,0,1)','rgba(0,255,0,1)', current); 8938 context.fill(); 8939 } else if(animationType == 2){ 8940 var grd=context.createLinearGradient(0,0,0,sizeY); 8941 grd.addColorStop(0,"white"); 8942 grd.addColorStop(1,customSettingsObj.fgcolor); 8943 shadowGlow(); 8944 context.clip(); 8945 context.fillStyle = grd; 8946 context.fill(); 8947 } else if(animationType == 3){ 8948 context.clip(); 8949 var grd = createGrad(inc,sizeX,sizeY); 8950 inc = increaseInc(inc,current); 8951 context.fillStyle = grd; 8952 context.fill(); 8953 } else { 8954 context.clip(); 8955 context.fillStyle = customSettingsObj.fgcolor; 8956 context.fill(); 8957 } 8958 context.restore(); 8959 } 8960 8961 if (curPerc < endPercent) { 8962 curPerc += curStep; 8963 requestAnimationFrame(function () { 8964 context.strokeStyle = customSettingsObj.fgcolor; 8965 animate(Math.min(curPerc, endPercent) / 100); 8966 }, obj); 8967 } else if(finishFrames < 500) { 8968 curPerc += curStep; 8969 finishFrames+=1; 8970 requestAnimationFrame(function () { 8971 context.strokeStyle = customSettingsObj.fgcolor; 8972 animate(Math.min(curPerc, endPercent) / 100); 8973 }, obj); 8974 } 8975 8976 if (curPerc == endPercent && fireCallback && typeof(options) != "undefined") { 8977 if (opticStats.isFunction(options.complete)) { 8978 options.complete(); 8979 8980 fireCallback = false; 8981 } 8982 } 8983 } 8984 obj.waypoint(function(direction){ 8985 animate(curPerc / 100); 8986 this.destroy(); 8987 }, { offset: '100%' }); 8988 }); 8989 }; 8990}(opticStats)); 8991/* 8992 The MIT License (MIT) 8993 CountUp 8994+Copyright (c) 2014-2015 Jamie Perkins 8995 Permission is hereby granted, free of charge, to any person obtaining a copy of 8996 this software and associated documentation files (the "Software"), to deal in 8997*/ 8998!function(t,a){"function"==typeof define&&define.amd?define(a):"object"==typeof exports?module.exports=a(require,exports,module):t.CountUp=a()}(this,function(){var t=function(t,a,e,n,i,r){for(var o=0,s=["webkit","moz","ms","o"],u=0;u<s.length&&!window.requestAnimationFrame;++u)window.requestAnimationFrame=window[s[u]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[s[u]+"CancelAnimationFrame"]||window[s[u]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var a=(new Date).getTime(),e=Math.max(0,16-(a-o)),n=window.setTimeout(function(){t(a+e)},e);return o=a+e,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),this.options={useEasing:!0,useGrouping:!0,separator:",",decimal:"."};for(var m in r)r.hasOwnProperty(m)&&(this.options[m]=r[m]);""===this.options.separator&&(this.options.useGrouping=!1),this.options.prefix||(this.options.prefix=""),this.options.suffix||(this.options.suffix=""),this.d="string"==typeof t?document.getElementById(t):t,this.startVal=Number(a),this.endVal=Number(e),this.countDown=this.startVal>this.endVal,this.frameVal=this.startVal,this.decimals=Math.max(0,n||0),this.dec=Math.pow(10,this.decimals),this.duration=1e3*Number(i)||2e3;var l=this;this.version=function(){return"1.6.0"},this.printValue=function(t){var a=isNaN(t)?"--":l.formatNumber(t);"INPUT"==l.d.tagName?this.d.value=a:"text"==l.d.tagName||"tspan"==l.d.tagName?this.d.textContent=a:this.d.innerHTML=a},this.easeOutExpo=function(t,a,e,n){return e*(-Math.pow(2,-10*t/n)+1)*1024/1023+a},this.count=function(t){l.startTime||(l.startTime=t),l.timestamp=t;var a=t-l.startTime;l.remaining=l.duration-a,l.frameVal=l.options.useEasing?l.countDown?l.startVal-l.easeOutExpo(a,0,l.startVal-l.endVal,l.duration):l.easeOutExpo(a,l.startVal,l.endVal-l.startVal,l.duration):l.countDown?l.startVal-(l.startVal-l.endVal)*(a/l.duration):l.startVal+(l.endVal-l.startVal)*(a/l.duration),l.frameVal=l.countDown?l.frameVal<l.endVal?l.endVal:l.frameVal:l.frameVal>l.endVal?l.endVal:l.frameVal,l.frameVal=Math.round(l.frameVal*l.dec)/l.dec,l.printValue(l.frameVal),a<l.duration?l.rAF=requestAnimationFrame(l.count):l.callback&&l.callback()},this.start=function(t){return l.callback=t,l.rAF=requestAnimationFrame(l.count),!1},this.pauseResume=function(){l.paused?(l.paused=!1,delete l.startTime,l.duration=l.remaining,l.startVal=l.frameVal,requestAnimationFrame(l.count)):(l.paused=!0,cancelAnimationFrame(l.rAF))},this.reset=function(){l.paused=!1,delete l.startTime,l.startVal=a,cancelAnimationFrame(l.rAF),l.printValue(l.startVal)},this.update=function(t){cancelAnimationFrame(l.rAF),l.paused=!1,delete l.startTime,l.startVal=l.frameVal,l.endVal=Number(t),l.countDown=l.startVal>l.endVal,l.rAF=requestAnimationFrame(l.count)},this.formatNumber=function(t){t=t.toFixed(l.decimals),t+="";var a,e,n,i;if(a=t.split("."),e=a[0],n=a.length>1?l.options.decimal+a[1]:"",i=/(\d+)(\d{3})/,l.options.useGrouping)for(;i.test(e);)e=e.replace(i,"$1"+l.options.separator+"$2");return l.options.prefix+e+n+l.options.suffix},l.printValue(l.startVal)};return t}); 8999/*! 9000Waypoints - 4.0.0 9001Copyright © 2011-2015 Caleb Troughton 9002Licensed under the MIT license. 9003https://github.com/imakewebthings/waypoints/blob/master/licenses.txt 9004*/ 9005!function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");
vendor: 6,526 bytes, line 9005
9005this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=y+l-f,h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],r
9005ight:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.opticStatselement=e(t)}var e=opticStats,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.opticStatselement[i].apply(this.opticStatselement,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;opticStats&&(opticStats.fn.waypoint=t(opticStats)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}(); 9006 9007opticStats( document ).ready(function() { 9008 var speed = 3000, 9009 countNumberstacks_in_196 = "100", 9010 decimalNumber = '0', 9011 decimalNumber = decimalNumber.replace(/\D/g,''), 9012 decimalLength = decimalNumber.length, 9013 maxValuePercentstacks_in_196 = (countNumberstacks_in_196/100), 9014 speedA = (2000/speed)*maxValuePercentstacks_in_196; 9015 if (100 == 0) { 9016 if(countNumberstacks_in_196 < 0) { 9017 maxValuePercentstacks_in_196 = 1; 9018 } else { 9019 maxValuePercentstacks_in_196 = (0-countNumberstacks_in_196)/0; 9020 } 9021 } 9022 if('False' == 'False' ) { 9023 decimalLength = 0; 9024 } else { 9025 countNumberstacks_in_196 = countNumberstacks_in_196.replace(/\D/g,''); 9026 countNumberstacks_in_196 = countNumberstacks_in_196+"."+decimalNumber; 9027 } 9028 if('False' == 'True' ) { 9029 var items = readData_data(opticStats("#data")); 9030 countNumberstacks_in_196 = items['data-A1']; 9031 if(countNumberstacks_in_196 == null) { 9032 countNumberstacks_in_196 = '0'; 9033 } 9034 opticStats("#stat_stacks_in_196").data("percent", maxValuePercentstacks_in_196*100); 9035 // 9036 // 9037 if(countNumberstacks_in_196.indexOf(".") !== -1) { 9038 decimalNumber = countNumberstacks_in_196.substr(countNumberstacks_in_196.indexOf(".") + 1); 9039 decimalNumber = decimalNumber.replace(/\D/g,''); 9040 decimalLength = decimalNumber.length; 9041 countNumberstacks_in_196 = countNumberstacks_in_196.substr(0, countNumberstacks_in_196.indexOf('.')); 9042 } 9043 // 9044 // 9045 countNumberstacks_in_196 = countNumberstacks_in_196.replace(/[^0-9\-]/g,''); 9046 countNumberstacks_in_196 = countNumberstacks_in_196+"."+decimalNumber; 9047 maxValuePercentstacks_in_196 = (countNumberstacks_in_196/100); 9048 if (100 == 0) { 9049 if(countNumberstacks_in_196 < 0) { 9050 maxValuePercentstacks_in_196 = 1; 9051 } else { 9052 maxValuePercentstacks_in_196 = (0-countNumberstacks_in_196)/0; 9053 } 9054 } 9055 speedA = (2000/speed)*maxValuePercentstacks_in_196; 9056 opticStats("#stat_stacks_in_196").data("percent", maxValuePercentstacks_in_196*100); 9057 } else { 9058 var maxValuePercentstacks_in_196 = (countNumberstacks_in_196/100); 9059 if (100 == 0) { 9060 if(countNumberstacks_in_196 < 0) { 9061 maxValuePercentstacks_in_196 = 1; 9062 } else { 9063 maxValuePercentstacks_in_196 = (0-countNumberstacks_in_196)/0; 9064 } 9065 } 9066 speedA = (2000/speed)*maxValuePercentstacks_in_196; 9067 opticStats("#stat_stacks_in_196").data("percent", maxValuePercentstacks_in_196*100); 9068 } 9069 opticStats('#stat_stacks_in_196').attr("data-animationstep", speedA); 9070 opticStats('#stat_stacks_in_196').circliful(); 9071 opticStats('#stat_stacks_in_196').waypoint(function(direction){ 9072 9073 // 9074// opticStats('#stacks_in_196 .counter').counterUp({ 9075// delay: 10, 9076// time: speed 9077// }); 9078 9079 var options = { 9080 // 9081 // 9082 separator : ',', 9083 decimal : '.', 9084 // 9085 // 9086 // 9087 useEasing : false 9088 }; 9089 opticStats('#stacks_in_196 .counter').attr("id", "count_stacks_in_196"); 9090 var count = new CountUp('count_stacks_in_196', 0, countNumberstacks_in_196, decimalLength, (1.9/speedA)*(maxValuePercentstacks_in_196), options);//(1.75/speedA)*(maxValuePercentstacks_in_196) 9091 count.start(); 9092 // 9093 // 9094 opticStats('#stat_stacks_in_196 .circle-text').append("%"); 9095 opticStats('#stat_stacks_in_196 .circle-text-half').append("%"); 9096 // 9097 // 9098 // 9099 // 9100 // 9101 scale(); 9102 this.destroy(); 9103 }, { offset: '100%' }); 9104 9105 9106}); 9107 9108opticStats( window ).resize(function() { 9109 scale(); 9110}); 9111function scale() { 9112 var width = 200, 9113 currentWidth = opticStats('#stat_stacks_in_196').parent().outerWidth(); 9114 if(currentWidth < width) { 9115 var scale = currentWidth/width; 9116 opticStats('#stat_stacks_in_196').css({ 9117 "transform" : "scale("+scale+")", 9118 "transform-origin" : "0px", 9119 "-o-transform" : "scale("+scale+")", 9120 "-o-transform-origin" : "0px" 9121 }); 9122 } else { 9123 opticStats('#stat_stacks_in_196').css({ 9124 "transform" : "scale(1)", 9125 "-o-transform" : "scale(1)" 9126 }); 9127 } 9128} 9129 9130return stack;})(stacks.stacks_in_196);
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.