text: /**!
   * input-shine - v0.1.6
   * Make the input box more beautiful
   *
   * Fri Mar 02 2018 16:41:14 GMT+0800 (中国标准时间)
   * homepage: https://github.com/hold-baby/inputShine#readme
   * MIT (c) hold-baby
  */
  !function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):t.inputShine=i()}(this,function(){"use strict";function t(t,i,e,n,o,r,a){this._id=t||"default",this._group=i||"default",this._position=e||new Vector,this._velocity=n||new Vector,this._size=o||1,this._life=Math.round(r||0),this._behavior=a||[]}function i(t,i){this._x=t||0,this._y=i||0}var e,n;t.prototype={get id(){return this._id},get group(){return this._group},get life(){return this._life},get size(){return this._size},set size(t){this._size=t},get position(){return this._position},get velocity(){return this._velocity},update:function(t){this._life++;for(var i=0,e=this._behavior.length;i<e;i++)this._behavior[i].call(t,this)},toString:function(){return"Particle("+this._id+") "+this._life+" pos: "+this._position+" vec: "+this._velocity}},i.create=function(t,e){return new i(t,e)},i.add=function(t,e){return new i(t.x+e.x,t.y+e.y)},i.subtract=function(t,e){return new i(t.x-e.x,t.y-e.y)},i.random=function(t){var e=new i;return e.randomize(t),e},i.distanceSquared=function(t,i){var e=t.x-i.x,n=t.y-i.y;return e*e+n*n},i.distance=function(t,i){var e=t.x-i.x,n=t.y-i.y;return Math.sqrt(e*e+n*n)},i.prototype={get x(){return this._x},get y(){return this._y},set x(t){this._x=t},set y(t){this._y=t},get magnitudeSquared(){return this._x*this._x+this._y*this._y},get magnitude(){return Math.sqrt(this.magnitudeSquared)},get angle(){return 180*Math.atan2(this._y,this._x)/Math.PI},clone:function(){return new i(this._x,this._y)},add:function(t){this._x+=t.x,this._y+=t.y},subtract:function(t){this._x-=t.x,this._y-=t.y},multiply:function(t){this._x*=t,this._y*=t},divide:function(t){this._x/=t,this._y/=t},normalize:function(){var t=this.magnitude;t>0&&this.divide(t)},limit:function(t){this.magnitude>t&&(this.normalize(),this.multiply(t))},randomize:function(t){t=t||1,this._x=2*t*(-.5+Math.random()),this._y=2*t*(-.5+Math.random())},rotate:function(t){var i=this.magnitude,e=(Math.atan2(this._x,this._y)*PI_HALF+t)*PI_180;this._x=i*Math.cos(e),this._y=i*Math.sin(e)},flip:function(){var t=this._y;this._y=this._x,this._x=t},invert:function(){this._x=-this._x,this._y=-this._y},toString:function(){return this._x+", "+this._y}},Math.PI,Math.PI,e=50,n={d:"255,255,255",white:"231,244,255",black:"0,0,0",red:"247,32,16",orange:"255,152,0",yellow:"255,244,0",green:"173,255,47",young:"0,128,0",blue:"27,84,208",purple:"231,100,255"};for(var o,r=document.getElementsByTagName("style"),a=0;a<r.length;a++)if("inpShineStyle"==r[a].id){o=r[a];break}void 0===o&&((o=document.createElement("style")).id="inpShineStyle",o.innerHTML="input[shine=shine]:focus{outline:0}canvas{position:absolute;left:0;right:0;top:0;bottom:0;pointer-events:none}::-webkit-input-placeholder{text-shadow:0 0 .125em transparent;-webkit-transition:all .25s;transition:all .25s}input[shine=shine]:focus::-webkit-input-placeholder{opacity:.5}::-moz-placeholder{text-shadow:0 0 .125em transparent;-webkit-transition:all .25s;transition:all .25s}input[shine=shine]:focus::-moz-placeholder{opacity:.5}:-ms-input-placeholder{text-shadow:0 0 .125em transparent;-webkit-transition:all .25s;transition:all .25s}input[shine=shine]:focus:-ms-input-placeholder{opacity:.5}",document.head.appendChild(o));var s={between:function(t,i){return t+Math.random()*(i-t)}},u=function(t,i){var e="rgb("+(i.textColor?n[i.textColor]:n.white)+")",r="rgb("+(i.borderColor?n[i.borderColor]:n.white)+")",a="_Shine"+Math.floor(1e8*Math.random()),s="input[shine=shine].keyup"+a+" {color:"+e+";text-shadow: 0 0 .125em "+e+";border-color:"+r+";box-shadow: 0 0 .25em white,inset 0 0 .25em "+r+";}";return o.innerHTML=o.innerHTML+s,t.classList.add(a),a};function h(o,r,a,h){var l,c,d=[],f=[],p=this,y=u(o,h);function m(){l.width=window.innerWidth,l.height=window.innerHeight}function g(){l=document.createElement("canvas"),document.body.appendChild(l),window.addEventListener("resize",m),function(){function e(t){f.push(t)}function n(i,e,n,o,r,a,s){d.push(new t(i,e,n,o,r,a,s))}m(),c=l.getContext("2d"),p.clear=function(){c.clearRect(0,0,l.width,l.height)},p.destroy=e,p.add=n,p.spray=function(t,i){for(var e=0;e<t;e++)n.apply(p,i())},p.debug=function(t){p.paint.circle(t.position.x,t.position.y,t.size,"rgba(255,0,0,.75)"),c.beginPath(),c.moveTo(t.position.x,t.position.y),c.lineTo(t.position.x+10*t.velocity.x,t.position.y+10*t.velocity.y),c.strokeStyle="rgba(255,0,0,.1)",c.stroke(),c.closePath()},p.paint={circle:function(t,i,e,n){c.beginPath(),c.arc(t,i,e,0,2*Math.PI,!1),c.fillStyle=n,c.fill()},square:function(t,i,e,n){c.beginPath(),c.rect(t-.5*e,i-.5*e,e,e),c.fillStyle=n,c.fill()}},p.behavior={cohesion:function(t,e){return t=Math.pow(t||100,2),e=e||.001,function(e){var n=new i,o=0,r=d.length,a=0;if(!(r<=1)){for(;o<r;o++)d[o]===e||i.distanceSquared(d[o].position,e.position)>t||(n.add(i.subtract(d[o].position,e.position)),a++);a>0&&(n.divide(a),n.normalize(),n.multiply(e.velocity.magnitude),n.multiply(.05)),e.velocity.add(n)}}},separation:function(t){var t=Math.pow(t||25,2);return function(e){var n,o=new i,r=0,a=d.length,s=0;if(!(a<=1)){for(;r<a;r++)d[r]===e||i.distanceSquared(d[r].position,e.position)>t||((n=i.subtract(e.position,d[r].position)).normalize(),o.add(n),s++);s>0&&(o.divide(s),o.normalize(),o.multiply(e.velocity.magnitude),o.limit(.1)),e.velocity.add(o)}}},alignment:function(t){return t=Math.pow(t||100,2),function(e){var n=0,o=d.length,r=0,a=new i;if(!(o<=1)){for(;n<o;n++)d[n]===e||i.distanceSquared(d[n].position,e.position)>t||(a.add(d[n].velocity),r++);r>0&&(a.divide(r),a.normalize(),a.multiply(e.velocity.magnitude),a.multiply(.1)),e.velocity.add(a)}}},move:function(){return function(t){t.position.add(t.velocity)}},eat:function(t){return t=t||[],function(n){for(var o,r=0,a=d.length;r<a;r++)(o=d[r])!==n&&-1!==t.indexOf(o.group)&&i.distanceSquared(n.position,neighbour.position)<2&&n.size>=neighbour.size&&(n.size+=neighbour.size,e(neighbour))}},force:function(t,i){return function(e){e.velocity.x+=t,e.velocity.y+=i}},limit:function(t){return function(i){i.velocity.limit(t)}},attract:function(t,e){return t=t||1,e=e||[],function(n){for(var o,r,a=new i(0,0),s=new i(0,0),u=0,h=d.length,l=e.length;u<h;u++)(r=d[u])===n||l&&-1===e.indexOf(r.group)||(s.x=r.position.x-n.position.x,s.y=r.position.y-n.position.y,o=s.magnitude,s.normalize(),s.multiply(r.size/o),a.add(s));a.multiply(t),n.velocity.add(a)}},wrap:function(t){return function(i){var e=i.position,n=.5*i.size;e.x+n>l.width+t&&(e.x=n),e.y+n>l.height+t&&(e.y=n),e.x-n<-t&&(e.x=l.width-n),e.y-n<-t&&(e.y=l.height-n)}},reflect:function(){return function(t){var i=t.position,e=t.velocity,n=.5*t.size;i.x+n>l.width&&(e.x=-e.x),i.y+n>l.height&&(e.y=-e.y),i.x-n<0&&(e.x=-e.x),i.y-n<0&&(e.y=-e.y)}},edge:function(t){return function(i){var e=i.position,n=(i.velocity,.5*i.size);e.x+n>l.width&&t(i),e.y+n>l.height&&t(i),e.x-n<0&&t(i),e.y-n<0&&t(i)}}},Object.defineProperties(o,{particles:{get:function(){return d}},width:{get:function(){return l.width}},height:{get:function(){return l.height}},context:{get:function(){return c}}}),p.init.call(o),function t(){p.tick.call(p,d);!function(){for(var t,i=0,e=d.length;i<e;i++)d[i].update(p);for(;t=f.pop();)for(;t===d[i]&&d.splice(i,1),i-- >=0;);for(p.beforePaint.call(p),i=0,e=d.length;i<e;i++)p.paints.call(p,d[i]);p.afterPaint.call(p)}();window.requestAnimationFrame(t)}(),o.addEventListener("keyup",function(t){p.action.call(p,t.pageX,t.pageY)})}()}this.init=function(){},this.tick=function(t){t&&t.forEach(function(t){t.life>e&&p.destroy(t)})},this.beforePaint=function(){p.clear()},this.paints=function(t){var i=t.position,o=t.size,r=1-t.life/e;this.paint.circle(i.x,i.y,o,"rgba("+n.d+","+r+")"),this.paint.circle(i.x,i.y,o+2,"rgba("+(h.shine&&n[h.shine]?n[h.shine]:n.white)+","+.25*r+")")},this.afterPaint=function(){},this.action=function(t,e){r.textContent=o.value,function(t){var e=[this.behavior.cohesion(),this.behavior.move()],n=Math.min(a.width,r.offsetWidth)/a.width,u=a.left+a.width*n,h=Math.max(a.left,u-30),l=Math.min(a.right,u+10);this.spray(t,function(){return[null,null,i.create(s.between(h+10,l-20),s.between(a.top+15,a.bottom-15)),i.random(.7),.75+Math.random(),s.between(0,0),e]}),this.spray(.5*t,function(){return[null,null,i.create(s.between(h,l),a.top),i.random(.7),.75+Math.random(),s.between(0,0),e]}),this.spray(.5*t,function(){return[null,null,i.create(s.between(h,l),a.top+a.height),i.random(.7),.75+Math.random(),s.between(0,0),e]}),1===o.value.length&&this.spray(2*t,function(){return[null,null,i.create(a.left,s.between(a.top,a.bottom)),i.random(.7),.75+Math.random(),s.between(0,0),e]});l==a.right&&this.spray(2*t,function(){return[null,null,i.create(a.right,s.between(a.top,a.bottom)),i.random(.7),.75+Math.random(),s.between(0,0),e]})}.call(this,10),o.classList.add("keyup"+y),setTimeout(function(){o.classList.remove("keyup"+y)},100)},"interactive"===document.readyState?g():document.addEventListener("DOMContentLoaded",g)}return function(t,i){var e=document.getElementById(t);e.setAttribute("shine","shine"),i=i||{};var n={},o=document.createElement("span");function r(){n=e.getBoundingClientRect()}o.style.cssText=document.defaultView.getComputedStyle(e,"").cssText,o.style.position="absolute",o.style.left=0,o.style.top=0,o.style.width="auto",o.style.visibility="hidden",document.body.appendChild(o),window.onload=r,window.onresize=r,r(),e.onfocus=function(){},e.onblur=function(){},new h(e,o,n,i)}});
  //# sourceMappingURL=inputShine.min.js.map
  