text: /*! Damoo v2.3.0 | Copyright (c) 2015-2017 James Liu | Released under the MIT license */
  ;(a=>{function b(o,p){var q=e.dom.createElement('canvas'),u=q.getContext('2d');return u.font=p,q.width=u.measureText(o.text).width,q.height=1.5*p.size,u.font=p,u.textAlign='start',u.textBaseline='top',o.shadow&&(u.shadowOffsetX=1,u.shadowOffsetY=1,u.shadowColor='#fff',u.shadowColor=o.shadow.color),u.fillStyle='#fff',u.fillStyle=o.color,u.fillText(o.text,0,0),q}function c(){this.canvas.clear();for(var o=0;o<this.thread.pool.length;o++){var p=this.thread.get(o),q=p.offset.x,u=p.offset.y;this.canvas.draw(p,q,u),p.offset.x-=p.speed,q<=-p.canvas.width&&this.thread.remove(o)}this._afid=g(c.bind(this))}class e{constructor(o,p,q,u){this.canvas=new j(o,p,q,u),this.thread=new l(q)}show(){return this.canvas.parent.appendChild(this.canvas.layer),this}hide(){return this.canvas.parent.removeChild(this.canvas.layer),this}emit(o){'string'==typeof o&&(o={text:o});var p=b(o,this.canvas.font);return this.thread.push({canvas:p,fixed:o.fixed,index:this.thread.index,speed:0.6*Math.pow(p.width,1/3),offset:{x:this.canvas.width,y:this.canvas.font.size*this.thread.index}}),this}clear(){return this.thread.empty(),this}play(){return void 0===this.state&&this.clear().show(),this.state||(c.call(this),this.state=1),this}pause(){return void 0===this.state?this:(h(this._afid),this.state=0,this)}resume(){return this.play()}}var g=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame||a.oRequestAnimationFrame||function(o){return setTimeout(o,17)},h=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.webkitCancelRequestAnimationFrame||a.msCancelAnimationFrame||a.oCancelAnimationFrame||function(o){clearTimeout(o)};class j{constructor(o,p,q,u){this.dpr=a.devicePixelRatio||1,this.parent=1==o.nodeType?o:e.dom.getElementById(o),this.id=p,this.rows=q,this.width=this.parent.offsetWidth*this.dpr,this.height=this.parent.offsetHeight*this.dpr,12>this.height/this.rows&&(this.rows=this.height/12),this.font=new k(this.height/this.rows,u),this.layer=e.dom.createElement('canvas'),this.context=this.layer.getContext('2d'),this.layer.id=this.id,this.layer.width=this.width,this.layer.height=this.height,this.layer.style.width=this.width/this.dpr+'px',this.layer.style.height=this.height/this.dpr+'px',this.layer.style.display='block',this.layer.style.backgroundColor='transparent',this.parent.style.position?(this.layer.style.position='fixed',this.layer.style.left=this.parent.offsetLeft,this.layer.style.top=this.parent.offsetTop):(this.parent.style.position='relative',this.layer.style.position='absolute',this.layer.style.left=0,this.layer.style.top=0),this.layer.style.zIndex=999}clear(){this.context.clearRect(0,0,this.width,this.height)}draw(o,p,q){o.fixed&&(p=(this.width-o.canvas.width)/2),this.context.drawImage(o.canvas,p,q)}}class k{constructor(o,p){this.size=o,this.family=p||'sans-serif'}toString(){return this.size+'px '+this.family}}class l{constructor(o){this.index=0,this.rows=o,this.pool=[]}push(o){this.index++,this.index>=this.rows&&(this.index=0),this.pool.push(o)}get(o){return this.pool[o]}remove(o){var p=this.get(o).index;this.index>p&&(this.index=p),this.pool.splice(o,1)}empty(){this.index=0,this.pool=[]}}e.version='v2.3.0',e.dom=a.document,a.Damoo=e})(window);