From fad62145aa0667843237bcb8484e3f836f9ba516 Mon Sep 17 00:00:00 2001 From: huangjue Date: Thu, 30 Dec 2021 15:01:18 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99?= =?UTF-8?q?=E9=80=BB=E8=BE=91,=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/tagcanvas.min.js | 21 +++ result.html | 355 ++++++++++++++++++++++++++++++++++++-------- 2 files changed, 314 insertions(+), 62 deletions(-) create mode 100644 js/tagcanvas.min.js diff --git a/js/tagcanvas.min.js b/js/tagcanvas.min.js new file mode 100644 index 0000000..61b9384 --- /dev/null +++ b/js/tagcanvas.min.js @@ -0,0 +1,21 @@ +/** + * Copyright (C) 2010-2021 Graham Breach + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ +/** + * TagCanvas 2.11 + * For more information, please contact + */ +(function(){"use strict";var r,C,p=Math.abs,o=Math.sin,l=Math.cos,g=Math.max,h=Math.min,af=Math.ceil,E=Math.sqrt,w=Math.pow,I={},D={},R={0:"0,",1:"17,",2:"34,",3:"51,",4:"68,",5:"85,",6:"102,",7:"119,",8:"136,",9:"153,",a:"170,",A:"170,",b:"187,",B:"187,",c:"204,",C:"204,",d:"221,",D:"221,",e:"238,",E:"238,",f:"255,",F:"255,"},f,d,b,T,z,F,M,c=document,v,e,P,j={};for(r=0;r<256;++r)C=r.toString(16),r<16&&(C='0'+C),D[C]=D[C.toUpperCase()]=r.toString()+',';function n(a){return typeof a!='undefined'}function B(a){return typeof a=='object'&&a!=null}function G(a,c,b){return isNaN(a)?b:h(b,g(c,a))}function x(){return!1}function q(){return(new Date).valueOf()}function ak(c,d){var b=[],e=c.length,a;for(a=0;a=1)?0:a<=-1?Math.PI:Math.acos(a)},z.unit=function(){var a=this.length();return new s(this.x/a,this.y/a,this.z/a)};function ay(b,a){a=a*Math.PI/180,b=b*Math.PI/180;var c=o(b)*l(a),d=-o(a),e=-l(b)*l(a);return new s(c,d,e)}function m(a){this[1]={1:a[0],2:a[1],3:a[2]},this[2]={1:a[3],2:a[4],3:a[5]},this[3]={1:a[6],2:a[7],3:a[8]}}T=m.prototype,m.Identity=function(){return new m([1,0,0,0,1,0,0,0,1])},m.Rotation=function(e,a){var c=o(e),d=l(e),b=1-d;return new m([d+w(a.x,2)*b,a.x*a.y*b-a.z*c,a.x*a.z*b+a.y*c,a.y*a.x*b+a.z*c,d+w(a.y,2)*b,a.y*a.z*b-a.x*c,a.z*a.x*b-a.y*c,a.z*a.y*b+a.x*c,d+w(a.z,2)*b])},T.mul=function(c){var d=[],a,b,e=c.xform?1:0;for(a=1;a<=3;++a)for(b=1;b<=3;++b)e?d.push(this[a][1]*c[1][b]+this[a][2]*c[2][b]+this[a][3]*c[3][b]):d.push(this[a][b]*c);return new m(d)},T.xform=function(b){var a={},c=b.x,d=b.y,e=b.z;return a.x=c*this[1][1]+d*this[2][1]+e*this[3][1],a.y=c*this[1][2]+d*this[2][2]+e*this[3][2],a.z=c*this[1][3]+d*this[2][3]+e*this[3][3],a};function aB(g,j,k,m,f){var a,b,c,d,e=[],h=2/g,i;i=Math.PI*(3-E(5)+(parseFloat(f)?parseFloat(f):0));for(a=0;a0)}function aC(a,c,f,d){var e=a.createLinearGradient(0,0,c,0),b;for(b in d)e.addColorStop(1-b,d[b]);a.fillStyle=e,a.fillRect(0,f,c,1)}function L(a,m,j){var l=1024,d=1,e=a.weightGradient,i,f,b,c;if(a.gCanvas)f=a.gCanvas.getContext('2d'),d=a.gCanvas.height;else{if(B(e[0])?d=e.length:e=[e],a.gCanvas=i=k(l,d),!i)return null;f=i.getContext('2d');for(b=0;b0?b=i*b/100:b=b*j,a=e.getContext('2d'),a.globalCompositeOperation='source-over',a.fillStyle='#fff',b>=i/2?(b=h(c,d)/2,a.beginPath(),a.moveTo(c/2,d/2),a.arc(c/2,d/2,b,0,2*Math.PI,!1),a.fill(),a.closePath()):(b=h(c/2,d/2,b),y(a,0,0,c,d,b,!0),a.fill()),a.globalCompositeOperation='source-in',a.drawImage(l,0,0,c,d),e)}function ao(q,m,i,b,h,a,c){var g=p(c[0]),f=p(c[1]),j=m+(g>a?g+a:a*2)*b,l=i+(f>a?f+a:a*2)*b,n=b*((a||0)+(c[0]<0?g:0)),o=b*((a||0)+(c[1]<0?f:0)),e,d;return e=k(j,l),!e?null:(d=e.getContext('2d'),h&&(d.shadowColor=h),a&&(d.shadowBlur=a*b),c&&(d.shadowOffsetX=c[0]*b,d.shadowOffsetY=c[1]*b),d.drawImage(q,n,o,m,i),{image:e,width:j/b,height:l/b})}function ae(m,o,l){var c=parseInt(m.toString().length*l),h=parseInt(l*2*m.length),j=k(c,h),g,i,e,f,b,d,n,a;if(!j)return null;g=j.getContext('2d'),g.fillStyle='#000',g.fillRect(0,0,c,h),Y(g,l+'px '+o,'#fff',m,0,0,0,0,[],'centre'),i=g.getImageData(0,0,c,h),e=i.width,f=i.height,a={min:{x:e,y:f},max:{x:-1,y:-1}};for(d=0;d0&&(ba.max.x&&(a.max.x=b),da.max.y&&(a.max.y=d));return e!=c&&(a.min.x*=c/e,a.max.x*=c/e),f!=h&&(a.min.y*=c/f,a.max.y*=c/f),j=null,a}function Q(a){return"'"+a.replace(/(\'|\")/g,'').replace(/\s*,\s*/g,"', '")+"'"}function t(b,d,a){a=a||c,a.addEventListener?a.addEventListener(b,d,!1):a.attachEvent('on'+b,d)}function am(b,d,a){a=a||c,a.removeEventListener?a.removeEventListener(b,d):a.detachEvent('on'+b,d)}function A(g,e,j,a,b){var l=b.imageScale,h,c,k,m,f,d;if(!e.complete)return t('load',function(){A(g,e,j,a,b)},e);if(!g.complete)return t('load',function(){A(g,e,j,a,b)},g);if(j&&!j.complete)return t('load',function(){A(g,e,j,a,b)},j);e.width=e.width,e.height=e.height,l&&(g.width=e.width*l,g.height=e.height*l),a.iw=g.width,a.ih=g.height,b.txtOpt&&(c=g,h=b.zoomMax*b.txtScale,f=a.iw*h,d=a.ih*h,f0?(a.iw+=2*b.outlineIncrease,a.ih+=2*b.outlineIncrease,f=h*a.iw,d=h*a.ih,c=S(a.fimage,f,d),a.oimage=c,a.fimage=H(a.fimage,a.oimage.width,a.oimage.height)):(f=h*(a.iw+2*b.outlineIncrease),d=h*(a.ih+2*b.outlineIncrease),c=S(a.fimage,f,d),a.oimage=H(c,a.fimage.width,a.fimage.height))))),a.alt=j,a.Init()}function i(a,d){var b=c.defaultView,e=d.replace(/\-([a-z])/g,function(a){return a.charAt(1).toUpperCase()});return b&&b.getComputedStyle&&b.getComputedStyle(a,null).getPropertyValue(d)||a.currentStyle&&a.currentStyle[e]}function aj(c,d,e){var b=1,a;return d?b=1*(c.getAttribute(d)||e):(a=i(c,'font-size'))&&(b=a.indexOf('px')>-1&&a.replace('px','')*1||a.indexOf('pt')>-1&&a.replace('pt','')*1.25||a*3.3),b}function u(a){return a.target&&n(a.target.id)?a.target.id:a.srcElement.parentNode.id}function K(a,c){var b,d,e=parseInt(i(c,'width'))/c.width,f=parseInt(i(c,'height'))/c.height;return n(a.offsetX)?b={x:a.offsetX,y:a.offsetY}:(d=X(c.id),n(a.changedTouches)&&(a=a.changedTouches[0]),a.pageX&&(b={x:a.pageX-d.x,y:a.pageY-d.y})),b&&e&&f&&(b.x/=e,b.y/=f),b}function an(c){var d=c.target||c.fromElement.parentNode,b=a.tc[d.id];b&&(b.mx=b.my=-1,b.UnFreeze(),b.EndDrag())}function ad(e){var g,c=a,b,d,f=u(e);for(g in c.tc)b=c.tc[g],b.tttimer&&(clearTimeout(b.tttimer),b.tttimer=null);f&&c.tc[f]&&(b=c.tc[f],(d=K(e,b.canvas))&&(b.mx=d.x,b.my=d.y,b.Drag(e,d)),b.drawn=0)}function ap(b){var e=a,f=c.addEventListener?0:1,d=u(b);d&&b.button==f&&e.tc[d]&&e.tc[d].BeginDrag(b)}function aq(b){var f=a,g=c.addEventListener?0:1,e=u(b),d;e&&b.button==g&&f.tc[e]&&(d=f.tc[e],ad(b),!d.EndDrag()&&!d.touchState&&d.Clicked(b))}function ar(c){var e=u(c),b=e&&a.tc[e],d;b&&c.changedTouches&&(c.touches.length==1&&b.touchState==0?(b.touchState=1,b.BeginDrag(c),(d=K(c,b.canvas))&&(b.mx=d.x,b.my=d.y,b.drawn=0)):c.targetTouches.length==2&&b.pinchZoom?(b.touchState=3,b.EndDrag(),b.BeginPinch(c)):(b.EndDrag(),b.EndPinch(),b.touchState=0))}function ac(c){var d=u(c),b=d&&a.tc[d];if(b&&c.changedTouches){switch(b.touchState){case 1:b.Draw(),b.Clicked();break;break;case 2:b.EndDrag();break;case 3:b.EndPinch()}b.touchState=0}}function au(c){var f,e=a,b,d,g=u(c);for(f in e.tc)b=e.tc[f],b.tttimer&&(clearTimeout(b.tttimer),b.tttimer=null);if(b=g&&e.tc[g],b&&c.changedTouches&&b.touchState){switch(b.touchState){case 1:case 2:(d=K(c,b.canvas))&&(b.mx=d.x,b.my=d.y,b.Drag(c,d)&&(b.touchState=2));break;case 3:b.Pinch(c)}b.drawn=0}}function ab(b){var d=a,c=u(b);c&&d.tc[c]&&(b.cancelBubble=!0,b.returnValue=!1,b.preventDefault&&b.preventDefault(),d.tc[c].Wheel((b.wheelDelta||b.detail)>0))}function aw(d){var c,b=a;clearTimeout(b.scrollTimer);for(c in b.tc)b.tc[c].Pause();b.scrollTimer=setTimeout(function(){var b,c=a;for(b in c.tc)c.tc[b].Resume()},b.scrollPause)}function al(){Z(q())}function Z(b){var c=a.tc,d;a.NextFrame(a.interval),b=b||q();for(d in c)c[d].Draw(b)}function az(){requestAnimationFrame(Z)}function aA(a){setTimeout(al,a)}function X(f){var g=c.getElementById(f),b=g.getBoundingClientRect(),a=c.documentElement,d=c.body,e=window,h=e.pageXOffset||a.scrollLeft,i=e.pageYOffset||a.scrollTop,j=a.clientLeft||d.clientLeft,k=a.clientTop||d.clientTop;return{x:b.left+h-j,y:b.top+i-k}}function aI(a,b,d,e){var c=a.radius*a.z1/(a.z1+a.z2+b.z);return{x:b.x*c*d,y:b.y*c*e,z:b.z,w:(a.z1-b.z)/a.z2}}function V(a){this.e=a,this.br=0,this.line=[],this.text=[],this.original=a.innerText||a.textContent}F=V.prototype,F.Empty=function(){for(var a=0;ah?(d.push(this.line.join(' ')),this.line=[a[b]]):this.line.push(a[b]);d.push(this.line.join(' '))}return this.text=d};function _(a,b){this.ts=null,this.tc=a,this.tag=b,this.x=this.y=this.w=this.h=this.sc=1,this.z=0,this.pulse=1,this.pulsate=a.pulsateTo<1,this.colour=a.outlineColour,this.adash=~~a.outlineDash,this.agap=~~a.outlineDashSpace||this.adash,this.aspeed=a.outlineDashSpeed*1,this.colour=='tag'?this.colour=i(b.a,'color'):this.colour=='tagbg'&&(this.colour=i(b.a,'background-color')),this.Draw=this.pulsate?this.DrawPulsate:this.DrawSimple,this.radius=a.outlineRadius|0,this.SetMethod(a.outlineMethod,a.altImage)}f=_.prototype,f.SetMethod=function(a,d){var b={block:['PreDraw','DrawBlock'],colour:['PreDraw','DrawColour'],outline:['PostDraw','DrawOutline'],classic:['LastDraw','DrawOutline'],size:['PreDraw','DrawSize'],none:['LastDraw']},c=b[a]||b.outline;a=='none'?this.Draw=function(){return 1}:this.drawFunc=this[c[1]],this[c[0]]=this.Draw,d&&(this.RealPreDraw=this.PreDraw,this.PreDraw=this.DrawAlt)},f.Update=function(d,e,i,j,a,f,g,h){var b=this.tc.outlineOffset,c=2*b;this.x=a*d+g-b,this.y=a*e+h-b,this.w=a*i+c,this.h=a*j+c,this.sc=a,this.z=f},f.Ants=function(k){if(!this.adash)return;var b=this.adash,c=this.agap,a=this.aspeed,j=b+c,h=0,g=b,f=c,i=0,d=0,e;a&&(d=p(a)*(q()-this.ts)/50,a<0&&(d=864e4-d),a=~~d%j),a?(b>=a?(h=b-a,g=a):(f=j-a,i=c-f),e=[h,f,g,i]):e=[b,c],k.setLineDash(e)},f.DrawOutline=function(a,d,e,b,c,f){var g=h(this.radius,c/2,b/2);a.strokeStyle=f,this.Ants(a),y(a,d,e,b,c,g,!0)},f.DrawSize=function(i,n,m,l,k,j,a,h,g){var f=a.w,e=a.h,c,b,d;return this.pulsate?(a.image?d=(a.image.height+this.tc.outlineIncrease)/a.image.height:d=a.oscale,b=a.fimage||a.image,c=1+(d-1)*(1-this.pulse),a.h*=c,a.w*=c):b=a.oimage,a.alpha=1,a.Draw(i,h,g,b),a.h=e,a.w=f,1},f.DrawColour=function(d,h,i,e,f,g,a,b,c){return a.oimage?(this.pulse<1?(a.alpha=1-w(this.pulse,2),a.Draw(d,b,c,a.fimage),a.alpha=this.pulse):a.alpha=1,a.Draw(d,b,c,a.oimage),1):this[a.image?'DrawColourImage':'DrawColourText'](d,h,i,e,f,g,a,b,c)},f.DrawColourText=function(f,h,i,j,g,e,a,b,c){var d=a.colour;return a.colour=e,a.alpha=1,a.Draw(f,b,c),a.colour=d,1},f.DrawColourImage=function(a,q,p,o,n,m,i,r,l){var f=a.canvas,e=~~g(q,0),d=~~g(p,0),c=h(f.width-e,o)+.5|0,b=h(f.height-d,n)+.5|0,j;return v?(v.width=c,v.height=b):v=k(c,b),!v?this.SetMethod('outline'):(j=v.getContext('2d'),j.drawImage(f,e,d,c,b,0,0,c,b),a.clearRect(e,d,c,b),this.pulsate?i.alpha=1-w(this.pulse,2):i.alpha=1,i.Draw(a,r,l),a.setTransform(1,0,0,1,0,0),a.save(),a.beginPath(),a.rect(e,d,c,b),a.clip(),a.globalCompositeOperation='source-in',a.fillStyle=m,a.fillRect(e,d,c,b),a.restore(),a.globalAlpha=1,a.globalCompositeOperation='destination-over',a.drawImage(v,0,0,c,b,e,d,c,b),a.globalCompositeOperation='source-over',1)},f.DrawAlt=function(b,a,c,d,f,g){var e=this.RealPreDraw(b,a,c,d,f,g);return a.alt&&(a.DrawImage(b,c,d,a.alt),e=1),e},f.DrawBlock=function(a,d,e,b,c,f){var g=h(this.radius,c/2,b/2);a.fillStyle=f,y(a,d,e,b,c,g)},f.DrawSimple=function(a,b,c,d,e,f){var g=this.tc;return a.setTransform(1,0,0,1,0,0),a.strokeStyle=this.colour,a.lineWidth=g.outlineThickness,a.shadowBlur=a.shadowOffsetX=a.shadowOffsetY=0,a.globalAlpha=f?e:1,this.drawFunc(a,this.x,this.y,this.w,this.h,this.colour,b,c,d)},f.DrawPulsate=function(h,d,e,f){var g=q()-this.ts,c=this.tc,b=c.pulsateTo+(1-c.pulsateTo)*(.5+l(2*Math.PI*g/(1e3*c.pulsateTime))/2);return this.pulse=b=a.Smooth(1,b),this.DrawSimple(h,d,e,f,b,1)},f.Active=function(d,a,b){var c=a>=this.x&&b>=this.y&&a<=this.x+this.w&&b<=this.y+this.h;return c?this.ts=this.ts||q():this.ts=null,c},f.PreDraw=f.PostDraw=f.LastDraw=x;function J(a,h,c,b,e,f,g,d,i,j,k,l,m,n){this.tc=a,this.image=null,this.text=h,this.text_original=n,this.line_widths=[],this.title=c.title||null,this.a=c,this.position=new s(b[0],b[1],b[2]),this.x=this.y=this.z=0,this.w=e,this.h=f,this.colour=g||a.textColour,this.bgColour=d||a.bgColour,this.bgRadius=i|0,this.bgOutline=j||this.colour,this.bgOutlineThickness=k|0,this.textFont=l||a.textFont,this.padding=m|0,this.sc=this.alpha=1,this.weighted=!a.weight,this.outline=new _(a,this),this.audio=null}d=J.prototype,d.Init=function(b){var a=this.tc;this.textHeight=a.textHeight,this.HasText()?this.Measure(a.ctxt,a):(this.w=this.iw,this.h=this.ih),this.SetShadowColour=a.shadowAlpha?this.SetShadowColourAlpha:this.SetShadowColourFixed,this.SetDraw(a)},d.Draw=x,d.HasText=function(){return this.text&&this.text[0].length>0},d.EqualTo=function(a){var b=a.getElementsByTagName('img');return this.a.href!=a.href?0:b.length?this.image.src==b[0].src:(a.innerText||a.textContent)==this.text_original},d.SetImage=function(a){this.image=this.fimage=a},d.SetAudio=function(a){this.audio=a,this.audio.load()},d.SetDraw=function(a){this.Draw=this.fimage?a.ie>7?this.DrawImageIE:this.DrawImage:this.DrawText,a.noSelect&&(this.CheckActive=x)},d.MeasureText=function(d){var a,e=this.text.length,b=0,c;for(a=0;a0?c=H(c,this.oimage.width,this.oimage.height):this.oimage=H(this.oimage,c.width,c.height)),c&&(this.fimage=c,l=this.fimage.width/b,j=this.fimage.height/b),this.SetDraw(a),a.txtOpt=!!this.fimage),this.h=j,this.w=l},d.SetFont=function(a,b,c,d){this.textFont=a,this.colour=b,this.bgColour=c,this.bgOutline=d,this.Measure(this.tc.ctxt,this.tc)},d.SetWeight=function(c){var b=this.tc,e=b.weightMode.split(/[, ]/),d,a,f=c.length;if(!this.HasText())return;this.weighted=!0;for(a=0;a0&&a.weightSizeMax>a.weightSizeMin?this.textHeight=a.weightSize*(a.weightSizeMin+(a.weightSizeMax-a.weightSizeMin)*c):this.textHeight=g(1,b*a.weightSize))},d.SetShadowColourFixed=function(a,b,c){a.shadowColor=b},d.SetShadowColourAlpha=function(a,b,c){a.shadowColor=aE(b,c)},d.DrawText=function(a,h,i){var e=this.tc,g=this.x,f=this.y,c=this.sc,b,d;a.globalAlpha=this.alpha,a.fillStyle=this.colour,e.shadow&&this.SetShadowColour(a,e.shadow,this.alpha),a.font=this.font,g+=h/c,f+=i/c-this.h/2;for(b=0;b{this.stopped?this.audio.pause():this.playing=1}),1}};function a(f,o,k){var d,i,b=c.getElementById(f),l=['id','class','innerHTML'];if(!b)throw 0;if(n(window.G_vmlCanvasManager)&&(b=window.G_vmlCanvasManager.initElement(b),this.ie=parseFloat(navigator.appVersion.split('MSIE')[1])),b&&(!b.getContext||!b.getContext('2d').fillText)){i=c.createElement('DIV');for(d=0;d0?a.scrollPause=~~this.scrollPause:this.scrollPause=0,this.minTags>0&&this.repeatTags<1&&(d=this.GetTags().length)&&(this.repeatTags=af(this.minTags/d)-1),this.transform=m.Identity(),this.startTime=this.time=q(),this.mx=this.my=-1,this.centreImage&&av(this),this.Animate=this.dragControl?this.AnimateDrag:this.AnimatePosition,this.animTiming=typeof a[this.animTiming]=='function'?a[this.animTiming]:a.Smooth,this.shadowBlur||this.shadowOffset[0]||this.shadowOffset[1]?(this.ctxt.shadowColor=this.shadow,this.shadow=this.ctxt.shadowColor,this.shadowAlpha=aD()):delete this.shadow,this.activeAudio===!1?e='off':this.activeAudio&&this.LoadAudio(),this.Load(),o&&this.hideTags&&function(b){a.loaded?b.HideTags():t('load',function(){b.HideTags()},window)}(this),this.yaw=this.initial?this.initial[0]*this.maxSpeed:0,this.pitch=this.initial?this.initial[1]*this.maxSpeed:0,this.tooltip?(this.ctitle=b.title,b.title='',this.tooltip=='native'?this.Tooltip=this.TooltipNative:(this.Tooltip=this.TooltipDiv,this.ttdiv||(this.ttdiv=c.createElement('div'),this.ttdiv.className=this.tooltipClass,this.ttdiv.style.position='absolute',this.ttdiv.style.zIndex=b.style.zIndex+1,t('mouseover',function(a){a.target.style.display='none'},this.ttdiv),c.body.appendChild(this.ttdiv)))):this.Tooltip=this.TooltipNone,!this.noMouse&&!j[f]){j[f]=[['mousemove',ad],['mouseout',an],['mouseup',aq],['touchstart',ar],['touchend',ac],['touchcancel',ac],['touchmove',au]],this.dragControl&&(j[f].push(['mousedown',ap]),j[f].push(['selectstart',x])),this.wheelZoom&&(j[f].push(['mousewheel',ab]),j[f].push(['DOMMouseScroll',ab])),this.scrollPause&&j[f].push(['scroll',aw,window]);for(d=0;dthis.max_weight[a])&&(this.max_weight[a]=c),(!this.min_weight[a]||cthis.min_weight[a]&&(g=1);if(g)for(b=0;b=d&&this.my>=e)return!0},b.ToggleAudio=function(){var a=this.audioOff||e&&e.state==='suspended';a||this.currentAudio&&this.currentAudio.StopAudio(),this.audioOff=!a},b.Draw=function(s){if(this.paused)return;var l=this.canvas,i=l.width,j=l.height,q=0,p=(s-this.time)*a.interval/1e3,h=i/2+this.offsetX,g=j/2+this.offsetY,d=this.ctxt,b,f,c,o=-1,e=this.taglist,k=e.length,t=this.active&&this.active.tag,m='',u=this.frontSelect,r=this.centreFunc==x,n;if(this.time=s,this.frozen&&this.drawn)return this.Animate(i,j,p);n=this.AnimateFixed(),d.setTransform(1,0,0,1,0,0);for(c=0;c=0&&this.my>=0&&this.taglist[c].CheckActive(d,h,g),f&&f.sc>q&&(!u||f.z<=0)&&(b=f,o=c,b.tag=this.taglist[c],q=f.sc);this.active=b}this.txtOpt||this.shadow&&this.SetShadow(d),d.clearRect(0,0,i,j);for(c=0;c=this.fadeIn?(this.fadeIn=0,this.fixedAlpha=1):this.fixedAlpha=b/this.fadeIn),this.fixedAnim)&&(this.fixedAnim.transform||(this.fixedAnim.transform=this.transform),a=this.fixedAnim,b=q()-a.t0,c=a.angle,d,e=this.animTiming(a.t,b),this.transform=a.transform,b>=a.t?(this.fixedCallbackTag=a.tag,this.fixedCallback=a.cb,this.fixedAnim=this.yaw=this.pitch=0):c*=e,d=m.Rotation(c,a.axis),this.transform=this.transform.mul(d),this.fixedAnim!=0)},b.AnimatePosition=function(g,h,f){var a=this,d=a.mx,e=a.my,b,c;!a.frozen&&d>=0&&e>=0&&db&&(a.yaw=c>a.z0?a.yaw*a.decel:0),!a.ly&&d>b&&(a.pitch=d>a.z0?a.pitch*a.decel:0)},b.Zoom=function(a){this.z2=this.z1*(1/a),this.drawn=0},b.Clicked=function(b){if(this.CheckAudioIcon()){this.ToggleAudio();return}var a=this.active;try{a&&a.tag&&(this.clickToFront===!1||this.clickToFront===null?a.tag.Clicked(b):this.TagToFront(a.tag,this.clickToFront,function(){a.tag.Clicked(b)},!0))}catch(a){}},b.Wheel=function(a){var b=this.zoom+this.zoomStep*(a?1:-1);this.zoom=h(this.zoomMax,g(this.zoomMin,b)),this.Zoom(this.zoom)},b.BeginDrag=function(a){this.down=K(a,this.canvas),a.cancelBubble=!0,a.returnValue=!1,a.preventDefault&&a.preventDefault()},b.Drag=function(e,a){if(this.dragControl&&this.down){var d=this.dragThreshold*this.dragThreshold,b=a.x-this.down.x,c=a.y-this.down.y;(this.dragging||b*b+c*c>d)&&(this.dx=b,this.dy=c,this.dragging=1,this.down=a)}return this.dragging},b.EndDrag=function(){var a=this.dragging;return this.dragging=this.down=null,a};function ah(a){var b=a.targetTouches[0],c=a.targetTouches[1];return E(w(c.pageX-b.pageX,2)+w(c.pageY-b.pageY,2))}b.BeginPinch=function(a){this.pinched=[ah(a),this.zoom],a.preventDefault&&a.preventDefault()},b.Pinch=function(d){var b,c,a=this.pinched;if(!a)return;c=ah(d),b=a[1]*c/a[0],this.zoom=h(this.zoomMax,g(this.zoomMin,b)),this.Zoom(this.zoom)},b.EndPinch=function(a){this.pinched=null},b.Pause=function(){this.paused=!0},b.Resume=function(){this.paused=!1},b.SetSpeed=function(a){this.initial=a,this.yaw=a[0]*this.maxSpeed,this.pitch=a[1]*this.maxSpeed},b.FindTag=function(a){if(!n(a))return null;if(n(a.index)&&(a=a.index),!B(a))return this.taglist[a];var c,d,b;n(a.id)?(c='id',d=a.id):n(a.text)&&(c='innerText',d=a.text);for(b=0;b + - + 年会抽奖小程序 + -
-
获奖名单
-
-
- {{item}} + -
- - + + + + + }; + + function lottery(count) { + var list = canvas.getElementsByTagName('a'); + var color = 'yellow'; + let notSelectedMembers = member + .filter(function (m, index) { + m.index = index; + return !choosed[getKey(m)]; + }); + + let currentSelectedMembers = []; + let noSelectedMemberLength = notSelectedMembers.length; + if (count >= noSelectedMemberLength) { + currentSelectedMembers = notSelectedMembers; + } else { + while (currentSelectedMembers.length < count) { + let random = Math.floor(Math.random() * noSelectedMemberLength); + let randomMember = member[random]; + if (currentSelectedMembers.findIndex((element) => { + return element.name === member[random].name; + }) === -1) { + currentSelectedMembers.push(randomMember); + } + } + } + var ret = currentSelectedMembers + .map(function (m) { + choosed[getKey(m)] = 1; + list[m.index].style.color = color; + return m.name + '
' + m.phone; + }); + localStorage.setItem('choosed', JSON.stringify(choosed)); + return ret; + }; + var canvas = document.createElement('canvas'); + canvas.id = 'myCanvas'; + canvas.width = document.body.offsetWidth; + canvas.height = document.body.offsetHeight; + document.getElementById('main').appendChild(canvas); + new Vue({ + el: '#tools', + data: { + selected: 3, + running: false, + btns: [ + {name: '三等奖(3)人', value: 3}, + {name: '二等奖(2)人', value: 2}, + {name: '一等奖(1)人', value: 1} + ] + }, + mounted() { + canvas.innerHTML = createHTML(); + TagCanvas.Start('myCanvas', '', { + textColour: null, + initial: speed(), + dragControl: 1, + textHeight: 14 + }); + }, + methods: { + reset: function () { + if (confirm('确定要重置么?所有之前的抽奖历史将被清除!')) { + localStorage.clear(); + location.reload(true); + } + }, + onClick: function (num) { + $('#result').css('display', 'none'); + $('#main').removeClass('mask'); + this.selected = num; + }, + toggle: function () { + if (this.running) { + TagCanvas.SetSpeed('myCanvas', speed()); + var ret = lottery(this.selected); + if (ret.length === 0) { + $('#result').css('display', 'block').html('已抽完'); + return + } + $('#result').css('display', 'block').html('' + ret.join('') + ''); + TagCanvas.Reload('myCanvas'); + setTimeout(function () { + localStorage.setItem(new Date().toString(), JSON.stringify(ret)); + $('#main').addClass('mask'); + }, 300); + } else { + $('#result').css('display', 'none'); + $('#main').removeClass('mask'); + TagCanvas.SetSpeed('myCanvas', [5, 1]); + } + this.running = !this.running; + } + } + }); + })(); + + \ No newline at end of file From b1951d729f3abd06280835e367a7c30546f139c1 Mon Sep 17 00:00:00 2001 From: huangjue Date: Thu, 30 Dec 2021 15:06:45 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 325 ++++---- js/tagcanvas.js | 2102 ----------------------------------------------- js/vue.js | 6 - js/vue.min.js | 6 + js/zepto.js | 1909 ------------------------------------------ js/zepto.min.js | 2 + 6 files changed, 195 insertions(+), 4155 deletions(-) delete mode 100644 js/tagcanvas.js delete mode 100644 js/vue.js create mode 100644 js/vue.min.js delete mode 100644 js/zepto.js create mode 100644 js/zepto.min.js diff --git a/index.html b/index.html index e92b760..1ac3935 100755 --- a/index.html +++ b/index.html @@ -1,27 +1,33 @@ + - + 年会抽奖小程序 + -
-
- 获奖名单 +
+ +
+
-
-
-
-
- - + - -
- - - - - + + + + + }); + })(); + + \ No newline at end of file diff --git a/js/tagcanvas.js b/js/tagcanvas.js deleted file mode 100644 index 24523e6..0000000 --- a/js/tagcanvas.js +++ /dev/null @@ -1,2102 +0,0 @@ -/** - * Copyright (C) 2010-2015 Graham Breach - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ -/** - * TagCanvas 2.7 - * For more information, please contact - */ -(function(){ -"use strict"; -var i, j, abs = Math.abs, sin = Math.sin, cos = Math.cos, max = Math.max, - min = Math.min, ceil = Math.ceil, sqrt = Math.sqrt, pow = Math.pow, - hexlookup3 = {}, hexlookup2 = {}, hexlookup1 = { - 0:"0,", 1:"17,", 2:"34,", 3:"51,", 4:"68,", 5:"85,", - 6:"102,", 7:"119,", 8:"136,", 9:"153,", a:"170,", A:"170,", - b:"187,", B:"187,", c:"204,", C:"204,", d:"221,", D:"221,", - e:"238,", E:"238,", f:"255,", F:"255," - }, Oproto, Tproto, TCproto, Mproto, Vproto, TSproto, TCVproto, - doc = document, ocanvas, handlers = {}; -for(i = 0; i < 256; ++i) { - j = i.toString(16); - if(i < 16) - j = '0' + j; - hexlookup2[j] = hexlookup2[j.toUpperCase()] = i.toString() + ','; -} -function Defined(d) { - return typeof d != 'undefined'; -} -function IsObject(o) { - return typeof o == 'object' && o != null; -} -function Clamp(v, mn, mx) { - return isNaN(v) ? mx : min(mx, max(mn, v)); -} -function Nop() { - return false; -} -function TimeNow() { - return new Date().valueOf(); -} -function SortList(l, f) { - var nl = [], tl = l.length, i; - for(i = 0; i < tl; ++i) - nl.push(l[i]); - nl.sort(f); - return nl; -} -function Shuffle(a) { - var i = a.length-1, t, p; - while(i) { - p = ~~(Math.random()*i); - t = a[i]; - a[i] = a[p]; - a[p] = t; - --i; - } -} -function Vector(x, y, z) { - this.x = x; - this.y = y; - this.z = z; -} -Vproto = Vector.prototype; -Vproto.length = function() { - return sqrt(this.x * this.x + this.y * this.y + this.z * this.z); -}; -Vproto.dot = function(v) { - return this.x * v.x + this.y * v.y + this.z * v.z; -}; -Vproto.cross = function(v) { - var x = this.y * v.z - this.z * v.y, - y = this.z * v.x - this.x * v.z, - z = this.x * v.y - this.y * v.x; - return new Vector(x, y, z); -}; -Vproto.angle = function(v) { - var dot = this.dot(v), ac; - if(dot == 0) - return Math.PI / 2.0; - ac = dot / (this.length() * v.length()); - if(ac >= 1) - return 0; - if(ac <= -1) - return Math.PI; - return Math.acos(ac); -}; -Vproto.unit = function() { - var l = this.length(); - return new Vector(this.x / l, this.y / l, this.z / l); -}; -function MakeVector(lg, lt) { - lt = lt * Math.PI / 180; - lg = lg * Math.PI / 180; - var x = sin(lg) * cos(lt), y = -sin(lt), z = -cos(lg) * cos(lt); - return new Vector(x, y, z); -} -function Matrix(a) { - this[1] = {1: a[0], 2: a[1], 3: a[2]}; - this[2] = {1: a[3], 2: a[4], 3: a[5]}; - this[3] = {1: a[6], 2: a[7], 3: a[8]}; -} -Mproto = Matrix.prototype; -Matrix.Identity = function() { - return new Matrix([1,0,0, 0,1,0, 0,0,1]); -}; -Matrix.Rotation = function(angle, u) { - var sina = sin(angle), cosa = cos(angle), mcos = 1 - cosa; - return new Matrix([ - cosa + pow(u.x, 2) * mcos, u.x * u.y * mcos - u.z * sina, u.x * u.z * mcos + u.y * sina, - u.y * u.x * mcos + u.z * sina, cosa + pow(u.y, 2) * mcos, u.y * u.z * mcos - u.x * sina, - u.z * u.x * mcos - u.y * sina, u.z * u.y * mcos + u.x * sina, cosa + pow(u.z, 2) * mcos - ]); -} -Mproto.mul = function(m) { - var a = [], i, j, mmatrix = (m.xform ? 1 : 0); - for(i = 1; i <= 3; ++i) - for(j = 1; j <= 3; ++j) { - if(mmatrix) - a.push(this[i][1] * m[1][j] + - this[i][2] * m[2][j] + - this[i][3] * m[3][j]); - else - a.push(this[i][j] * m); - } - return new Matrix(a); -}; -Mproto.xform = function(p) { - var a = {}, x = p.x, y = p.y, z = p.z; - a.x = x * this[1][1] + y * this[2][1] + z * this[3][1]; - a.y = x * this[1][2] + y * this[2][2] + z * this[3][2]; - a.z = x * this[1][3] + y * this[2][3] + z * this[3][3]; - return a; -}; -function PointsOnSphere(n,xr,yr,zr) { - var i, y, r, phi, pts = [], inc = Math.PI * (3-sqrt(5)), off = 2/n; - for(i = 0; i < n; ++i) { - y = i * off - 1 + (off / 2); - r = sqrt(1 - y*y); - phi = i * inc; - pts.push([cos(phi) * r * xr, y * yr, sin(phi) * r * zr]); - } - return pts; -} -function Cylinder(n,o,xr,yr,zr) { - var phi, pts = [], inc = Math.PI * (3-sqrt(5)), off = 2/n, i, j, k, l; - for(i = 0; i < n; ++i) { - j = i * off - 1 + (off / 2); - phi = i * inc; - k = cos(phi); - l = sin(phi); - pts.push(o ? [j * xr, k * yr, l * zr] : [k * xr, j * yr, l * zr]); - } - return pts; -} -function Ring(o, n, xr, yr, zr, j) { - var phi, pts = [], inc = Math.PI * 2 / n, i, k, l; - for(i = 0; i < n; ++i) { - phi = i * inc; - k = cos(phi); - l = sin(phi); - pts.push(o ? [j * xr, k * yr, l * zr] : [k * xr, j * yr, l * zr]); - } - return pts; -} -function PointsOnCylinderV(n,xr,yr,zr) { return Cylinder(n, 0, xr, yr, zr) } -function PointsOnCylinderH(n,xr,yr,zr) { return Cylinder(n, 1, xr, yr, zr) } -function PointsOnRingV(n, xr, yr, zr, offset) { - offset = isNaN(offset) ? 0 : offset * 1; - return Ring(0, n, xr, yr, zr, offset); -} -function PointsOnRingH(n, xr, yr, zr, offset) { - offset = isNaN(offset) ? 0 : offset * 1; - return Ring(1, n, xr, yr, zr, offset); -} -function CentreImage(t) { - var i = new Image; - i.onload = function() { - var dx = i.width / 2, dy = i.height / 2; - t.centreFunc = function(c, w, h, cx, cy) { - c.setTransform(1, 0, 0, 1, 0, 0); - c.globalAlpha = 1; - c.drawImage(i, cx - dx, cy - dy); - }; - }; - i.src = t.centreImage; -} -function SetAlpha(c,a) { - var d = c, p1, p2, ae = (a*1).toPrecision(3) + ')'; - if(c[0] === '#') { - if(!hexlookup3[c]) - if(c.length === 4) - hexlookup3[c] = 'rgba(' + hexlookup1[c[1]] + hexlookup1[c[2]] + hexlookup1[c[3]]; - else - hexlookup3[c] = 'rgba(' + hexlookup2[c.substr(1,2)] + hexlookup2[c.substr(3,2)] + hexlookup2[c.substr(5,2)]; - d = hexlookup3[c] + ae; - } else if(c.substr(0,4) === 'rgb(' || c.substr(0,4) === 'hsl(') { - d = (c.replace('(','a(').replace(')', ',' + ae)); - } else if(c.substr(0,5) === 'rgba(' || c.substr(0,5) === 'hsla(') { - p1 = c.lastIndexOf(',') + 1, p2 = c.indexOf(')'); - a *= parseFloat(c.substring(p1,p2)); - d = c.substr(0,p1) + a.toPrecision(3) + ')'; - } - return d; -} -function NewCanvas(w,h) { - // if using excanvas, give up now - if(window.G_vmlCanvasManager) - return null; - var c = doc.createElement('canvas'); - c.width = w; - c.height = h; - return c; -} -// I think all browsers pass this test now... -function ShadowAlphaBroken() { - var cv = NewCanvas(3,3), c, i; - if(!cv) - return false; - c = cv.getContext('2d'); - c.strokeStyle = '#000'; - c.shadowColor = '#fff'; - c.shadowBlur = 3; - c.globalAlpha = 0; - c.strokeRect(2,2,2,2); - c.globalAlpha = 1; - i = c.getImageData(2,2,1,1); - cv = null; - return (i.data[0] > 0); -} -function SetGradient(c, l, o, g) { - var gd = c.createLinearGradient(0, 0, l, 0), i; - for(i in g) - gd.addColorStop(1 - i, g[i]); - c.fillStyle = gd; - c.fillRect(0, o, l, 1); -} -function FindGradientColour(tc, p, r) { - var l = 1024, h = 1, gl = tc.weightGradient, cv, c, i, d; - if(tc.gCanvas) { - c = tc.gCanvas.getContext('2d'); - h = tc.gCanvas.height; - } else { - if(IsObject(gl[0])) - h = gl.length; - else - gl = [gl]; - tc.gCanvas = cv = NewCanvas(l, h); - if(!cv) - return null; - c = cv.getContext('2d'); - for(i = 0; i < h; ++i) - SetGradient(c, l, i, gl[i]); - } - r = max(min(r || 0, h - 1), 0); - d = c.getImageData(~~((l - 1) * p), r, 1, 1).data; - return 'rgba(' + d[0] + ',' + d[1] + ',' + d[2] + ',' + (d[3]/255) + ')'; -} -function TextSet(ctxt, font, colour, strings, padx, pady, shadowColour, - shadowBlur, shadowOffsets, maxWidth, widths, align) { - var xo = padx + (shadowBlur || 0) + - (shadowOffsets.length && shadowOffsets[0] < 0 ? abs(shadowOffsets[0]) : 0), - yo = pady + (shadowBlur || 0) + - (shadowOffsets.length && shadowOffsets[1] < 0 ? abs(shadowOffsets[1]) : 0), i, xc; - ctxt.font = font; - ctxt.textBaseline = 'top'; - ctxt.fillStyle = colour; - shadowColour && (ctxt.shadowColor = shadowColour); - shadowBlur && (ctxt.shadowBlur = shadowBlur); - shadowOffsets.length && (ctxt.shadowOffsetX = shadowOffsets[0], - ctxt.shadowOffsetY = shadowOffsets[1]); - for(i = 0; i < strings.length; ++i) { - xc = 0; - if(widths) { - if('right' == align) { - xc = maxWidth - widths[i]; - } else if('centre' == align) { - xc = (maxWidth - widths[i]) / 2; - } - } - ctxt.fillText(strings[i], xo + xc, yo); - yo += parseInt(font); - } -} -function RRect(c, x, y, w, h, r, s) { - if(r) { - c.beginPath(); - c.moveTo(x, y + h - r); - c.arcTo(x, y, x + r, y, r); - c.arcTo(x + w, y, x + w, y + r, r); - c.arcTo(x + w, y + h, x + w - r, y + h, r); - c.arcTo(x, y + h, x, y + h - r, r); - c.closePath(); - c[s ? 'stroke' : 'fill'](); - } else { - c[s ? 'strokeRect' : 'fillRect'](x, y, w, h); - } -} -function TextCanvas(strings, font, w, h, maxWidth, stringWidths, align, valign, - scale) { - this.strings = strings; - this.font = font; - this.width = w; - this.height = h; - this.maxWidth = maxWidth; - this.stringWidths = stringWidths; - this.align = align; - this.valign = valign; - this.scale = scale; -} -TCVproto = TextCanvas.prototype; -TCVproto.SetImage = function(image, w, h, position, padding, align, valign, - scale) { - this.image = image; - this.iwidth = w * this.scale; - this.iheight = h * this.scale; - this.ipos = position; - this.ipad = padding * this.scale; - this.iscale = scale; - this.ialign = align; - this.ivalign = valign; -}; -TCVproto.Align = function(size, space, a) { - var pos = 0; - if(a == 'right' || a == 'bottom') - pos = space - size; - else if(a != 'left' && a != 'top') - pos = (space - size) / 2; - return pos; -}; -TCVproto.Create = function(colour, bgColour, bgOutline, bgOutlineThickness, - shadowColour, shadowBlur, shadowOffsets, padding, radius) { - var cv, cw, ch, c, x1, x2, y1, y2, offx, offy, ix, iy, iw, ih, - sox = abs(shadowOffsets[0]), soy = abs(shadowOffsets[1]), shadowcv, shadowc; - padding = max(padding, sox + shadowBlur, soy + shadowBlur); - x1 = 2 * (padding + bgOutlineThickness); - y1 = 2 * (padding + bgOutlineThickness); - cw = this.width + x1; - ch = this.height + y1; - offx = offy = padding + bgOutlineThickness; - - if(this.image) { - ix = iy = padding + bgOutlineThickness; - iw = this.iwidth; - ih = this.iheight; - if(this.ipos == 'top' || this.ipos == 'bottom') { - if(iw < this.width) - ix += this.Align(iw, this.width, this.ialign); - else - offx += this.Align(this.width, iw, this.align); - if(this.ipos == 'top') - offy += ih + this.ipad; - else - iy += this.height + this.ipad; - cw = max(cw, iw + x1); - ch += ih + this.ipad; - } else { - if(ih < this.height) - iy += this.Align(ih, this.height, this.ivalign); - else - offy += this.Align(this.height, ih, this.valign); - if(this.ipos == 'right') - ix += this.width + this.ipad; - else - offx += iw + this.ipad; - cw += iw + this.ipad; - ch = max(ch, ih + y1); - } - } - - cv = NewCanvas(cw, ch); - if(!cv) - return null; - x1 = y1 = bgOutlineThickness / 2; - x2 = cw - bgOutlineThickness; - y2 = ch - bgOutlineThickness; - c = cv.getContext('2d'); - if(bgColour) { - c.fillStyle = bgColour; - RRect(c, x1, y1, x2, y2, radius); - } - if(bgOutlineThickness) { - c.strokeStyle = bgOutline; - c.lineWidth = bgOutlineThickness; - RRect(c, x1, y1, x2, y2, radius, true); - } - if(shadowBlur || sox || soy) { - // use a transparent canvas to draw on - shadowcv = NewCanvas(cw, ch); - if(shadowcv) { - shadowc = c; - c = shadowcv.getContext('2d'); - } - } - - // don't use TextSet shadow support because it adds space for shadow - TextSet(c, this.font, colour, this.strings, offx, offy, 0, 0, [], - this.maxWidth, this.stringWidths, this.align); - - if(this.image) - c.drawImage(this.image, ix, iy, iw, ih); - - if(shadowc) { - // draw the text and image with the added shadow - c = shadowc; - shadowColour && (c.shadowColor = shadowColour); - shadowBlur && (c.shadowBlur = shadowBlur); - c.shadowOffsetX = shadowOffsets[0]; - c.shadowOffsetY = shadowOffsets[1]; - c.drawImage(shadowcv, 0, 0); - } - return cv; -}; -function ExpandImage(i, w, h) { - var cv = NewCanvas(w, h), c; - if(!cv) - return null; - c = cv.getContext('2d'); - c.drawImage(i, (w - i.width) / 2, (h - i.height) / 2); - return cv; -} -function ScaleImage(i, w, h) { - var cv = NewCanvas(w, h), c; - if(!cv) - return null; - c = cv.getContext('2d'); - c.drawImage(i, 0, 0, w, h); - return cv; -} -function AddBackgroundToImage(i, w, h, scale, colour, othickness, ocolour, - padding, radius, ofill) { - var cw = w + ((2 * padding) + othickness) * scale, - ch = h + ((2 * padding) + othickness) * scale, - cv = NewCanvas(cw, ch), c, x1, y1, x2, y2, ocanvas, cc; - if(!cv) - return null; - othickness *= scale; - radius *= scale; - x1 = y1 = othickness / 2; - x2 = cw - othickness; - y2 = ch - othickness; - padding = (padding * scale) + x1; // add space for outline - c = cv.getContext('2d'); - if(colour) { - c.fillStyle = colour; - RRect(c, x1, y1, x2, y2, radius); - } - if(othickness) { - c.strokeStyle = ocolour; - c.lineWidth = othickness; - RRect(c, x1, y1, x2, y2, radius, true); - } - - if(ofill) { - // use compositing to colour in the image and border - ocanvas = NewCanvas(cw, ch); - cc = ocanvas.getContext('2d'); - cc.drawImage(i, padding, padding, w, h); - cc.globalCompositeOperation = 'source-in'; - cc.fillStyle = ocolour; - cc.fillRect(0, 0, cw, ch); - cc.globalCompositeOperation = 'destination-over'; - cc.drawImage(cv, 0, 0); - cc.globalCompositeOperation = 'source-over'; - c.drawImage(ocanvas, 0, 0); - } else { - c.drawImage(i, padding, padding, i.width, i.height); - } - return {image: cv, width: cw / scale, height: ch / scale}; -} -/** - * Creates a new canvas containing the image and its shadow - * Returns an object containing the image and its dimensions at z=0 - */ -function AddShadowToImage(i, w, h, scale, sc, sb, so) { - var sw = abs(so[0]), sh = abs(so[1]), - cw = w + (sw > sb ? sw + sb : sb * 2) * scale, - ch = h + (sh > sb ? sh + sb : sb * 2) * scale, - xo = scale * ((sb || 0) + (so[0] < 0 ? sw : 0)), - yo = scale * ((sb || 0) + (so[1] < 0 ? sh : 0)), cv, c; - cv = NewCanvas(cw, ch); - if(!cv) - return null; - c = cv.getContext('2d'); - sc && (c.shadowColor = sc); - sb && (c.shadowBlur = sb * scale); - so && (c.shadowOffsetX = so[0] * scale, c.shadowOffsetY = so[1] * scale); - c.drawImage(i, xo, yo, w, h); - return {image: cv, width: cw / scale, height: ch / scale}; -} -function FindTextBoundingBox(s,f,ht) { - var w = parseInt(s.toString().length * ht), h = parseInt(ht * 2 * s.length), - cv = NewCanvas(w,h), c, idata, w1, h1, x, y, i, ex; - if(!cv) - return null; - c = cv.getContext('2d'); - c.fillStyle = '#000'; - c.fillRect(0,0,w,h); - TextSet(c,ht + 'px ' + f,'#fff',s,0,0,0,0,[],'centre') - - idata = c.getImageData(0,0,w,h); - w1 = idata.width; h1 = idata.height; - ex = { - min: { x: w1, y: h1 }, - max: { x: -1, y: -1 } - }; - for(y = 0; y < h1; ++y) { - for(x = 0; x < w1; ++x) { - i = (y * w1 + x) * 4; - if(idata.data[i+1] > 0) { - if(x < ex.min.x) ex.min.x = x; - if(x > ex.max.x) ex.max.x = x; - if(y < ex.min.y) ex.min.y = y; - if(y > ex.max.y) ex.max.y = y; - } - } - } - // device pixels might not be css pixels - if(w1 != w) { - ex.min.x *= (w / w1); - ex.max.x *= (w / w1); - } - if(h1 != h) { - ex.min.y *= (w / h1); - ex.max.y *= (w / h1); - } - - cv = null; - return ex; -} -function FixFont(f) { - return "'" + f.replace(/(\'|\")/g,'').replace(/\s*,\s*/g, "', '") + "'"; -} -function AddHandler(h,f,e) { - e = e || doc; - if(e.addEventListener) - e.addEventListener(h,f,false); - else - e.attachEvent('on' + h, f); -} -function RemoveHandler(h,f,e) { - e = e || doc; - if(e.removeEventListener) - e.removeEventListener(h, f); - else - e.detachEvent('on' + h, f); -} -function AddImage(i, o, t, tc) { - var s = tc.imageScale, mscale, ic, bc, oc, iw, ih; - // image not loaded, wait for image onload - if(!o.complete) - return AddHandler('load',function() { AddImage(i,o,t,tc); }, o); - if(!i.complete) - return AddHandler('load',function() { AddImage(i,o,t,tc); }, i); - - // Yes, this does look like nonsense, but it makes sure that both the - // width and height are actually set and not just calculated. This is - // required to keep proportional sizes when the images are hidden, so - // the images can be used again for another cloud. - o.width = o.width; - o.height = o.height; - - if(s) { - i.width = o.width * s; - i.height = o.height * s; - } - // the standard width of the image, with imageScale applied - t.iw = i.width; - t.ih = i.height; - if(tc.txtOpt) { - ic = i; - mscale = tc.zoomMax * tc.txtScale; - iw = t.iw * mscale; - ih = t.ih * mscale; - if(iw < o.naturalWidth || ih < o.naturalHeight) { - ic = ScaleImage(i, iw, ih); - if(ic) - t.fimage = ic; - } else { - iw = t.iw; - ih = t.ih; - mscale = 1; - } - if(!t.HasText()) { - if(tc.shadow) { - ic = AddShadowToImage(t.image, iw, ih, mscale, tc.shadow, tc.shadowBlur, - tc.shadowOffset); - if(ic) { - t.fimage = ic.image; - t.w = ic.width; - t.h = ic.height; - } - } - if(tc.bgColour || tc.bgOutlineThickness) { - bc = tc.bgColour == 'tag' ? GetProperty(t.a, 'background-color') : - tc.bgColour; - oc = tc.bgOutline == 'tag' ? GetProperty(t.a, 'color') : - (tc.bgOutline || tc.textColour); - iw = t.fimage.width; - ih = t.fimage.height; - if(tc.outlineMethod == 'colour') { - // create the outline version first, using the current image state - ic = AddBackgroundToImage(t.fimage, iw, ih, mscale, bc, - tc.bgOutlineThickness, tc.outlineColour, tc.padding, tc.bgRadius, 1); - if(ic) - t.oimage = ic.image; - } - ic = AddBackgroundToImage(t.fimage, iw, ih, mscale, bc, - tc.bgOutlineThickness, oc, tc.padding, tc.bgRadius); - if(ic) { - t.fimage = ic.image; - t.w = ic.width; - t.h = ic.height; - } - } - if(tc.outlineMethod == 'size') { - if(tc.outlineIncrease > 0) { - t.iw += 2 * tc.outlineIncrease; - t.ih += 2 * tc.outlineIncrease; - iw = mscale * t.iw; - ih = mscale * t.ih; - ic = ScaleImage(t.fimage, iw, ih); - t.oimage = ic; - t.fimage = ExpandImage(t.fimage, t.oimage.width, t.oimage.height); - } else { - iw = mscale * (t.iw + (2 * tc.outlineIncrease)); - ih = mscale * (t.ih + (2 * tc.outlineIncrease)); - ic = ScaleImage(t.fimage, iw, ih); - t.oimage = ExpandImage(ic, t.fimage.width, t.fimage.height); - } - } - } - } - t.Init(); -} -function GetProperty(e,p) { - var dv = doc.defaultView, pc = p.replace(/\-([a-z])/g,function(a){return a.charAt(1).toUpperCase()}); - return (dv && dv.getComputedStyle && dv.getComputedStyle(e,null).getPropertyValue(p)) || - (e.currentStyle && e.currentStyle[pc]); -} -function FindWeight(a, wFrom, tHeight) { - var w = 1, p; - if(wFrom) { - w = 1 * (a.getAttribute(wFrom) || tHeight); - } else if(p = GetProperty(a,'font-size')) { - w = (p.indexOf('px') > -1 && p.replace('px','') * 1) || - (p.indexOf('pt') > -1 && p.replace('pt','') * 1.25) || - p * 3.3; - } - return w; -} -function EventToCanvasId(e) { - return e.target && Defined(e.target.id) ? e.target.id : - e.srcElement.parentNode.id; -} -function EventXY(e, c) { - var xy, p, xmul = parseInt(GetProperty(c, 'width')) / c.width, - ymul = parseInt(GetProperty(c, 'height')) / c.height; - if(Defined(e.offsetX)) { - xy = {x: e.offsetX, y: e.offsetY}; - } else { - p = AbsPos(c.id); - if(Defined(e.changedTouches)) - e = e.changedTouches[0]; - if(e.pageX) - xy = {x: e.pageX - p.x, y: e.pageY - p.y}; - } - if(xy && xmul && ymul) { - xy.x /= xmul; - xy.y /= ymul; - } - return xy; -} -function MouseOut(e) { - var cv = e.target || e.fromElement.parentNode, tc = TagCanvas.tc[cv.id]; - if(tc) { - tc.mx = tc.my = -1; - tc.UnFreeze(); - tc.EndDrag(); - } -} -function MouseMove(e) { - return; - var i, t = TagCanvas, tc, p, tg = EventToCanvasId(e); - for(i in t.tc) { - tc = t.tc[i]; - if(tc.tttimer) { - clearTimeout(tc.tttimer); - tc.tttimer = null; - } - } - if(tg && t.tc[tg]) { - tc = t.tc[tg]; - if(p = EventXY(e, tc.canvas)) { - tc.mx = p.x; - tc.my = p.y; - tc.Drag(e, p); - } - tc.drawn = 0; - } -} -function MouseDown(e) { - var t = TagCanvas, cb = doc.addEventListener ? 0 : 1, - tg = EventToCanvasId(e); - if(tg && e.button == cb && t.tc[tg]) { - t.tc[tg].BeginDrag(e); - } -} -function MouseUp(e) { - var t = TagCanvas, cb = doc.addEventListener ? 0 : 1, - tg = EventToCanvasId(e), tc; - if(tg && e.button == cb && t.tc[tg]) { - tc = t.tc[tg]; - MouseMove(e); - if(!tc.EndDrag() && !tc.touchState) - tc.Clicked(e); - } -} -function TouchDown(e) { - var tg = EventToCanvasId(e), tc = (tg && TagCanvas.tc[tg]), p; - if(tc && e.changedTouches) { - if(e.touches.length == 1 && tc.touchState == 0) { - tc.touchState = 1; - tc.BeginDrag(e); - if(p = EventXY(e, tc.canvas)) { - tc.mx = p.x; - tc.my = p.y; - tc.drawn = 0; - } - } else if(e.targetTouches.length == 2 && tc.pinchZoom) { - tc.touchState = 3; - tc.EndDrag(); - tc.BeginPinch(e); - } else { - tc.EndDrag(); - tc.EndPinch(); - tc.touchState = 0; - } - } -} -function TouchUp(e) { - var tg = EventToCanvasId(e), tc = (tg && TagCanvas.tc[tg]); - if(tc && e.changedTouches) { - switch(tc.touchState) { - case 1: - tc.Draw(); - tc.Clicked(); - break; - case 2: - tc.EndDrag(); - break; - case 3: - tc.EndPinch(); - } - tc.touchState = 0; - } -} -function TouchMove(e) { - var i, t = TagCanvas, tc, p, tg = EventToCanvasId(e); - for(i in t.tc) { - tc = t.tc[i]; - if(tc.tttimer) { - clearTimeout(tc.tttimer); - tc.tttimer = null; - } - } - tc = (tg && t.tc[tg]); - if(tc && e.changedTouches && tc.touchState) { - switch(tc.touchState) { - case 1: - case 2: - if(p = EventXY(e, tc.canvas)) { - tc.mx = p.x; - tc.my = p.y; - if(tc.Drag(e, p)) - tc.touchState = 2; - } - break; - case 3: - tc.Pinch(e); - } - tc.drawn = 0; - } -} -function MouseWheel(e) { - var t = TagCanvas, tg = EventToCanvasId(e); - if(tg && t.tc[tg]) { - e.cancelBubble = true; - e.returnValue = false; - e.preventDefault && e.preventDefault(); - t.tc[tg].Wheel((e.wheelDelta || e.detail) > 0); - } -} -function DrawCanvas() { - DrawCanvasRAF(TimeNow()); -} -function DrawCanvasRAF(t) { - var tc = TagCanvas.tc, i; - TagCanvas.NextFrame(TagCanvas.interval); - t = t || TimeNow(); - for(i in tc) - tc[i].Draw(t); -} -function AbsPos(id) { - var e = doc.getElementById(id), r = e.getBoundingClientRect(), - dd = doc.documentElement, b = doc.body, w = window, - xs = w.pageXOffset || dd.scrollLeft, - ys = w.pageYOffset || dd.scrollTop, - xo = dd.clientLeft || b.clientLeft, - yo = dd.clientTop || b.clientTop; - return { x: r.left + xs - xo, y: r.top + ys - yo }; -} -function Project(tc,p1,sx,sy) { - var m = tc.radius * tc.z1 / (tc.z1 + tc.z2 + p1.z); - return { - x: p1.x * m * sx, - y: p1.y * m * sy, - z: p1.z, - w: (tc.z1 - p1.z) / tc.z2 - }; -} -/** - * @constructor - * for recursively splitting tag contents on
tags - */ -function TextSplitter(e) { - this.e = e; - this.br = 0; - this.line = []; - this.text = []; - this.original = e.innerText || e.textContent; -} -TSproto = TextSplitter.prototype; -TSproto.Empty = function() { - for(var i = 0; i < this.text.length; ++i) - if(this.text[i].length) - return false; - return true; -}; -TSproto.Lines = function(e) { - var r = e ? 1 : 0, cn, cl, i; - e = e || this.e; - cn = e.childNodes; - cl = cn.length; - - for(i = 0; i < cl; ++i) { - if(cn[i].nodeName == 'BR') { - this.text.push(this.line.join(' ')); - this.br = 1; - } else if(cn[i].nodeType == 3) { - if(this.br) { - this.line = [cn[i].nodeValue]; - this.br = 0; - } else { - this.line.push(cn[i].nodeValue); - } - } else { - this.Lines(cn[i]); - } - } - r || this.br || this.text.push(this.line.join(' ')); - return this.text; -}; -TSproto.SplitWidth = function(w, c, f, h) { - var i, j, words, text = []; - c.font = h + 'px ' + f; - for(i = 0; i < this.text.length; ++i) { - words = this.text[i].split(/\s+/); - this.line = [words[0]]; - for(j = 1; j < words.length; ++j) { - if(c.measureText(this.line.join(' ') + ' ' + words[j]).width > w) { - text.push(this.line.join(' ')); - this.line = [words[j]]; - } else { - this.line.push(words[j]); - } - } - text.push(this.line.join(' ')); - } - return this.text = text; -}; -/** - * @constructor - */ -function Outline(tc,t) { - this.ts = TimeNow(); - this.tc = tc; - this.tag = t; - this.x = this.y = this.w = this.h = this.sc = 1; - this.z = 0; - this.Draw = tc.pulsateTo < 1 && tc.outlineMethod != 'colour' ? - this.DrawPulsate : this.DrawSimple; - this.radius = tc.outlineRadius | 0; - this.SetMethod(tc.outlineMethod); -} -Oproto = Outline.prototype; -Oproto.SetMethod = function(om) { - var methods = { - block: ['PreDraw','DrawBlock'], - colour: ['PreDraw','DrawColour'], - outline: ['PostDraw','DrawOutline'], - classic: ['LastDraw','DrawOutline'], - size: ['PreDraw','DrawColour'], - none: ['LastDraw'] - }, funcs = methods[om] || methods.outline; - if(om == 'none') { - this.Draw = function() { return 1; } - } else { - this.drawFunc = this[funcs[1]]; - } - this[funcs[0]] = this.Draw; -}; -Oproto.Update = function(x,y,w,h,sc,z,xo,yo) { - var o = this.tc.outlineOffset, o2 = 2 * o; - this.x = sc * x + xo - o; - this.y = sc * y + yo - o; - this.w = sc * w + o2; - this.h = sc * h + o2; - this.sc = sc; // used to determine frontmost - this.z = z; -}; -Oproto.DrawOutline = function(c,x,y,w,h,colour) { - c.strokeStyle = colour; - RRect(c, x, y, w, h, this.radius, true); -}; -Oproto.DrawColour = function(c,x,y,w,h,colour,tag,x1,y1) { - if(tag.oimage) { - tag.alpha = 1; - tag.Draw(c, x1, y1, tag.oimage); - return 1; - } - return this[tag.image ? 'DrawColourImage' : 'DrawColourText'](c,x,y,w,h,colour,tag,x1,y1); -}; -Oproto.DrawColourText = function(c,x,y,w,h,colour,tag,x1,y1) { - var normal = tag.colour; - tag.colour = colour; - tag.alpha = 1; - tag.Draw(c,x1,y1); - tag.colour = normal; - return 1; -}; -Oproto.DrawColourImage = function(c,x,y,w,h,colour,tag,x1,y1) { - var ccanvas = c.canvas, fx = ~~max(x,0), fy = ~~max(y,0), - fw = min(ccanvas.width - fx, w) + .5|0, fh = min(ccanvas.height - fy,h) + .5|0, cc; - if(ocanvas) - ocanvas.width = fw, ocanvas.height = fh; - else - ocanvas = NewCanvas(fw, fh); - if(!ocanvas) - return this.SetMethod('outline'); // if using IE and images, give up! - cc = ocanvas.getContext('2d'); - - cc.drawImage(ccanvas,fx,fy,fw,fh,0,0,fw,fh); - c.clearRect(fx,fy,fw,fh); - tag.alpha = 1; - tag.Draw(c,x1,y1); - c.setTransform(1,0,0,1,0,0); - c.save(); - c.beginPath(); - c.rect(fx,fy,fw,fh); - c.clip(); - c.globalCompositeOperation = 'source-in'; - c.fillStyle = colour; - c.fillRect(fx,fy,fw,fh); - c.restore(); - c.globalCompositeOperation = 'destination-over'; - c.drawImage(ocanvas,0,0,fw,fh,fx,fy,fw,fh); - c.globalCompositeOperation = 'source-over'; - return 1; -}; -Oproto.DrawBlock = function(c,x,y,w,h,colour) { - c.fillStyle = colour; - RRect(c, x, y, w, h, this.radius); -}; -Oproto.DrawSimple = function(c, tag, x1, y1) { - var t = this.tc; - c.setTransform(1,0,0,1,0,0); - c.strokeStyle = t.outlineColour; - c.lineWidth = t.outlineThickness; - c.shadowBlur = c.shadowOffsetX = c.shadowOffsetY = 0; - c.globalAlpha = 1; - return this.drawFunc(c,this.x,this.y,this.w,this.h,t.outlineColour,tag,x1,y1); -}; -Oproto.DrawPulsate = function(c, tag, x1, y1) { - var diff = TimeNow() - this.ts, t = this.tc; - c.setTransform(1,0,0,1,0,0); - c.strokeStyle = t.outlineColour; - c.lineWidth = t.outlineThickness; - c.shadowBlur = c.shadowOffsetX = c.shadowOffsetY = 0; - c.globalAlpha = t.pulsateTo + ((1 - t.pulsateTo) * - (0.5 + (cos(2 * Math.PI * diff / (1000 * t.pulsateTime)) / 2))); - return this.drawFunc(c,this.x,this.y,this.w,this.h,t.outlineColour,tag,x1,y1); -}; -Oproto.Active = function(c,x,y) { - return (x >= this.x && y >= this.y && - x <= this.x + this.w && y <= this.y + this.h); -}; -Oproto.PreDraw = Oproto.PostDraw = Oproto.LastDraw = Nop; -/** - * @constructor - */ -function Tag(tc, text, a, v, w, h, col, bcol, bradius, boutline, bothickness, - font, padding, original) { - this.tc = tc; - this.image = null; - this.text = text; - this.text_original = original; - this.line_widths = []; - this.title = a.title || null; - this.a = a; - this.position = new Vector(v[0], v[1], v[2]); - this.x = this.y = this.z = 0; - this.w = w; - this.h = h; - this.colour = col || tc.textColour; - this.bgColour = bcol || tc.bgColour; - this.bgRadius = bradius | 0; - this.bgOutline = boutline || this.colour; - this.bgOutlineThickness = bothickness | 0; - this.textFont = font || tc.textFont; - this.padding = padding | 0; - this.sc = this.alpha = 1; - this.weighted = !tc.weight; -} -Tproto = Tag.prototype; -Tproto.Init = function(e) { - var tc = this.tc; - this.outline = new Outline(tc,this); - this.textHeight = tc.textHeight; - if(this.HasText()) { - this.Measure(tc.ctxt,tc); - } else { - this.w = this.iw; - this.h = this.ih; - } - - this.SetShadowColour = tc.shadowAlpha ? this.SetShadowColourAlpha : this.SetShadowColourFixed; - this.SetDraw(tc); -}; -Tproto.Draw = Nop; -Tproto.HasText = function() { - return this.text && this.text[0].length > 0; -}; -Tproto.EqualTo = function(e) { - var i = e.getElementsByTagName('img'); - if(this.a.href != e.href) - return 0; - if(i.length) - return this.image.src == i[0].src; - return (e.innerText || e.textContent) == this.text_original; -}; -Tproto.SetImage = function(i) { - this.image = this.fimage = i; -}; -Tproto.SetDraw = function(t) { - this.Draw = this.fimage ? (t.ie > 7 ? this.DrawImageIE : this.DrawImage) : this.DrawText; - t.noSelect && (this.CheckActive = Nop); -}; -Tproto.MeasureText = function(c) { - var i, l = this.text.length, w = 0, wl; - for(i = 0; i < l; ++i) { - this.line_widths[i] = wl = c.measureText(this.text[i]).width; - w = max(w, wl); - } - return w; -}; -Tproto.Measure = function(c,t) { - var extents = FindTextBoundingBox(this.text, this.textFont, this.textHeight), - s, th, f, soff, cw, twidth, theight, img, tcv; - // add the gap at the top to the height to make equal gap at bottom - theight = extents ? extents.max.y + extents.min.y : this.textHeight; - c.font = this.font = this.textHeight + 'px ' + this.textFont; - twidth = this.MeasureText(c); - if(t.txtOpt) { - s = t.txtScale; - th = s * this.textHeight; - f = th + 'px ' + this.textFont; - soff = [s * t.shadowOffset[0], s * t.shadowOffset[1]]; - c.font = f; - cw = this.MeasureText(c); - tcv = new TextCanvas(this.text, f, cw + s, (s * theight) + s, cw, - this.line_widths, t.textAlign, t.textVAlign, s); - - if(this.image) - tcv.SetImage(this.image, this.iw, this.ih, t.imagePosition, t.imagePadding, - t.imageAlign, t.imageVAlign, t.imageScale); - - img = tcv.Create(this.colour, this.bgColour, this.bgOutline, - s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, - s * this.padding, s * this.bgRadius); - - // add outline image using highlight colour - if(t.outlineMethod == 'colour') { - this.oimage = tcv.Create(t.outlineColour, this.bgColour, t.outlineColour, - s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, - s * this.padding, s * this.bgRadius); - - } else if(t.outlineMethod == 'size') { - extents = FindTextBoundingBox(this.text, this.textFont, - this.textHeight + t.outlineIncrease); - th = extents.max.y + extents.min.y; - f = (s * (this.textHeight + t.outlineIncrease)) + 'px ' + this.textFont; - c.font = f; - cw = this.MeasureText(c); - - tcv = new TextCanvas(this.text, f, cw + s, (s * th) + s, cw, - this.line_widths, t.textAlign, t.textVAlign, s); - if(this.image) - tcv.SetImage(this.image, this.iw + t.outlineIncrease, - this.ih + t.outlineIncrease, t.imagePosition, t.imagePadding, - t.imageAlign, t.imageVAlign, t.imageScale); - - this.oimage = tcv.Create(this.colour, this.bgColour, this.bgOutline, - s * this.bgOutlineThickness, t.shadow, s * t.shadowBlur, soff, - s * this.padding, s * this.bgRadius); - - if(t.outlineIncrease > 0) - img = ExpandImage(img, this.oimage.width, this.oimage.height); - else - this.oimage = ExpandImage(this.oimage, img.width, img.height); - } - if(img) { - this.fimage = img; - twidth = this.fimage.width / s; - theight = this.fimage.height / s; - } - this.SetDraw(t); - t.txtOpt = !!this.fimage; - } - this.h = theight; - this.w = twidth; -}; -Tproto.SetFont = function(f, c, bc, boc) { - this.textFont = f; - this.colour = c; - this.bgColour = bc; - this.bgOutline = boc; - this.Measure(this.tc.ctxt, this.tc); -}; -Tproto.SetWeight = function(w) { - var tc = this.tc, modes = tc.weightMode.split(/[, ]/), m, s, wl = w.length; - if(!this.HasText()) - return; - this.weighted = true; - for(s = 0; s < wl; ++s) { - m = modes[s] || 'size'; - if('both' == m) { - this.Weight(w[s], tc.ctxt, tc, 'size', tc.min_weight[s], - tc.max_weight[s], s); - this.Weight(w[s], tc.ctxt, tc, 'colour', tc.min_weight[s], - tc.max_weight[s], s); - } else { - this.Weight(w[s], tc.ctxt, tc, m, tc.min_weight[s], tc.max_weight[s], s); - } - } - this.Measure(tc.ctxt, tc); -}; -Tproto.Weight = function(w, c, t, m, wmin, wmax, wnum) { - w = isNaN(w) ? 1 : w; - var nweight = (w - wmin) / (wmax - wmin); - if('colour' == m) - this.colour = FindGradientColour(t, nweight, wnum); - else if('bgcolour' == m) - this.bgColour = FindGradientColour(t, nweight, wnum); - else if('bgoutline' == m) - this.bgOutline = FindGradientColour(t, nweight, wnum); - else if('size' == m) { - if(t.weightSizeMin > 0 && t.weightSizeMax > t.weightSizeMin) { - this.textHeight = t.weightSize * - (t.weightSizeMin + (t.weightSizeMax - t.weightSizeMin) * nweight); - } else { - // min textHeight of 1 - this.textHeight = max(1, w * t.weightSize); - } - } -}; -Tproto.SetShadowColourFixed = function(c,s,a) { - c.shadowColor = s; -}; -Tproto.SetShadowColourAlpha = function(c,s,a) { - c.shadowColor = SetAlpha(s, a); -}; -Tproto.DrawText = function(c,xoff,yoff) { - var t = this.tc, x = this.x, y = this.y, s = this.sc, i, xl; - c.globalAlpha = this.alpha; - c.fillStyle = this.colour; - t.shadow && this.SetShadowColour(c,t.shadow,this.alpha); - c.font = this.font; - x += xoff / s; - y += (yoff / s) - (this.h / 2); - for(i = 0; i < this.text.length; ++i) { - xl = x; - if('right' == t.textAlign) { - xl += this.w / 2 - this.line_widths[i]; - } else if('centre' == t.textAlign) { - xl -= this.line_widths[i] / 2; - } else { - xl -= this.w / 2; - } - c.setTransform(s, 0, 0, s, s * xl, s * y); - c.fillText(this.text[i], 0, 0); - y += this.textHeight; - } -}; -Tproto.DrawImage = function(c,xoff,yoff,im) { - var x = this.x, y = this.y, s = this.sc, - i = im || this.fimage, w = this.w, h = this.h, a = this.alpha, - shadow = this.shadow; - c.globalAlpha = a; - shadow && this.SetShadowColour(c,shadow,a); - x += (xoff / s) - (w / 2); - y += (yoff / s) - (h / 2); - c.setTransform(s, 0, 0, s, s * x, s * y); - c.drawImage(i, 0, 0, w, h); -}; -Tproto.DrawImageIE = function(c,xoff,yoff) { - var i = this.fimage, s = this.sc, - w = i.width = this.w*s, h = i.height = this.h * s, - x = (this.x*s) + xoff - (w/2), y = (this.y*s) + yoff - (h/2); - c.setTransform(1,0,0,1,0,0); - c.globalAlpha = this.alpha; - c.drawImage(i, x, y); -}; -Tproto.Calc = function(m,a) { - var pp, t = this.tc, mnb = t.minBrightness, - mxb = t.maxBrightness, r = t.max_radius; - pp = m.xform(this.position); - this.xformed = pp; - pp = Project(t, pp, t.stretchX, t.stretchY); - this.x = pp.x; - this.y = pp.y; - this.z = pp.z; - this.sc = pp.w; - this.alpha = a * Clamp(mnb + (mxb - mnb) * (r - this.z) / (2 * r), 0, 1); -}; -Tproto.UpdateActive = function(c, xoff, yoff) { - var o = this.outline, w = this.w, h = this.h, - x = this.x - w/2, y = this.y - h/2; - o.Update(x, y, w, h, this.sc, this.z, xoff, yoff); - return o; -}; -Tproto.CheckActive = function(c,xoff,yoff) { - var t = this.tc, o = this.UpdateActive(c, xoff, yoff); - return o.Active(c, t.mx, t.my) ? o : null; -}; -Tproto.Clicked = function(e) { - var a = this.a, t = a.target, h = a.href, evt; - if(t != '' && t != '_self') { - if(self.frames[t]) { - self.frames[t].document.location = h; - } else{ - try { - if(top.frames[t]) { - top.frames[t].document.location = h; - return; - } - } catch(err) { - // different domain/port/protocol? - } - window.open(h, t); - } - return; - } - if(doc.createEvent) { - evt = doc.createEvent('MouseEvents'); - evt.initMouseEvent('click', 1, 1, window, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, null); - if(!a.dispatchEvent(evt)) - return; - } else if(a.fireEvent) { - if(!a.fireEvent('onclick')) - return; - } - doc.location = h; -}; -/** - * @constructor - */ -function TagCanvas(cid,lctr,opt) { - var i, p, c = doc.getElementById(cid), cp = ['id','class','innerHTML'], raf; - - if(!c) throw 0; - if(Defined(window.G_vmlCanvasManager)) { - c = window.G_vmlCanvasManager.initElement(c); - this.ie = parseFloat(navigator.appVersion.split('MSIE')[1]); - } - if(c && (!c.getContext || !c.getContext('2d').fillText)) { - p = doc.createElement('DIV'); - for(i = 0; i < cp.length; ++i) - p[cp[i]] = c[cp[i]]; - c.parentNode.insertBefore(p,c); - c.parentNode.removeChild(c); - throw 0; - } - for(i in TagCanvas.options) - this[i] = opt && Defined(opt[i]) ? opt[i] : - (Defined(TagCanvas[i]) ? TagCanvas[i] : TagCanvas.options[i]); - - this.canvas = c; - this.ctxt = c.getContext('2d'); - this.z1 = 250 / max(this.depth, 0.001); - this.z2 = this.z1 / this.zoom; - this.radius = min(c.height, c.width) * 0.0075; // fits radius of 100 in canvas - this.max_radius = 100; - this.max_weight = []; - this.min_weight = []; - this.textFont = this.textFont && FixFont(this.textFont); - this.textHeight *= 1; - this.pulsateTo = Clamp(this.pulsateTo, 0, 1); - this.minBrightness = Clamp(this.minBrightness, 0, 1); - this.maxBrightness = Clamp(this.maxBrightness, this.minBrightness, 1); - this.ctxt.textBaseline = 'top'; - this.lx = (this.lock + '').indexOf('x') + 1; - this.ly = (this.lock + '').indexOf('y') + 1; - this.frozen = this.dx = this.dy = this.fixedAnim = this.touchState = 0; - this.fixedAlpha = 1; - this.source = lctr || cid; - this.repeatTags = min(64, ~~this.repeatTags); - this.minTags = min(200, ~~this.minTags); - if(this.minTags > 0 && this.repeatTags < 1 && (i = this.GetTags().length)) - this.repeatTags = ceil(this.minTags / i) - 1; - this.transform = Matrix.Identity(); - this.startTime = this.time = TimeNow(); - this.mx = this.my = -1; - this.centreImage && CentreImage(this); - this.Animate = this.dragControl ? this.AnimateDrag : this.AnimatePosition; - this.animTiming = (typeof TagCanvas[this.animTiming] == 'function' ? - TagCanvas[this.animTiming] : TagCanvas.Smooth); - if(this.shadowBlur || this.shadowOffset[0] || this.shadowOffset[1]) { - // let the browser translate "red" into "#ff0000" - this.ctxt.shadowColor = this.shadow; - this.shadow = this.ctxt.shadowColor; - this.shadowAlpha = ShadowAlphaBroken(); - } else { - delete this.shadow; - } - this.Load(); - if(lctr && this.hideTags) { - (function(t) { - if(TagCanvas.loaded) - t.HideTags(); - else - AddHandler('load', function() { t.HideTags(); }, window); - })(this); - } - - this.yaw = this.initial ? this.initial[0] * this.maxSpeed : 0; - this.pitch = this.initial ? this.initial[1] * this.maxSpeed : 0; - if(this.tooltip) { - this.ctitle = c.title; - c.title = ''; - if(this.tooltip == 'native') { - this.Tooltip = this.TooltipNative; - } else { - this.Tooltip = this.TooltipDiv; - if(!this.ttdiv) { - this.ttdiv = doc.createElement('div'); - this.ttdiv.className = this.tooltipClass; - this.ttdiv.style.position = 'absolute'; - this.ttdiv.style.zIndex = c.style.zIndex + 1; - AddHandler('mouseover',function(e){e.target.style.display='none';},this.ttdiv); - doc.body.appendChild(this.ttdiv); - } - } - } else { - this.Tooltip = this.TooltipNone; - } - if(!this.noMouse && !handlers[cid]) { - handlers[cid] = [ - ['mousemove', MouseMove], - ['mouseout', MouseOut], - ['mouseup', MouseUp], - ['touchstart', TouchDown], - ['touchend', TouchUp], - ['touchcancel', TouchUp], - ['touchmove', TouchMove] - ]; - if(this.dragControl) { - handlers[cid].push(['mousedown', MouseDown]); - handlers[cid].push(['selectstart', Nop]); - } - if(this.wheelZoom) { - handlers[cid].push(['mousewheel', MouseWheel]); - handlers[cid].push(['DOMMouseScroll', MouseWheel]); - } - for(i = 0; i < handlers[cid].length; ++i) - AddHandler(handlers[cid][i][0], handlers[cid][i][1], c); - } - if(!TagCanvas.started) { - raf = window.requestAnimationFrame = window.requestAnimationFrame || - window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || - window.msRequestAnimationFrame; - TagCanvas.NextFrame = raf ? TagCanvas.NextFrameRAF : - TagCanvas.NextFrameTimeout; - TagCanvas.interval = this.interval; - TagCanvas.NextFrame(this.interval); - TagCanvas.started = 1; - } -} -TCproto = TagCanvas.prototype; -TCproto.SourceElements = function() { - if(doc.querySelectorAll) - return doc.querySelectorAll('#' + this.source); - return [doc.getElementById(this.source)]; -}; -TCproto.HideTags = function() { - var el = this.SourceElements(), i; - for(i = 0; i < el.length; ++i) - el[i].style.display = 'none'; -}; -TCproto.GetTags = function() { - var el = this.SourceElements(), etl, tl = [], i, j, k; - for(k = 0; k <= this.repeatTags; ++k) { - for(i = 0; i < el.length; ++i) { - etl = el[i].getElementsByTagName('a'); - for(j = 0; j < etl.length; ++j) { - tl.push(etl[j]); - } - } - } - return tl; -}; -TCproto.Message = function(text) { - var tl = [], i, p, tc = text.split(''), a, t, x, z; - for(i = 0; i < tc.length; ++i) { - if(tc[i] != ' ') { - p = i - tc.length / 2; - a = doc.createElement('A'); - a.href = '#'; - a.innerText = tc[i]; - x = 100 * sin(p / 9); - z = -100 * cos(p / 9); - t = new Tag(this, tc[i], a, [x,0,z], 2, 18, '#000', '#fff', 0, 0, 0, - 'monospace', 2, tc[i]); - t.Init(); - tl.push(t); - } - } - return tl; -}; -TCproto.CreateTag = function(e) { - var im, i, t, txt, ts, font, bc, boc, p = [0, 0, 0]; - if('text' != this.imageMode) { - im = e.getElementsByTagName('img'); - if(im.length) { - i = new Image; - i.src = im[0].src; - - if(!this.imageMode) { - t = new Tag(this, "", e, p, 0, 0); - t.SetImage(i); - //t.Init(); - AddImage(i, im[0], t, this); - return t; - } - } - } - if('image' != this.imageMode) { - ts = new TextSplitter(e); - txt = ts.Lines(); - if(!ts.Empty()) { - font = this.textFont || FixFont(GetProperty(e,'font-family')); - if(this.splitWidth) - txt = ts.SplitWidth(this.splitWidth, this.ctxt, font, this.textHeight); - - bc = this.bgColour == 'tag' ? GetProperty(e, 'background-color') : - this.bgColour; - boc = this.bgOutline == 'tag' ? GetProperty(e, 'color') : this.bgOutline; - } else { - ts = null; - } - } - if(ts || i) { - t = new Tag(this, txt, e, p, 2, this.textHeight + 2, - this.textColour || GetProperty(e,'color'), bc, this.bgRadius, - boc, this.bgOutlineThickness, font, this.padding, ts && ts.original); - if(i) { - t.SetImage(i); - AddImage(i, im[0], t, this); - } else { - t.Init(); - } - return t; - } -}; -TCproto.UpdateTag = function(t, a) { - var colour = this.textColour || GetProperty(a, 'color'), - font = this.textFont || FixFont(GetProperty(a, 'font-family')), - bc = this.bgColour == 'tag' ? GetProperty(a, 'background-color') : - this.bgColour, boc = this.bgOutline == 'tag' ? GetProperty(a, 'color') : - this.bgOutline; - t.a = a; - t.title = a.title; - if(t.colour != colour || t.textFont != font || t.bgColour != bc || - t.bgOutline != boc) - t.SetFont(font, colour, bc, boc); -}; -TCproto.Weight = function(tl) { - var ll = tl.length, w, i, s, weights = [], valid, - wfrom = this.weightFrom ? this.weightFrom.split(/[, ]/) : [null], - wl = wfrom.length; - for(i = 0; i < ll; ++i) { - weights[i] = []; - for(s = 0; s < wl; ++s) { - w = FindWeight(tl[i].a, wfrom[s], this.textHeight); - if(!this.max_weight[s] || w > this.max_weight[s]) - this.max_weight[s] = w; - if(!this.min_weight[s] || w < this.min_weight[s]) - this.min_weight[s] = w; - weights[i][s] = w; - } - } - for(s = 0; s < wl; ++s) { - if(this.max_weight[s] > this.min_weight[s]) - valid = 1; - } - if(valid) { - for(i = 0; i < ll; ++i) { - tl[i].SetWeight(weights[i]); - } - } -}; -TCproto.Load = function() { - var tl = this.GetTags(), taglist = [], shape, t, - shapeArgs, rx, ry, rz, vl, i, tagmap = [], pfuncs = { - sphere: PointsOnSphere, - vcylinder: PointsOnCylinderV, - hcylinder: PointsOnCylinderH, - vring: PointsOnRingV, - hring: PointsOnRingH - }; - - if(tl.length) { - tagmap.length = tl.length; - for(i = 0; i < tl.length; ++i) - tagmap[i] = i; - this.shuffleTags && Shuffle(tagmap); - rx = 100 * this.radiusX; - ry = 100 * this.radiusY; - rz = 100 * this.radiusZ; - this.max_radius = max(rx, max(ry, rz)); - - for(i = 0; i < tl.length; ++i) { - t = this.CreateTag(tl[tagmap[i]]); - if(t) - taglist.push(t); - } - this.weight && this.Weight(taglist, true); - - if(this.shapeArgs) { - this.shapeArgs[0] = taglist.length; - } else { - shapeArgs = this.shape.toString().split(/[(),]/); - shape = shapeArgs.shift(); - if(typeof window[shape] === 'function') - this.shape = window[shape]; - else - this.shape = pfuncs[shape] || pfuncs.sphere; - this.shapeArgs = [taglist.length, rx, ry, rz].concat(shapeArgs); - } - vl = this.shape.apply(this, this.shapeArgs); - this.listLength = taglist.length; - for(i = 0; i < taglist.length; ++i) - taglist[i].position = new Vector(vl[i][0], vl[i][1], vl[i][2]); - } - if(this.noTagsMessage && !taglist.length) - taglist = this.Message('No tags'); - this.taglist = taglist; -}; -TCproto.Update = function() { - var tl = this.GetTags(), newlist = [], - taglist = this.taglist, found, - added = [], removed = [], vl, ol, nl, i, j; - - if(!this.shapeArgs) - return this.Load(); - - if(tl.length) { - nl = this.listLength = tl.length; - ol = taglist.length; - - // copy existing list, populate "removed" - for(i = 0; i < ol; ++i) { - newlist.push(taglist[i]); - removed.push(i); - } - - // find added and removed tags - for(i = 0; i < nl; ++i) { - for(j = 0, found = 0; j < ol; ++j) { - if(taglist[j].EqualTo(tl[i])) { - this.UpdateTag(newlist[j], tl[i]); - found = removed[j] = -1; - } - } - if(!found) - added.push(i); - } - - // clean out found tags from removed list - for(i = 0, j = 0; i < ol; ++i) { - if(removed[j] == -1) - removed.splice(j,1); - else - ++j; - } - - // insert new tags in gaps where old tags removed - if(removed.length) { - Shuffle(removed); - while(removed.length && added.length) { - i = removed.shift(); - j = added.shift(); - newlist[i] = this.CreateTag(tl[j]); - } - - // remove any more (in reverse order) - removed.sort(function(a,b) {return a-b}); - while(removed.length) { - newlist.splice(removed.pop(), 1); - } - } - - // add any extra tags - j = newlist.length / (added.length + 1); - i = 0; - while(added.length) { - newlist.splice(ceil(++i * j), 0, this.CreateTag(tl[added.shift()])); - } - - // assign correct positions to tags - this.shapeArgs[0] = nl = newlist.length; - vl = this.shape.apply(this, this.shapeArgs); - for(i = 0; i < nl; ++i) - newlist[i].position = new Vector(vl[i][0], vl[i][1], vl[i][2]); - - // reweight tags - this.weight && this.Weight(newlist); - } - this.taglist = newlist; -}; -TCproto.SetShadow = function(c) { - c.shadowBlur = this.shadowBlur; - c.shadowOffsetX = this.shadowOffset[0]; - c.shadowOffsetY = this.shadowOffset[1]; -}; -TCproto.Draw = function(t) { - if(this.paused) - return; - var cv = this.canvas, cw = cv.width, ch = cv.height, max_sc = 0, - tdelta = (t - this.time) * TagCanvas.interval / 1000, - x = cw / 2 + this.offsetX, y = ch / 2 + this.offsetY, c = this.ctxt, - active, a, i, aindex = -1, tl = this.taglist, l = tl.length, - frontsel = this.frontSelect, centreDrawn = (this.centreFunc == Nop), fixed; - this.time = t; - if(this.frozen && this.drawn) - return this.Animate(cw,ch,tdelta); - fixed = this.AnimateFixed(); - c.setTransform(1,0,0,1,0,0); - for(i = 0; i < l; ++i) - tl[i].Calc(this.transform, this.fixedAlpha); - tl = SortList(tl, function(a,b) {return b.z-a.z}); - - if(fixed && this.fixedAnim.active) { - active = this.fixedAnim.tag.UpdateActive(c, x, y); - } else { - this.active = null; - for(i = 0; i < l; ++i) { - a = this.mx >= 0 && this.my >= 0 && this.taglist[i].CheckActive(c, x, y); - if(a && a.sc > max_sc && (!frontsel || a.z <= 0)) { - active = a; - aindex = i; - active.tag = this.taglist[i]; - max_sc = a.sc; - } - } - this.active = active; - } - - this.txtOpt || (this.shadow && this.SetShadow(c)); - c.clearRect(0,0,cw,ch); - for(i = 0; i < l; ++i) { - if(!centreDrawn && tl[i].z <= 0) { - // run the centreFunc if the next tag is at the front - try { this.centreFunc(c, cw, ch, x, y); } - catch(e) { - alert(e); - // don't run it again - this.centreFunc = Nop; - } - centreDrawn = true; - } - - if(!(active && active.tag == tl[i] && active.PreDraw(c, tl[i], x, y))) - tl[i].Draw(c, x, y); - active && active.tag == tl[i] && active.PostDraw(c); - } - if(this.freezeActive && active) { - this.Freeze(); - } else { - this.UnFreeze(); - this.drawn = (l == this.listLength); - } - if(this.fixedCallback) { - this.fixedCallback(this,this.fixedCallbackTag); - this.fixedCallback = null; - } - fixed || this.Animate(cw, ch, tdelta); - active && active.LastDraw(c); - cv.style.cursor = active ? this.activeCursor : ''; - this.Tooltip(active,this.taglist[aindex]); -}; -TCproto.TooltipNone = function() { }; -TCproto.TooltipNative = function(active,tag) { - if(active) - this.canvas.title = tag && tag.title ? tag.title : ''; - else - this.canvas.title = this.ctitle; -}; -TCproto.SetTTDiv = function(title, tag) { - var tc = this, s = tc.ttdiv.style; - if(title != tc.ttdiv.innerHTML) - s.display = 'none'; - tc.ttdiv.innerHTML = title; - tag && (tag.title = tc.ttdiv.innerHTML); - if(s.display == 'none' && ! tc.tttimer) { - tc.tttimer = setTimeout(function() { - var p = AbsPos(tc.canvas.id); - s.display = 'block'; - s.left = p.x + tc.mx + 'px'; - s.top = p.y + tc.my + 24 + 'px'; - tc.tttimer = null; - }, tc.tooltipDelay); - } -}; -TCproto.TooltipDiv = function(active,tag) { - if(active && tag && tag.title) { - this.SetTTDiv(tag.title, tag); - } else if(!active && this.mx != -1 && this.my != -1 && this.ctitle.length) { - this.SetTTDiv(this.ctitle); - } else { - this.ttdiv.style.display = 'none'; - } -}; -TCproto.Transform = function(tc, p, y) { - if(p || y) { - var sp = sin(p), cp = cos(p), sy = sin(y), cy = cos(y), - ym = new Matrix([cy,0,sy, 0,1,0, -sy,0,cy]), - pm = new Matrix([1,0,0, 0,cp,-sp, 0,sp,cp]); - tc.transform = tc.transform.mul(ym.mul(pm)); - } -}; -TCproto.AnimateFixed = function() { - var fa, t1, angle, m, d; - if(this.fadeIn) { - t1 = TimeNow() - this.startTime; - if(t1 >= this.fadeIn) { - this.fadeIn = 0; - this.fixedAlpha = 1; - } else { - this.fixedAlpha = t1 / this.fadeIn; - } - } - if(this.fixedAnim) { - if(!this.fixedAnim.transform) - this.fixedAnim.transform = this.transform; - fa = this.fixedAnim, t1 = TimeNow() - fa.t0, angle = fa.angle, - m, d = this.animTiming(fa.t, t1); - this.transform = fa.transform; - if(t1 >= fa.t) { - this.fixedCallbackTag = fa.tag; - this.fixedCallback = fa.cb; - this.fixedAnim = this.yaw = this.pitch = 0; - } else { - angle *= d; - } - m = Matrix.Rotation(angle, fa.axis); - this.transform = this.transform.mul(m); - return (this.fixedAnim != 0); - } - return false; -}; -TCproto.AnimatePosition = function(w, h, t) { - var tc = this, x = tc.mx, y = tc.my, s, r; - if(!tc.frozen && x >= 0 && y >= 0 && x < w && y < h) { - s = tc.maxSpeed, r = tc.reverse ? -1 : 1; - tc.lx || (tc.yaw = ((x * 2 * s / w) - s) * r * t); - tc.ly || (tc.pitch = ((y * 2 * s / h) - s) * -r * t); - tc.initial = null; - } else if(!tc.initial) { - if(tc.frozen && !tc.freezeDecel) - tc.yaw = tc.pitch = 0; - else - tc.Decel(tc); - } - this.Transform(tc, tc.pitch, tc.yaw); -}; -TCproto.AnimateDrag = function(w, h, t) { - var tc = this, rs = 100 * t * tc.maxSpeed / tc.max_radius / tc.zoom; - if(tc.dx || tc.dy) { - tc.lx || (tc.yaw = tc.dx * rs / tc.stretchX); - tc.ly || (tc.pitch = tc.dy * -rs / tc.stretchY); - tc.dx = tc.dy = 0; - tc.initial = null; - } else if(!tc.initial) { - tc.Decel(tc); - } - this.Transform(tc, tc.pitch, tc.yaw); -}; -TCproto.Freeze = function() { - if(!this.frozen) { - this.preFreeze = [this.yaw, this.pitch]; - this.frozen = 1; - this.drawn = 0; - } -}; -TCproto.UnFreeze = function() { - if(this.frozen) { - this.yaw = this.preFreeze[0]; - this.pitch = this.preFreeze[1]; - this.frozen = 0; - } -}; -TCproto.Decel = function(tc) { - var s = tc.minSpeed, ay = abs(tc.yaw), ap = abs(tc.pitch); - if(!tc.lx && ay > s) - tc.yaw = ay > tc.z0 ? tc.yaw * tc.decel : 0; - if(!tc.ly && ap > s) - tc.pitch = ap > tc.z0 ? tc.pitch * tc.decel : 0; -}; -TCproto.Zoom = function(r) { - this.z2 = this.z1 * (1/r); - this.drawn = 0; -}; -TCproto.Clicked = function(e) { - var a = this.active; - try { - if(a && a.tag) - if(this.clickToFront === false || this.clickToFront === null) - a.tag.Clicked(e); - else - this.TagToFront(a.tag, this.clickToFront, function() { - a.tag.Clicked(e); - }, true); - } catch(ex) { - } -}; -TCproto.Wheel = function(i) { - var z = this.zoom + this.zoomStep * (i ? 1 : -1); - this.zoom = min(this.zoomMax,max(this.zoomMin,z)); - this.Zoom(this.zoom); -}; -TCproto.BeginDrag = function(e) { - this.down = EventXY(e, this.canvas); - e.cancelBubble = true; - e.returnValue = false; - e.preventDefault && e.preventDefault(); -}; -TCproto.Drag = function(e, p) { - if(this.dragControl && this.down) { - var t2 = this.dragThreshold * this.dragThreshold, - dx = p.x - this.down.x, dy = p.y - this.down.y; - if(this.dragging || dx * dx + dy * dy > t2) { - this.dx = dx; - this.dy = dy; - this.dragging = 1; - this.down = p; - } - } - return this.dragging; -}; -TCproto.EndDrag = function() { - var res = this.dragging; - this.dragging = this.down = null; - return res; -}; -function PinchDistance(e) { - var t1 = e.targetTouches[0], t2 = e.targetTouches[1]; - return sqrt(pow(t2.pageX - t1.pageX, 2) + pow(t2.pageY - t1.pageY, 2)); -} -TCproto.BeginPinch = function(e) { - this.pinched = [PinchDistance(e), this.zoom]; - e.preventDefault && e.preventDefault(); -}; -TCproto.Pinch = function(e) { - var z, d, p = this.pinched; - if(!p) - return; - d = PinchDistance(e); - z = p[1] * d / p[0]; - this.zoom = min(this.zoomMax,max(this.zoomMin,z)); - this.Zoom(this.zoom); -}; -TCproto.EndPinch = function(e) { - this.pinched = null; -}; -TCproto.Pause = function() { this.paused = true; }; -TCproto.Resume = function() { this.paused = false; }; -TCproto.SetSpeed = function(i) { - this.initial = i; - this.yaw = i[0] * this.maxSpeed; - this.pitch = i[1] * this.maxSpeed; -}; -TCproto.FindTag = function(t) { - if(!Defined(t)) - return null; - Defined(t.index) && (t = t.index); - if(!IsObject(t)) - return this.taglist[t]; - var srch, tgt, i; - if(Defined(t.id)) - srch = 'id', tgt = t.id; - else if(Defined(t.text)) - srch = 'innerText', tgt = t.text; - - for(i = 0; i < this.taglist.length; ++i) - if(this.taglist[i].a[srch] == tgt) - return this.taglist[i]; -}; -TCproto.RotateTag = function(tag, lt, lg, time, callback, active) { - var t = tag.xformed, v1 = new Vector(t.x, t.y, t.z), - v2 = MakeVector(lg, lt), angle = v1.angle(v2), u = v1.cross(v2).unit(); - if(angle == 0) { - this.fixedCallbackTag = tag; - this.fixedCallback = callback; - } else { - this.fixedAnim = { - angle: -angle, - axis: u, - t: time, - t0: TimeNow(), - cb: callback, - tag: tag, - active: active - }; - } -}; -TCproto.TagToFront = function(tag, time, callback, active) { - this.RotateTag(tag, 0, 0, time, callback, active); -}; -TagCanvas.Start = function(id,l,o) { - TagCanvas.Delete(id); - TagCanvas.tc[id] = new TagCanvas(id,l,o); -}; -function tccall(f,id) { - TagCanvas.tc[id] && TagCanvas.tc[id][f](); -} -TagCanvas.Linear = function(t, t0) { return t0 / t; } -TagCanvas.Smooth = function(t, t0) { return 0.5 - cos(t0 * Math.PI / t) / 2; } -TagCanvas.Pause = function(id) { tccall('Pause',id); }; -TagCanvas.Resume = function(id) { tccall('Resume',id); }; -TagCanvas.Reload = function(id) { tccall('Load',id); }; -TagCanvas.Update = function(id) { tccall('Update',id); }; -TagCanvas.SetSpeed = function(id, speed) { - if(IsObject(speed) && TagCanvas.tc[id] && - !isNaN(speed[0]) && !isNaN(speed[1])) { - TagCanvas.tc[id].SetSpeed(speed); - return true; - } - return false; -}; -TagCanvas.TagToFront = function(id, options) { - if(!IsObject(options)) - return false; - options.lat = options.lng = 0; - return TagCanvas.RotateTag(id, options); -}; -TagCanvas.RotateTag = function(id, options) { - if(IsObject(options) && TagCanvas.tc[id]) { - if(isNaN(options.time)) - options.time = 500; - var tt = TagCanvas.tc[id].FindTag(options); - if(tt) { - TagCanvas.tc[id].RotateTag(tt, options.lat, options.lng, - options.time, options.callback, options.active); - return true; - } - } - return false; -}; -TagCanvas.Delete = function(id) { - var i, c; - if(handlers[id]) { - c = doc.getElementById(id); - if(c) { - for(i = 0; i < handlers[id].length; ++i) - RemoveHandler(handlers[id][i][0], handlers[id][i][1], c); - } - } - delete handlers[id]; - delete TagCanvas.tc[id]; -}; -TagCanvas.NextFrameRAF = function() { - requestAnimationFrame(DrawCanvasRAF); -}; -TagCanvas.NextFrameTimeout = function(iv) { - setTimeout(DrawCanvas, iv); -}; -TagCanvas.tc = {}; -TagCanvas.options = { -z1: 20000, -z2: 20000, -z0: 0.0002, -freezeActive: false, -freezeDecel: false, -activeCursor: 'pointer', -pulsateTo: 1, -pulsateTime: 3, -reverse: false, -depth: 0.5, -maxSpeed: 0.05, -minSpeed: 0, -decel: 0.95, -interval: 20, -minBrightness: 0.1, -maxBrightness: 1, -outlineColour: '#ffff99', -outlineThickness: 2, -outlineOffset: 5, -outlineMethod: 'outline', -outlineRadius: 0, -textColour: '#ff99ff', -textHeight: 15, -textFont: 'Helvetica, Arial, sans-serif', -shadow: '#000', -shadowBlur: 0, -shadowOffset: [0,0], -initial: null, -hideTags: true, -zoom: 1, -weight: false, -weightMode: 'size', -weightFrom: null, -weightSize: 1, -weightSizeMin: null, -weightSizeMax: null, -weightGradient: {0:'#f00', 0.33:'#ff0', 0.66:'#0f0', 1:'#00f'}, -txtOpt: true, -txtScale: 2, -frontSelect: false, -wheelZoom: true, -zoomMin: 0.3, -zoomMax: 3, -zoomStep: 0.05, -shape: 'sphere', -lock: null, -tooltip: null, -tooltipDelay: 300, -tooltipClass: 'tctooltip', -radiusX: 1, -radiusY: 1, -radiusZ: 1, -stretchX: 1, -stretchY: 1, -offsetX: 0, -offsetY: 0, -shuffleTags: false, -noSelect: false, -noMouse: false, -imageScale: 1, -paused: false, -dragControl: false, -dragThreshold: 4, -centreFunc: Nop, -splitWidth: 0, -animTiming: 'Smooth', -clickToFront: false, -fadeIn: 0, -padding: 0, -bgColour: null, -bgRadius: 0, -bgOutline: null, -bgOutlineThickness: 0, -outlineIncrease: 4, -textAlign: 'centre', -textVAlign: 'middle', -imageMode: null, -imagePosition: null, -imagePadding: 2, -imageAlign: 'centre', -imageVAlign: 'middle', -noTagsMessage: true, -centreImage: null, -pinchZoom: false, -repeatTags: 0, -minTags: 0 -}; -for(i in TagCanvas.options) TagCanvas[i] = TagCanvas.options[i]; -window.TagCanvas = TagCanvas; -// set a flag for when the window has loaded -AddHandler('load',function(){TagCanvas.loaded=1},window); -})(); diff --git a/js/vue.js b/js/vue.js deleted file mode 100644 index 5ebe420..0000000 --- a/js/vue.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! - * Vue.js v2.5.22 - * (c) 2014-2019 Evan You - * Released under the MIT License. - */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return"[object Object]"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function l(e){var t=parseFloat(e);return isNaN(t)?e:t}function f(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var h=Object.prototype.hasOwnProperty;function m(e,t){return h.call(e,t)}function y(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var g=/-(\w)/g,_=y(function(e){return e.replace(g,function(e,t){return t?t.toUpperCase():""})}),b=y(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),$=/\B([A-Z])/g,w=y(function(e){return e.replace($,"-$1").toLowerCase()});var C=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function x(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function k(e,t){for(var n in t)e[n]=t[n];return e}function A(e){for(var t={},n=0;n0,q=z&&z.indexOf("edge/")>0,W=(z&&z.indexOf("android"),z&&/iphone|ipad|ipod|ios/.test(z)||"ios"===V),G=(z&&/chrome\/\d+/.test(z),{}.watch),Z=!1;if(B)try{var X={};Object.defineProperty(X,"passive",{get:function(){Z=!0}}),window.addEventListener("test-passive",null,X)}catch(e){}var Y=function(){return void 0===R&&(R=!B&&!U&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),R},Q=B&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ee(e){return"function"==typeof e&&/native code/.test(e.toString())}var te,ne="undefined"!=typeof Symbol&&ee(Symbol)&&"undefined"!=typeof Reflect&&ee(Reflect.ownKeys);te="undefined"!=typeof Set&&ee(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var re=O,ie=0,oe=function(){this.id=ie++,this.subs=[]};oe.prototype.addSub=function(e){this.subs.push(e)},oe.prototype.removeSub=function(e){v(this.subs,e)},oe.prototype.depend=function(){oe.target&&oe.target.addDep(this)},oe.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!m(i,"default"))a=!1;else if(""===a||a===w(e)){var c=Me(String,i.type);(c<0||s0&&(it((u=e(u,(a||"")+"_"+c))[0])&&it(f)&&(s[l]=pe(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?it(f)?s[l]=pe(f.text+u):""!==u&&s.push(pe(u)):it(u)&&it(f)?s[l]=pe(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function it(e){return n(e)&&n(e.text)&&!1===e.isComment}function ot(e,t){return(e.__esModule||ne&&"Module"===e[Symbol.toStringTag])&&(e=e.default),o(e)?t.extend(e):e}function at(e){return e.isComment&&e.asyncFactory}function st(e){if(Array.isArray(e))for(var t=0;tkt&&bt[n].id>e.id;)n--;bt.splice(n+1,0,e)}else bt.push(e);Ct||(Ct=!0,We(At))}}(this)},St.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){De(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},St.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},St.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},St.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||v(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Tt={enumerable:!0,configurable:!0,get:O,set:O};function Nt(e,t,n){Tt.get=function(){return this[t][n]},Tt.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Tt)}function jt(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&ge(!1);var o=function(o){i.push(o);var a=Ee(o,t,n,e);$e(r,o,a),o in e||Nt(e,"_props",o)};for(var a in t)o(a);ge(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?O:C(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){se();try{return e.call(t,t)}catch(e){return De(e,t,"data()"),{}}finally{ce()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&m(r,o)||(void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&Nt(e,"_data",o))}var a;be(t,!0)}(e):be(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=Y();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new St(e,a||O,O,Et)),i in e||It(e,i,o)}}(e,t.computed),t.watch&&t.watch!==G&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function dn(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=fn(a.componentOptions);s&&!t(s)&&vn(n,o,r,i)}}}function vn(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,v(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=sn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=Ne(cn(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&ft(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=pt(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return an(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return an(t,e,n,r,i,!0)};var o=r&&r.data;$e(t,"$attrs",o&&o.attrs||e,null,!0),$e(t,"$listeners",n._parentListeners||e,null,!0)}(n),_t(n,"beforeCreate"),function(e){var t=Pt(e.$options.inject,e);t&&(ge(!1),Object.keys(t).forEach(function(n){$e(e,n,t[n])}),ge(!0))}(n),jt(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),_t(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(un),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=we,e.prototype.$delete=Ce,e.prototype.$watch=function(e,t,n){if(s(t))return Dt(this,e,t,n);(n=n||{}).user=!0;var r=new St(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){De(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(un),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?x(t):t;for(var n=x(arguments,1),r=0,i=t.length;rparseInt(this.max)&&vn(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return D}};Object.defineProperty(e,"config",t),e.util={warn:re,extend:k,mergeOptions:Ne,defineReactive:$e},e.set=we,e.delete=Ce,e.nextTick=We,e.options=Object.create(null),L.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,k(e.options.components,mn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=x(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Ne(this.options,e),this}}(e),ln(e),function(e){L.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(un),Object.defineProperty(un.prototype,"$isServer",{get:Y}),Object.defineProperty(un.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(un,"FunctionalRenderContext",{value:Zt}),un.version="2.5.22";var yn=f("style,class"),gn=f("input,textarea,option,select,progress"),_n=function(e,t,n){return"value"===n&&gn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},bn=f("contenteditable,draggable,spellcheck"),$n=f("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),wn="http://www.w3.org/1999/xlink",Cn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},xn=function(e){return Cn(e)?e.slice(6,e.length):""},kn=function(e){return null==e||!1===e};function An(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=On(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=On(t,r.data));return function(e,t){if(n(e)||n(t))return Sn(e,Tn(t));return""}(t.staticClass,t.class)}function On(e,t){return{staticClass:Sn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function Sn(e,t){return e?t?e+" "+t:e:t||""}function Tn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i-1?er(e,t,n):$n(t)?kn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):bn(t)?e.setAttribute(t,kn(n)||"false"===n?"false":"true"):Cn(t)?kn(n)?e.removeAttributeNS(wn,xn(t)):e.setAttributeNS(wn,t,n):er(e,t,n)}function er(e,t,n){if(kn(n))e.removeAttribute(t);else{if(K&&!J&&("TEXTAREA"===e.tagName||"INPUT"===e.tagName)&&"placeholder"===t&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var tr={create:Yn,update:Yn};function nr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=An(r),c=i._transitionClasses;n(c)&&(s=Sn(s,Tn(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var rr,ir,or,ar,sr,cr,ur={create:nr,update:nr},lr=/[\w).+\-_$\]]/;function fr(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(h=e.charAt(v));v--);h&&lr.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:e.slice(0,ar),key:'"'+e.slice(ar+1)+'"'}:{exp:e,key:null};ir=e,ar=sr=cr=0;for(;!kr();)Ar(or=xr())?Sr(or):91===or&&Or(or);return{exp:e.slice(0,sr),key:e.slice(sr+1,cr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function xr(){return ir.charCodeAt(++ar)}function kr(){return ar>=rr}function Ar(e){return 34===e||39===e}function Or(e){var t=1;for(sr=ar;!kr();)if(Ar(e=xr()))Sr(e);else if(91===e&&t++,93===e&&t--,0===t){cr=ar;break}}function Sr(e){for(var t=e;!kr()&&(e=xr())!==t;);}var Tr,Nr="__r",jr="__c";function Er(e,t,n){var r=Tr;return function i(){null!==t.apply(null,arguments)&&Lr(e,i,n,r)}}function Ir(e,t,n,r){var i;t=(i=t)._withTask||(i._withTask=function(){ze=!0;try{return i.apply(null,arguments)}finally{ze=!1}}),Tr.addEventListener(e,t,Z?{capture:n,passive:r}:n)}function Lr(e,t,n,r){(r||Tr).removeEventListener(e,t._withTask||t,n)}function Mr(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};Tr=r.elm,function(e){if(n(e[Nr])){var t=K?"change":"input";e[t]=[].concat(e[Nr],e[t]||[]),delete e[Nr]}n(e[jr])&&(e.change=[].concat(e[jr],e.change||[]),delete e[jr])}(i),et(i,o,Ir,Lr,Er,r.context),Tr=void 0}}var Dr={create:Mr,update:Mr};function Pr(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=k({},c)),s)t(c[i])&&(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i){a._value=o;var u=t(o)?"":String(o);Fr(a,u)&&(a.value=u)}else a[i]=o}}}function Fr(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.lazy)return!1;if(i.number)return l(r)!==l(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var Rr={create:Pr,update:Pr},Hr=y(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function Br(e){var t=Ur(e.style);return e.staticStyle?k(e.staticStyle,t):t}function Ur(e){return Array.isArray(e)?A(e):"string"==typeof e?Hr(e):e}var Vr,zr=/^--/,Kr=/\s*!important$/,Jr=function(e,t,n){if(zr.test(t))e.style.setProperty(t,n);else if(Kr.test(n))e.style.setProperty(t,n.replace(Kr,""),"important");else{var r=Wr(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(Xr).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Qr(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(Xr).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function ei(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&k(t,ti(e.name||"v")),k(t,e),t}return"string"==typeof e?ti(e):void 0}}var ti=y(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),ni=B&&!J,ri="transition",ii="animation",oi="transition",ai="transitionend",si="animation",ci="animationend";ni&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(oi="WebkitTransition",ai="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(si="WebkitAnimation",ci="webkitAnimationEnd"));var ui=B?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function li(e){ui(function(){ui(e)})}function fi(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Yr(e,t))}function pi(e,t){e._transitionClasses&&v(e._transitionClasses,t),Qr(e,t)}function di(e,t,n){var r=hi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===ri?ai:ci,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=ri,l=a,f=o.length):t===ii?u>0&&(n=ii,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?ri:ii:null)?n===ri?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===ri&&vi.test(r[oi+"Property"])}}function mi(e,t){for(;e.length1}function wi(e,t){!0!==t.data.show&&gi(t)}var Ci=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;ov?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(0,r,f,v)}(f,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(f,""),_(f,null,y,0,y.length-1,o)):n(h)?$(0,h,0,h.length-1):n(e.text)&&u.setTextContent(f,""):e.text!==i.text&&u.setTextContent(f,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o-1,a.selected!==o&&(a.selected=o);else if(N(Si(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Oi(e,t){return t.every(function(t){return!N(t,e)})}function Si(e){return"_value"in e?e._value:e.value}function Ti(e){e.target.composing=!0}function Ni(e){e.target.composing&&(e.target.composing=!1,ji(e.target,"input"))}function ji(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Ei(e){return!e.componentInstance||e.data&&e.data.transition?e:Ei(e.componentInstance._vnode)}var Ii={model:xi,show:{bind:function(e,t,n){var r=t.value,i=(n=Ei(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,gi(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Ei(n)).data&&n.data.transition?(n.data.show=!0,r?gi(n,function(){e.style.display=e.__vOriginalDisplay}):_i(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},Li={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Mi(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Mi(st(t.children)):e}function Di(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[_(o)]=i[o];return t}function Pi(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var Fi=function(e){return e.tag||at(e)},Ri=function(e){return"show"===e.name},Hi={name:"transition",props:Li,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Fi)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=Mi(o);if(!a)return o;if(this._leaving)return Pi(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=Di(this),u=this._vnode,l=Mi(u);if(a.data.directives&&a.data.directives.some(Ri)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!at(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=k({},c);if("out-in"===r)return this._leaving=!0,tt(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),Pi(e,o);if("in-out"===r){if(at(a))return u;var p,d=function(){p()};tt(c,"afterEnter",d),tt(c,"enterCancelled",d),tt(f,"delayLeave",function(e){p=e})}}return o}}},Bi=k({tag:String,moveClass:String},Li);function Ui(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Vi(e){e.data.newPos=e.elm.getBoundingClientRect()}function zi(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete Bi.mode;var Ki={Transition:Hi,TransitionGroup:{props:Bi,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=mt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Di(this),s=0;s-1?Mn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Mn[e]=/HTMLUnknownElement/.test(t.toString())},k(un.options.directives,Ii),k(un.options.components,Ki),un.prototype.__patch__=B?Ci:O,un.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=fe),_t(e,"beforeMount"),r=function(){e._update(e._render(),n)},new St(e,r,O,{before:function(){e._isMounted&&!e._isDestroyed&&_t(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,_t(e,"mounted")),e}(this,e=e&&B?Pn(e):void 0,t)},B&&setTimeout(function(){D.devtools&&Q&&Q.emit("init",un)},0);var Ji=/\{\{((?:.|\r?\n)+?)\}\}/g,qi=/[-.*+?^${}()|[\]\/\\]/g,Wi=y(function(e){var t=e[0].replace(qi,"\\$&"),n=e[1].replace(qi,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var Gi={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=$r(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=br(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var Zi,Xi={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=$r(e,"style");n&&(e.staticStyle=JSON.stringify(Hr(n)));var r=br(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},Yi=function(e){return(Zi=Zi||document.createElement("div")).innerHTML=e,Zi.textContent},Qi=f("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),eo=f("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),to=f("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),no=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ro="[a-zA-Z_][\\w\\-\\.]*",io="((?:"+ro+"\\:)?"+ro+")",oo=new RegExp("^<"+io),ao=/^\s*(\/?)>/,so=new RegExp("^<\\/"+io+"[^>]*>"),co=/^]+>/i,uo=/^",""":'"',"&":"&"," ":"\n"," ":"\t"},ho=/&(?:lt|gt|quot|amp);/g,mo=/&(?:lt|gt|quot|amp|#10|#9);/g,yo=f("pre,textarea",!0),go=function(e,t){return e&&yo(e)&&"\n"===t[0]};function _o(e,t){var n=t?mo:ho;return e.replace(n,function(e){return vo[e]})}var bo,$o,wo,Co,xo,ko,Ao,Oo,So=/^@|^v-on:/,To=/^v-|^@|^:/,No=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,jo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Eo=/^\(|\)$/g,Io=/:(.*)$/,Lo=/^:|^v-bind:/,Mo=/\.[^.]+/g,Do=y(Yi);function Po(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:function(e){for(var t={},n=0,r=e.length;n]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,fo(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),go(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(uo.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v)),C(v+3);continue}}if(lo.test(e)){var h=e.indexOf("]>");if(h>=0){C(h+2);continue}}var m=e.match(co);if(m){C(m[0].length);continue}var y=e.match(so);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),go(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(so.test($)||oo.test($)||uo.test($)||lo.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d),C(d)}d<0&&(b=e,e=""),t.chars&&b&&t.chars(b)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(oo);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(ao))&&(r=e.match(no));)C(r[0].length),i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&to(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:bo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,start:function(e,o,u){var l=r&&r.ns||Oo(e);K&&"svg"===l&&(o=function(e){for(var t=[],n=0;nc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=fr(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),_r(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Cr(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Cr(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Cr(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=br(e,"value")||"null";hr(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),_r(e,"change",Cr(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Nr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Cr(t,l);c&&(f="if($event.target.composing)return;"+f),hr(e,"value","("+t+")"),_r(e,u,f,null,!0),(s||a)&&_r(e,"blur","$forceUpdate()")}(e,r,i);else if(!D.isReservedTag(o))return wr(e,r,i),!1;return!0},text:function(e,t){t.value&&hr(e,"textContent","_s("+t.value+")")},html:function(e,t){t.value&&hr(e,"innerHTML","_s("+t.value+")")}},isPreTag:function(e){return"pre"===e},isUnaryTag:Qi,mustUseProp:_n,canBeLeftOpenTag:eo,isReservedTag:In,getTagNamespace:Ln,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}(Jo)},Zo=y(function(e){return f("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(e?","+e:""))});function Xo(e,t){e&&(qo=Zo(t.staticKeys||""),Wo=t.isReservedTag||S,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||p(e.tag)||!Wo(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(qo)))}(t);if(1===t.type){if(!Wo(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function\s*\(/,Qo=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,ea={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ta={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},na=function(e){return"if("+e+")return null;"},ra={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:na("$event.target !== $event.currentTarget"),ctrl:na("!$event.ctrlKey"),shift:na("!$event.shiftKey"),alt:na("!$event.altKey"),meta:na("!$event.metaKey"),left:na("'button' in $event && $event.button !== 0"),middle:na("'button' in $event && $event.button !== 1"),right:na("'button' in $event && $event.button !== 2")};function ia(e,t){var n=t?"nativeOn:{":"on:{";for(var r in e)n+='"'+r+'":'+oa(r,e[r])+",";return n.slice(0,-1)+"}"}function oa(e,t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map(function(t){return oa(e,t)}).join(",")+"]";var n=Qo.test(t.value),r=Yo.test(t.value);if(t.modifiers){var i="",o="",a=[];for(var s in t.modifiers)if(ra[s])o+=ra[s],ea[s]&&a.push(s);else if("exact"===s){var c=t.modifiers;o+=na(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=function(e){return"if(!('button' in $event)&&"+e.map(aa).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(n?"return "+t.value+"($event)":r?"return ("+t.value+")($event)":t.value)+"}"}return n||r?t.value:"function($event){"+t.value+"}"}function aa(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=ea[e],r=ta[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var sa={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:O},ca=function(e){this.options=e,this.warn=e.warn||dr,this.transforms=vr(e.modules,"transformCode"),this.dataGenFns=vr(e.modules,"genData"),this.directives=k(k({},sa),e.directives);var t=e.isReservedTag||S;this.maybeComponent=function(e){return!(t(e.tag)&&!e.component)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function ua(e,t){var n=new ca(t);return{render:"with(this){return "+(e?la(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function la(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return fa(e,t);if(e.once&&!e.onceProcessed)return pa(e,t);if(e.for&&!e.forProcessed)return function(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||la)(e,t)+"})"}(e,t);if(e.if&&!e.ifProcessed)return da(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=ma(e,t),i="_t("+n+(r?","+r:""),o=e.attrs&&"{"+e.attrs.map(function(e){return _(e.name)+":"+e.value}).join(",")+"}",a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:ma(t,n,!0);return"_c("+e+","+va(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=va(e,t));var i=e.inlineTemplate?null:ma(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o':'
',Ca.innerHTML.indexOf(" ")>0}var Oa=!!B&&Aa(!1),Sa=!!B&&Aa(!0),Ta=y(function(e){var t=Pn(e);return t&&t.innerHTML}),Na=un.prototype.$mount;return un.prototype.$mount=function(e,t){if((e=e&&Pn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=Ta(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=ka(r,{shouldDecodeNewlines:Oa,shouldDecodeNewlinesForHref:Sa,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return Na.call(this,e,t)},un.compile=ka,un}); \ No newline at end of file diff --git a/js/vue.min.js b/js/vue.min.js new file mode 100644 index 0000000..d998ff7 --- /dev/null +++ b/js/vue.min.js @@ -0,0 +1,6 @@ +/*! + * Vue.js v2.6.14 + * (c) 2014-2021 Evan You + * Released under the MIT License. + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Vue=t()}(this,function(){"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return"[object Object]"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return n(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function l(e){return null==e?"":Array.isArray(e)||s(e)&&e.toString===a?JSON.stringify(e,null,2):String(e)}function f(e){var t=parseFloat(e);return isNaN(t)?e:t}function p(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var m=Object.prototype.hasOwnProperty;function y(e,t){return m.call(e,t)}function g(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var _=/-(\w)/g,b=g(function(e){return e.replace(_,function(e,t){return t?t.toUpperCase():""})}),$=g(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),w=/\B([A-Z])/g,C=g(function(e){return e.replace(w,"-$1").toLowerCase()});var x=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function k(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function A(e,t){for(var n in t)e[n]=t[n];return e}function O(e){for(var t={},n=0;n0,Z=J&&J.indexOf("edge/")>0,G=(J&&J.indexOf("android"),J&&/iphone|ipad|ipod|ios/.test(J)||"ios"===K),X=(J&&/chrome\/\d+/.test(J),J&&/phantomjs/.test(J),J&&J.match(/firefox\/(\d+)/)),Y={}.watch,Q=!1;if(V)try{var ee={};Object.defineProperty(ee,"passive",{get:function(){Q=!0}}),window.addEventListener("test-passive",null,ee)}catch(e){}var te=function(){return void 0===B&&(B=!V&&!z&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),B},ne=V&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function re(e){return"function"==typeof e&&/native code/.test(e.toString())}var ie,oe="undefined"!=typeof Symbol&&re(Symbol)&&"undefined"!=typeof Reflect&&re(Reflect.ownKeys);ie="undefined"!=typeof Set&&re(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ae=S,se=0,ce=function(){this.id=se++,this.subs=[]};ce.prototype.addSub=function(e){this.subs.push(e)},ce.prototype.removeSub=function(e){h(this.subs,e)},ce.prototype.depend=function(){ce.target&&ce.target.addDep(this)},ce.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!y(i,"default"))a=!1;else if(""===a||a===C(e)){var c=Re(String,i.type);(c<0||s0&&(ct((u=e(u,(a||"")+"_"+c))[0])&&ct(f)&&(s[l]=he(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?ct(f)?s[l]=he(f.text+u):""!==u&&s.push(he(u)):ct(u)&&ct(f)?s[l]=he(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function ct(e){return n(e)&&n(e.text)&&!1===e.isComment}function ut(e,t){if(e){for(var n=Object.create(null),r=oe?Reflect.ownKeys(e):Object.keys(e),i=0;i0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==e&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var c in i={},t)t[c]&&"$"!==c[0]&&(i[c]=vt(n,c,t[c]))}else i={};for(var u in n)u in i||(i[u]=ht(n,u));return t&&Object.isExtensible(t)&&(t._normalized=i),R(i,"$stable",a),R(i,"$key",s),R(i,"$hasNormal",o),i}function vt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({}),t=(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:st(e))&&e[0];return e&&(!t||1===e.length&&t.isComment&&!pt(t))?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function ht(e,t){return function(){return e[t]}}function mt(e,t){var r,i,a,s,c;if(Array.isArray(e)||"string"==typeof e)for(r=new Array(e.length),i=0,a=e.length;idocument.createEvent("Event").timeStamp&&(cn=function(){return un.now()})}function ln(){var e,t;for(sn=cn(),on=!0,en.sort(function(e,t){return e.id-t.id}),an=0;anan&&en[n].id>e.id;)n--;en.splice(n+1,0,e)}else en.push(e);rn||(rn=!0,Qe(ln))}}(this)},pn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user){var n='callback for watcher "'+this.expression+'"';Be(this.cb,this.vm,[e,t],this.vm,n)}else this.cb.call(this.vm,e,t)}}},pn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},pn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},pn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||h(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var dn={enumerable:!0,configurable:!0,get:S,set:S};function vn(e,t,n){dn.get=function(){return this[t][n]},dn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,dn)}function hn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&$e(!1);var o=function(o){i.push(o);var a=Ie(o,t,n,e);xe(r,o,a),o in e||vn(e,"_props",o)};for(var a in t)o(a);$e(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?S:x(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){le();try{return e.call(t,t)}catch(e){return He(e,t,"data()"),{}}finally{fe()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&y(r,o)||(a=void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&vn(e,"_data",o))}var a;Ce(t,!0)}(e):Ce(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=te();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new pn(e,a||S,S,mn)),i in e||yn(e,i,o)}}(e,t.computed),t.watch&&t.watch!==Y&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function On(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=a.name;s&&!t(s)&&Sn(n,o,r,i)}}}function Sn(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,h(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=$n++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=De(wn(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&Wt(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=lt(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return Ht(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Ht(t,e,n,r,i,!0)};var o=r&&r.data;xe(t,"$attrs",o&&o.attrs||e,null,!0),xe(t,"$listeners",n._parentListeners||e,null,!0)}(n),Qt(n,"beforeCreate"),function(e){var t=ut(e.$options.inject,e);t&&($e(!1),Object.keys(t).forEach(function(n){xe(e,n,t[n])}),$e(!0))}(n),hn(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),Qt(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(Cn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=ke,e.prototype.$delete=Ae,e.prototype.$watch=function(e,t,n){if(s(t))return bn(this,e,t,n);(n=n||{}).user=!0;var r=new pn(this,e,t,n);if(n.immediate){var i='callback for immediate watcher "'+r.expression+'"';le(),Be(t,this,[r.value],this,i),fe()}return function(){r.teardown()}}}(Cn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?k(t):t;for(var n=k(arguments,1),r='event handler for "'+e+'"',i=0,o=t.length;iparseInt(this.max)&&Sn(e,t[0],t,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)Sn(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",function(t){On(e,function(e){return An(t,e)})}),this.$watch("exclude",function(t){On(e,function(e){return!An(t,e)})})},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=zt(e),n=t&&t.componentOptions;if(n){var r=kn(n),i=this.include,o=this.exclude;if(i&&(!r||!An(i,r))||o&&r&&An(o,r))return t;var a=this.cache,s=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;a[c]?(t.componentInstance=a[c].componentInstance,h(s,c),s.push(c)):(this.vnodeToCache=t,this.keyToCache=c),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return F}};Object.defineProperty(e,"config",t),e.util={warn:ae,extend:A,mergeOptions:De,defineReactive:xe},e.set=ke,e.delete=Ae,e.nextTick=Qe,e.observable=function(e){return Ce(e),e},e.options=Object.create(null),I.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,A(e.options.components,Nn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=k(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=De(this.options,e),this}}(e),xn(e),function(e){I.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(Cn),Object.defineProperty(Cn.prototype,"$isServer",{get:te}),Object.defineProperty(Cn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Cn,"FunctionalRenderContext",{value:Et}),Cn.version="2.6.14";var En=p("style,class"),jn=p("input,textarea,option,select,progress"),Dn=function(e,t,n){return"value"===n&&jn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},Ln=p("contenteditable,draggable,spellcheck"),In=p("events,caret,typing,plaintext-only"),Mn=function(e,t){return Bn(t)||"false"===t?"false":"contenteditable"===e&&In(t)?t:"true"},Fn=p("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Pn="http://www.w3.org/1999/xlink",Rn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Hn=function(e){return Rn(e)?e.slice(6,e.length):""},Bn=function(e){return null==e||!1===e};function Un(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Vn(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=Vn(t,r.data));return function(e,t){if(n(e)||n(t))return zn(e,Kn(t));return""}(t.staticClass,t.class)}function Vn(e,t){return{staticClass:zn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function zn(e,t){return e?t?e+" "+t:e:t||""}function Kn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i-1?mr(e,t,n):Fn(t)?Bn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Ln(t)?e.setAttribute(t,Mn(t,n)):Rn(t)?Bn(n)?e.removeAttributeNS(Pn,Hn(t)):e.setAttributeNS(Pn,t,n):mr(e,t,n)}function mr(e,t,n){if(Bn(n))e.removeAttribute(t);else{if(q&&!W&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var yr={create:vr,update:vr};function gr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=Un(r),c=i._transitionClasses;n(c)&&(s=zn(s,Kn(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var _r,br,$r,wr,Cr,xr,kr={create:gr,update:gr},Ar=/[\w).+\-_$\]]/;function Or(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(h=e.charAt(v));v--);h&&Ar.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:e.slice(0,wr),key:'"'+e.slice(wr+1)+'"'}:{exp:e,key:null};br=e,wr=Cr=xr=0;for(;!zr();)Kr($r=Vr())?qr($r):91===$r&&Jr($r);return{exp:e.slice(0,Cr),key:e.slice(Cr+1,xr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function Vr(){return br.charCodeAt(++wr)}function zr(){return wr>=_r}function Kr(e){return 34===e||39===e}function Jr(e){var t=1;for(Cr=wr;!zr();)if(Kr(e=Vr()))qr(e);else if(91===e&&t++,93===e&&t--,0===t){xr=wr;break}}function qr(e){for(var t=e;!zr()&&(e=Vr())!==t;);}var Wr,Zr="__r",Gr="__c";function Xr(e,t,n){var r=Wr;return function i(){null!==t.apply(null,arguments)&&ei(e,i,n,r)}}var Yr=Ke&&!(X&&Number(X[1])<=53);function Qr(e,t,n,r){if(Yr){var i=sn,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}Wr.addEventListener(e,t,Q?{capture:n,passive:r}:n)}function ei(e,t,n,r){(r||Wr).removeEventListener(e,t._wrapper||t,n)}function ti(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};Wr=r.elm,function(e){if(n(e[Zr])){var t=q?"change":"input";e[t]=[].concat(e[Zr],e[t]||[]),delete e[Zr]}n(e[Gr])&&(e.change=[].concat(e[Gr],e.change||[]),delete e[Gr])}(i),it(i,o,Qr,ei,Xr,r.context),Wr=void 0}}var ni,ri={create:ti,update:ti};function ii(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=A({},c)),s)i in c||(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i&&"PROGRESS"!==a.tagName){a._value=o;var u=t(o)?"":String(o);oi(a,u)&&(a.value=u)}else if("innerHTML"===i&&Wn(a.tagName)&&t(a.innerHTML)){(ni=ni||document.createElement("div")).innerHTML=""+o+"";for(var l=ni.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(o!==s[i])try{a[i]=o}catch(e){}}}}function oi(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.number)return f(r)!==f(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var ai={create:ii,update:ii},si=g(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function ci(e){var t=ui(e.style);return e.staticStyle?A(e.staticStyle,t):t}function ui(e){return Array.isArray(e)?O(e):"string"==typeof e?si(e):e}var li,fi=/^--/,pi=/\s*!important$/,di=function(e,t,n){if(fi.test(t))e.style.setProperty(t,n);else if(pi.test(n))e.style.setProperty(C(t),n.replace(pi,""),"important");else{var r=hi(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(gi).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function bi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(gi).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function $i(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&A(t,wi(e.name||"v")),A(t,e),t}return"string"==typeof e?wi(e):void 0}}var wi=g(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),Ci=V&&!W,xi="transition",ki="animation",Ai="transition",Oi="transitionend",Si="animation",Ti="animationend";Ci&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ai="WebkitTransition",Oi="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Si="WebkitAnimation",Ti="webkitAnimationEnd"));var Ni=V?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ei(e){Ni(function(){Ni(e)})}function ji(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),_i(e,t))}function Di(e,t){e._transitionClasses&&h(e._transitionClasses,t),bi(e,t)}function Li(e,t,n){var r=Mi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===xi?Oi:Ti,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=xi,l=a,f=o.length):t===ki?u>0&&(n=ki,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?xi:ki:null)?n===xi?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===xi&&Ii.test(r[Ai+"Property"])}}function Fi(e,t){for(;e.length1}function Vi(e,t){!0!==t.data.show&&Ri(t)}var zi=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;ov?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(r,p,v)}(p,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(p,""),_(p,null,y,0,y.length-1,o)):n(h)?$(h,0,h.length-1):n(e.text)&&u.setTextContent(p,""):e.text!==i.text&&u.setTextContent(p,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o-1,a.selected!==o&&(a.selected=o);else if(E(Zi(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Wi(e,t){return t.every(function(t){return!E(t,e)})}function Zi(e){return"_value"in e?e._value:e.value}function Gi(e){e.target.composing=!0}function Xi(e){e.target.composing&&(e.target.composing=!1,Yi(e.target,"input"))}function Yi(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Qi(e){return!e.componentInstance||e.data&&e.data.transition?e:Qi(e.componentInstance._vnode)}var eo={model:Ki,show:{bind:function(e,t,n){var r=t.value,i=(n=Qi(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,Ri(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Qi(n)).data&&n.data.transition?(n.data.show=!0,r?Ri(n,function(){e.style.display=e.__vOriginalDisplay}):Hi(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},to={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function no(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?no(zt(t.children)):e}function ro(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[b(o)]=i[o];return t}function io(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var oo=function(e){return e.tag||pt(e)},ao=function(e){return"show"===e.name},so={name:"transition",props:to,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(oo)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=no(o);if(!a)return o;if(this._leaving)return io(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=ro(this),u=this._vnode,l=no(u);if(a.data.directives&&a.data.directives.some(ao)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!pt(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=A({},c);if("out-in"===r)return this._leaving=!0,ot(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),io(e,o);if("in-out"===r){if(pt(a))return u;var p,d=function(){p()};ot(c,"afterEnter",d),ot(c,"enterCancelled",d),ot(f,"delayLeave",function(e){p=e})}}return o}}},co=A({tag:String,moveClass:String},to);function uo(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function lo(e){e.data.newPos=e.elm.getBoundingClientRect()}function fo(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete co.mode;var po={Transition:so,TransitionGroup:{props:co,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=Gt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=ro(this),s=0;s-1?Xn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Xn[e]=/HTMLUnknownElement/.test(t.toString())},A(Cn.options.directives,eo),A(Cn.options.components,po),Cn.prototype.__patch__=V?zi:S,Cn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=ve),Qt(e,"beforeMount"),r=function(){e._update(e._render(),n)},new pn(e,r,S,{before:function(){e._isMounted&&!e._isDestroyed&&Qt(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,Qt(e,"mounted")),e}(this,e=e&&V?Qn(e):void 0,t)},V&&setTimeout(function(){F.devtools&&ne&&ne.emit("init",Cn)},0);var vo=/\{\{((?:.|\r?\n)+?)\}\}/g,ho=/[-.*+?^${}()|[\]\/\\]/g,mo=g(function(e){var t=e[0].replace(ho,"\\$&"),n=e[1].replace(ho,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var yo={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=Pr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Fr(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var go,_o={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=Pr(e,"style");n&&(e.staticStyle=JSON.stringify(si(n)));var r=Fr(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},bo=function(e){return(go=go||document.createElement("div")).innerHTML=e,go.textContent},$o=p("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),wo=p("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),Co=p("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),xo=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ko=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Ao="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+P.source+"]*",Oo="((?:"+Ao+"\\:)?"+Ao+")",So=new RegExp("^<"+Oo),To=/^\s*(\/?)>/,No=new RegExp("^<\\/"+Oo+"[^>]*>"),Eo=/^]+>/i,jo=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},Fo=/&(?:lt|gt|quot|amp|#39);/g,Po=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Ro=p("pre,textarea",!0),Ho=function(e,t){return e&&Ro(e)&&"\n"===t[0]};function Bo(e,t){var n=t?Po:Fo;return e.replace(n,function(e){return Mo[e]})}var Uo,Vo,zo,Ko,Jo,qo,Wo,Zo,Go=/^@|^v-on:/,Xo=/^v-|^@|^:|^#/,Yo=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Qo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,ea=/^\(|\)$/g,ta=/^\[.*\]$/,na=/:(.*)$/,ra=/^:|^\.|^v-bind:/,ia=/\.[^.\]]+(?=[^\]]*$)/g,oa=/^v-slot(:|$)|^#/,aa=/[\r\n]/,sa=/[ \f\t\r\n]+/g,ca=g(bo),ua="_empty_";function la(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:ya(t),rawAttrsMap:{},parent:n,children:[]}}function fa(e,t){Uo=t.warn||Tr,qo=t.isPreTag||T,Wo=t.mustUseProp||T,Zo=t.getTagNamespace||T;t.isReservedTag;zo=Nr(t.modules,"transformNode"),Ko=Nr(t.modules,"preTransformNode"),Jo=Nr(t.modules,"postTransformNode"),Vo=t.delimiters;var n,r,i=[],o=!1!==t.preserveWhitespace,a=t.whitespace,s=!1,c=!1;function u(e){if(l(e),s||e.processed||(e=pa(e,t)),i.length||e===n||n.if&&(e.elseif||e.else)&&va(n,{exp:e.elseif,block:e}),r&&!e.forbidden)if(e.elseif||e.else)a=e,(u=function(e){var t=e.length;for(;t--;){if(1===e[t].type)return e[t];e.pop()}}(r.children))&&u.if&&va(u,{exp:a.elseif,block:a});else{if(e.slotScope){var o=e.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[o]=e}r.children.push(e),e.parent=r}var a,u;e.children=e.children.filter(function(e){return!e.slotScope}),l(e),e.pre&&(s=!1),qo(e.tag)&&(c=!1);for(var f=0;f]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,Lo(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),Ho(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(jo.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),C(v+3);continue}}if(Do.test(e)){var h=e.indexOf("]>");if(h>=0){C(h+2);continue}}var m=e.match(Eo);if(m){C(m[0].length);continue}var y=e.match(No);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),Ho(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(No.test($)||So.test($)||jo.test($)||Do.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d)}d<0&&(b=e),b&&C(b.length),t.chars&&b&&t.chars(b,c-b.length,c)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(So);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(To))&&(r=e.match(ko)||e.match(xo));)r.start=c,C(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&Co(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:Uo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,o,a,l,f){var p=r&&r.ns||Zo(e);q&&"svg"===p&&(o=function(e){for(var t=[],n=0;nc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=Or(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),Mr(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Ur(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Ur(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Ur(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=Fr(e,"value")||"null";Er(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),Mr(e,"change",Ur(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Zr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Ur(t,l);c&&(f="if($event.target.composing)return;"+f),Er(e,"value","("+t+")"),Mr(e,u,f,null,!0),(s||a)&&Mr(e,"blur","$forceUpdate()")}(e,r,i);else if(!F.isReservedTag(o))return Br(e,r,i),!1;return!0},text:function(e,t){t.value&&Er(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&Er(e,"innerHTML","_s("+t.value+")",t)}},isPreTag:function(e){return"pre"===e},isUnaryTag:$o,mustUseProp:Dn,canBeLeftOpenTag:wo,isReservedTag:Zn,getTagNamespace:Gn,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}($a)},ka=g(function(e){return p("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))});function Aa(e,t){e&&(wa=ka(t.staticKeys||""),Ca=t.isReservedTag||T,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||d(e.tag)||!Ca(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(wa)))}(t);if(1===t.type){if(!Ca(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function(?:\s+[\w$]+)?\s*\(/,Sa=/\([^)]*?\);*$/,Ta=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Na={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ea={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},ja=function(e){return"if("+e+")return null;"},Da={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:ja("$event.target !== $event.currentTarget"),ctrl:ja("!$event.ctrlKey"),shift:ja("!$event.shiftKey"),alt:ja("!$event.altKey"),meta:ja("!$event.metaKey"),left:ja("'button' in $event && $event.button !== 0"),middle:ja("'button' in $event && $event.button !== 1"),right:ja("'button' in $event && $event.button !== 2")};function La(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var a=Ia(e[o]);e[o]&&e[o].dynamic?i+=o+","+a+",":r+='"'+o+'":'+a+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function Ia(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return Ia(e)}).join(",")+"]";var t=Ta.test(e.value),n=Oa.test(e.value),r=Ta.test(e.value.replace(Sa,""));if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(Da[s])o+=Da[s],Na[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=ja(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(Ma).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(t?"return "+e.value+".apply(null, arguments)":n?"return ("+e.value+").apply(null, arguments)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function Ma(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Na[e],r=Ea[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Fa={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:S},Pa=function(e){this.options=e,this.warn=e.warn||Tr,this.transforms=Nr(e.modules,"transformCode"),this.dataGenFns=Nr(e.modules,"genData"),this.directives=A(A({},Fa),e.directives);var t=e.isReservedTag||T;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Ra(e,t){var n=new Pa(t);return{render:"with(this){return "+(e?"script"===e.tag?"null":Ha(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Ha(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Ba(e,t);if(e.once&&!e.onceProcessed)return Ua(e,t);if(e.for&&!e.forProcessed)return za(e,t);if(e.if&&!e.ifProcessed)return Va(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=Wa(e,t),i="_t("+n+(r?",function(){return "+r+"}":""),o=e.attrs||e.dynamicAttrs?Xa((e.attrs||[]).concat(e.dynamicAttrs||[]).map(function(e){return{name:b(e.name),value:e.value,dynamic:e.dynamic}})):null,a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:Wa(t,n,!0);return"_c("+e+","+Ka(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Ka(e,t));var i=e.inlineTemplate?null:Wa(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o>>0}(a):"")+")"}(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var o=function(e,t){var n=e.children[0];if(n&&1===n.type){var r=Ra(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(e){return"function(){"+e+"}"}).join(",")+"]}"}}(e,t);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+Xa(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Ja(e){return 1===e.type&&("slot"===e.tag||e.children.some(Ja))}function qa(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return Va(e,t,qa,"null");if(e.for&&!e.forProcessed)return za(e,t,qa);var r=e.slotScope===ua?"":String(e.slotScope),i="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(Wa(e,t)||"undefined")+":undefined":Wa(e,t)||"undefined":Ha(e,t))+"}",o=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+i+o+"}"}function Wa(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?t.maybeComponent(a)?",1":",0":"";return""+(r||Ha)(a,t)+s}var c=n?function(e,t){for(var n=0,r=0;r':'
',ns.innerHTML.indexOf(" ")>0}var as=!!V&&os(!1),ss=!!V&&os(!0),cs=g(function(e){var t=Qn(e);return t&&t.innerHTML}),us=Cn.prototype.$mount;return Cn.prototype.$mount=function(e,t){if((e=e&&Qn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=cs(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=is(r,{outputSourceRange:!1,shouldDecodeNewlines:as,shouldDecodeNewlinesForHref:ss,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return us.call(this,e,t)},Cn.compile=is,Cn}); \ No newline at end of file diff --git a/js/zepto.js b/js/zepto.js deleted file mode 100644 index 3b450a8..0000000 --- a/js/zepto.js +++ /dev/null @@ -1,1909 +0,0 @@ -/* Zepto v1.1.2-5-g4c456f6 - zepto ajax event fx fx_methods selector touch - zeptojs.com/license */ - -var Zepto = (function() { - var undefined, key, $, classList, emptyArray = [], slice = emptyArray.slice, filter = emptyArray.filter, - document = window.document, - elementDisplay = {}, classCache = {}, - cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 }, - fragmentRE = /^\s*<(\w+|!)[^>]*>/, - singleTagRE = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, - tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, - rootNodeRE = /^(?:body|html)$/i, - capitalRE = /([A-Z])/g, - - // special attributes that should be get/set via method calls - methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'], - - adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ], - table = document.createElement('table'), - tableRow = document.createElement('tr'), - containers = { - 'tr': document.createElement('tbody'), - 'tbody': table, 'thead': table, 'tfoot': table, - 'td': tableRow, 'th': tableRow, - '*': document.createElement('div') - }, - readyRE = /complete|loaded|interactive/, - classSelectorRE = /^\.([\w-]+)$/, - idSelectorRE = /^#([\w-]*)$/, - simpleSelectorRE = /^[\w-]*$/, - class2type = {}, - toString = class2type.toString, - zepto = {}, - camelize, uniq, - tempParent = document.createElement('div'), - propMap = { - 'tabindex': 'tabIndex', - 'readonly': 'readOnly', - 'for': 'htmlFor', - 'class': 'className', - 'maxlength': 'maxLength', - 'cellspacing': 'cellSpacing', - 'cellpadding': 'cellPadding', - 'rowspan': 'rowSpan', - 'colspan': 'colSpan', - 'usemap': 'useMap', - 'frameborder': 'frameBorder', - 'contenteditable': 'contentEditable' - } - - zepto.matches = function(element, selector) { - if (!selector || !element || element.nodeType !== 1) return false - var matchesSelector = element.webkitMatchesSelector || element.mozMatchesSelector || - element.oMatchesSelector || element.matchesSelector - if (matchesSelector) return matchesSelector.call(element, selector) - // fall back to performing a selector: - var match, parent = element.parentNode, temp = !parent - if (temp) (parent = tempParent).appendChild(element) - match = ~zepto.qsa(parent, selector).indexOf(element) - temp && tempParent.removeChild(element) - return match - } - - function type(obj) { - return obj == null ? String(obj) : - class2type[toString.call(obj)] || "object" - } - - function isFunction(value) { return type(value) == "function" } - function isWindow(obj) { return obj != null && obj == obj.window } - function isDocument(obj) { return obj != null && obj.nodeType == obj.DOCUMENT_NODE } - function isObject(obj) { return type(obj) == "object" } - function isPlainObject(obj) { - return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype - } - function isArray(value) { return value instanceof Array } - function likeArray(obj) { return typeof obj.length == 'number' } - - function compact(array) { return filter.call(array, function(item){ return item != null }) } - function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array } - camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) } - function dasherize(str) { - return str.replace(/::/g, '/') - .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2') - .replace(/([a-z\d])([A-Z])/g, '$1_$2') - .replace(/_/g, '-') - .toLowerCase() - } - uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) } - - function classRE(name) { - return name in classCache ? - classCache[name] : (classCache[name] = new RegExp('(^|\\s)' + name + '(\\s|$)')) - } - - function maybeAddPx(name, value) { - return (typeof value == "number" && !cssNumber[dasherize(name)]) ? value + "px" : value - } - - function defaultDisplay(nodeName) { - var element, display - if (!elementDisplay[nodeName]) { - element = document.createElement(nodeName) - document.body.appendChild(element) - display = getComputedStyle(element, '').getPropertyValue("display") - element.parentNode.removeChild(element) - display == "none" && (display = "block") - elementDisplay[nodeName] = display - } - return elementDisplay[nodeName] - } - - function children(element) { - return 'children' in element ? - slice.call(element.children) : - $.map(element.childNodes, function(node){ if (node.nodeType == 1) return node }) - } - - // `$.zepto.fragment` takes a html string and an optional tag name - // to generate DOM nodes nodes from the given html string. - // The generated DOM nodes are returned as an array. - // This function can be overriden in plugins for example to make - // it compatible with browsers that don't support the DOM fully. - zepto.fragment = function(html, name, properties) { - var dom, nodes, container - - // A special case optimization for a single tag - if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1)) - - if (!dom) { - if (html.replace) html = html.replace(tagExpanderRE, "<$1>") - if (name === undefined) name = fragmentRE.test(html) && RegExp.$1 - if (!(name in containers)) name = '*' - - container = containers[name] - container.innerHTML = '' + html - dom = $.each(slice.call(container.childNodes), function(){ - container.removeChild(this) - }) - } - - if (isPlainObject(properties)) { - nodes = $(dom) - $.each(properties, function(key, value) { - if (methodAttributes.indexOf(key) > -1) nodes[key](value) - else nodes.attr(key, value) - }) - } - - return dom - } - - // `$.zepto.Z` swaps out the prototype of the given `dom` array - // of nodes with `$.fn` and thus supplying all the Zepto functions - // to the array. Note that `__proto__` is not supported on Internet - // Explorer. This method can be overriden in plugins. - zepto.Z = function(dom, selector) { - dom = dom || [] - dom.__proto__ = $.fn - dom.selector = selector || '' - return dom - } - - // `$.zepto.isZ` should return `true` if the given object is a Zepto - // collection. This method can be overriden in plugins. - zepto.isZ = function(object) { - return object instanceof zepto.Z - } - - // `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and - // takes a CSS selector and an optional context (and handles various - // special cases). - // This method can be overriden in plugins. - zepto.init = function(selector, context) { - var dom - // If nothing given, return an empty Zepto collection - if (!selector) return zepto.Z() - // Optimize for string selectors - else if (typeof selector == 'string') { - selector = selector.trim() - // If it's a html fragment, create nodes from it - // Note: In both Chrome 21 and Firefox 15, DOM error 12 - // is thrown if the fragment doesn't begin with < - if (selector[0] == '<' && fragmentRE.test(selector)) - dom = zepto.fragment(selector, RegExp.$1, context), selector = null - // If there's a context, create a collection on that context first, and select - // nodes from there - else if (context !== undefined) return $(context).find(selector) - // If it's a CSS selector, use it to select nodes. - else dom = zepto.qsa(document, selector) - } - // If a function is given, call it when the DOM is ready - else if (isFunction(selector)) return $(document).ready(selector) - // If a Zepto collection is given, just return it - else if (zepto.isZ(selector)) return selector - else { - // normalize array if an array of nodes is given - if (isArray(selector)) dom = compact(selector) - // Wrap DOM nodes. - else if (isObject(selector)) - dom = [selector], selector = null - // If it's a html fragment, create nodes from it - else if (fragmentRE.test(selector)) - dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null - // If there's a context, create a collection on that context first, and select - // nodes from there - else if (context !== undefined) return $(context).find(selector) - // And last but no least, if it's a CSS selector, use it to select nodes. - else dom = zepto.qsa(document, selector) - } - // create a new Zepto collection from the nodes found - return zepto.Z(dom, selector) - } - - // `$` will be the base `Zepto` object. When calling this - // function just call `$.zepto.init, which makes the implementation - // details of selecting nodes and creating Zepto collections - // patchable in plugins. - $ = function(selector, context){ - return zepto.init(selector, context) - } - - function extend(target, source, deep) { - for (key in source) - if (deep && (isPlainObject(source[key]) || isArray(source[key]))) { - if (isPlainObject(source[key]) && !isPlainObject(target[key])) - target[key] = {} - if (isArray(source[key]) && !isArray(target[key])) - target[key] = [] - extend(target[key], source[key], deep) - } - else if (source[key] !== undefined) target[key] = source[key] - } - - // Copy all but undefined properties from one or more - // objects to the `target` object. - $.extend = function(target){ - var deep, args = slice.call(arguments, 1) - if (typeof target == 'boolean') { - deep = target - target = args.shift() - } - args.forEach(function(arg){ extend(target, arg, deep) }) - return target - } - - // `$.zepto.qsa` is Zepto's CSS selector implementation which - // uses `document.querySelectorAll` and optimizes for some special cases, like `#id`. - // This method can be overriden in plugins. - zepto.qsa = function(element, selector){ - var found, - maybeID = selector[0] == '#', - maybeClass = !maybeID && selector[0] == '.', - nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked - isSimple = simpleSelectorRE.test(nameOnly) - return (isDocument(element) && isSimple && maybeID) ? - ( (found = element.getElementById(nameOnly)) ? [found] : [] ) : - (element.nodeType !== 1 && element.nodeType !== 9) ? [] : - slice.call( - isSimple && !maybeID ? - maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class - element.getElementsByTagName(selector) : // Or a tag - element.querySelectorAll(selector) // Or it's not simple, and we need to query all - ) - } - - function filtered(nodes, selector) { - return selector == null ? $(nodes) : $(nodes).filter(selector) - } - - $.contains = function(parent, node) { - return parent !== node && parent.contains(node) - } - - function funcArg(context, arg, idx, payload) { - return isFunction(arg) ? arg.call(context, idx, payload) : arg - } - - function setAttribute(node, name, value) { - value == null ? node.removeAttribute(name) : node.setAttribute(name, value) - } - - // access className property while respecting SVGAnimatedString - function className(node, value){ - var klass = node.className, - svg = klass && klass.baseVal !== undefined - - if (value === undefined) return svg ? klass.baseVal : klass - svg ? (klass.baseVal = value) : (node.className = value) - } - - // "true" => true - // "false" => false - // "null" => null - // "42" => 42 - // "42.5" => 42.5 - // "08" => "08" - // JSON => parse if valid - // String => self - function deserializeValue(value) { - var num - try { - return value ? - value == "true" || - ( value == "false" ? false : - value == "null" ? null : - !/^0/.test(value) && !isNaN(num = Number(value)) ? num : - /^[\[\{]/.test(value) ? $.parseJSON(value) : - value ) - : value - } catch(e) { - return value - } - } - - $.type = type - $.isFunction = isFunction - $.isWindow = isWindow - $.isArray = isArray - $.isPlainObject = isPlainObject - - $.isEmptyObject = function(obj) { - var name - for (name in obj) return false - return true - } - - $.inArray = function(elem, array, i){ - return emptyArray.indexOf.call(array, elem, i) - } - - $.camelCase = camelize - $.trim = function(str) { - return str == null ? "" : String.prototype.trim.call(str) - } - - // plugin compatibility - $.uuid = 0 - $.support = { } - $.expr = { } - - $.map = function(elements, callback){ - var value, values = [], i, key - if (likeArray(elements)) - for (i = 0; i < elements.length; i++) { - value = callback(elements[i], i) - if (value != null) values.push(value) - } - else - for (key in elements) { - value = callback(elements[key], key) - if (value != null) values.push(value) - } - return flatten(values) - } - - $.each = function(elements, callback){ - var i, key - if (likeArray(elements)) { - for (i = 0; i < elements.length; i++) - if (callback.call(elements[i], i, elements[i]) === false) return elements - } else { - for (key in elements) - if (callback.call(elements[key], key, elements[key]) === false) return elements - } - - return elements - } - - $.grep = function(elements, callback){ - return filter.call(elements, callback) - } - - if (window.JSON) $.parseJSON = JSON.parse - - // Populate the class2type map - $.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase() - }) - - // Define methods that will be available on all - // Zepto collections - $.fn = { - // Because a collection acts like an array - // copy over these useful array functions. - forEach: emptyArray.forEach, - reduce: emptyArray.reduce, - push: emptyArray.push, - sort: emptyArray.sort, - indexOf: emptyArray.indexOf, - concat: emptyArray.concat, - - // `map` and `slice` in the jQuery API work differently - // from their array counterparts - map: function(fn){ - return $($.map(this, function(el, i){ return fn.call(el, i, el) })) - }, - slice: function(){ - return $(slice.apply(this, arguments)) - }, - - ready: function(callback){ - // need to check if document.body exists for IE as that browser reports - // document ready when it hasn't yet created the body element - if (readyRE.test(document.readyState) && document.body) callback($) - else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false) - return this - }, - get: function(idx){ - return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length] - }, - toArray: function(){ return this.get() }, - size: function(){ - return this.length - }, - remove: function(){ - return this.each(function(){ - if (this.parentNode != null) - this.parentNode.removeChild(this) - }) - }, - each: function(callback){ - emptyArray.every.call(this, function(el, idx){ - return callback.call(el, idx, el) !== false - }) - return this - }, - filter: function(selector){ - if (isFunction(selector)) return this.not(this.not(selector)) - return $(filter.call(this, function(element){ - return zepto.matches(element, selector) - })) - }, - add: function(selector,context){ - return $(uniq(this.concat($(selector,context)))) - }, - is: function(selector){ - return this.length > 0 && zepto.matches(this[0], selector) - }, - not: function(selector){ - var nodes=[] - if (isFunction(selector) && selector.call !== undefined) - this.each(function(idx){ - if (!selector.call(this,idx)) nodes.push(this) - }) - else { - var excludes = typeof selector == 'string' ? this.filter(selector) : - (likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector) - this.forEach(function(el){ - if (excludes.indexOf(el) < 0) nodes.push(el) - }) - } - return $(nodes) - }, - has: function(selector){ - return this.filter(function(){ - return isObject(selector) ? - $.contains(this, selector) : - $(this).find(selector).size() - }) - }, - eq: function(idx){ - return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1) - }, - first: function(){ - var el = this[0] - return el && !isObject(el) ? el : $(el) - }, - last: function(){ - var el = this[this.length - 1] - return el && !isObject(el) ? el : $(el) - }, - find: function(selector){ - var result, $this = this - if (typeof selector == 'object') - result = $(selector).filter(function(){ - var node = this - return emptyArray.some.call($this, function(parent){ - return $.contains(parent, node) - }) - }) - else if (this.length == 1) result = $(zepto.qsa(this[0], selector)) - else result = this.map(function(){ return zepto.qsa(this, selector) }) - return result - }, - closest: function(selector, context){ - var node = this[0], collection = false - if (typeof selector == 'object') collection = $(selector) - while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector))) - node = node !== context && !isDocument(node) && node.parentNode - return $(node) - }, - parents: function(selector){ - var ancestors = [], nodes = this - while (nodes.length > 0) - nodes = $.map(nodes, function(node){ - if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) { - ancestors.push(node) - return node - } - }) - return filtered(ancestors, selector) - }, - parent: function(selector){ - return filtered(uniq(this.pluck('parentNode')), selector) - }, - children: function(selector){ - return filtered(this.map(function(){ return children(this) }), selector) - }, - contents: function() { - return this.map(function() { return slice.call(this.childNodes) }) - }, - siblings: function(selector){ - return filtered(this.map(function(i, el){ - return filter.call(children(el.parentNode), function(child){ return child!==el }) - }), selector) - }, - empty: function(){ - return this.each(function(){ this.innerHTML = '' }) - }, - // `pluck` is borrowed from Prototype.js - pluck: function(property){ - return $.map(this, function(el){ return el[property] }) - }, - show: function(){ - return this.each(function(){ - this.style.display == "none" && (this.style.display = '') - if (getComputedStyle(this, '').getPropertyValue("display") == "none") - this.style.display = defaultDisplay(this.nodeName) - }) - }, - replaceWith: function(newContent){ - return this.before(newContent).remove() - }, - wrap: function(structure){ - var func = isFunction(structure) - if (this[0] && !func) - var dom = $(structure).get(0), - clone = dom.parentNode || this.length > 1 - - return this.each(function(index){ - $(this).wrapAll( - func ? structure.call(this, index) : - clone ? dom.cloneNode(true) : dom - ) - }) - }, - wrapAll: function(structure){ - if (this[0]) { - $(this[0]).before(structure = $(structure)) - var children - // drill down to the inmost element - while ((children = structure.children()).length) structure = children.first() - $(structure).append(this) - } - return this - }, - wrapInner: function(structure){ - var func = isFunction(structure) - return this.each(function(index){ - var self = $(this), contents = self.contents(), - dom = func ? structure.call(this, index) : structure - contents.length ? contents.wrapAll(dom) : self.append(dom) - }) - }, - unwrap: function(){ - this.parent().each(function(){ - $(this).replaceWith($(this).children()) - }) - return this - }, - clone: function(){ - return this.map(function(){ return this.cloneNode(true) }) - }, - hide: function(){ - return this.css("display", "none") - }, - toggle: function(setting){ - return this.each(function(){ - var el = $(this) - ;(setting === undefined ? el.css("display") == "none" : setting) ? el.show() : el.hide() - }) - }, - prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') }, - next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') }, - html: function(html){ - return arguments.length === 0 ? - (this.length > 0 ? this[0].innerHTML : null) : - this.each(function(idx){ - var originHtml = this.innerHTML - $(this).empty().append( funcArg(this, html, idx, originHtml) ) - }) - }, - text: function(text){ - return arguments.length === 0 ? - (this.length > 0 ? this[0].textContent : null) : - this.each(function(){ this.textContent = (text === undefined) ? '' : ''+text }) - }, - attr: function(name, value){ - var result - return (typeof name == 'string' && value === undefined) ? - (this.length == 0 || this[0].nodeType !== 1 ? undefined : - (name == 'value' && this[0].nodeName == 'INPUT') ? this.val() : - (!(result = this[0].getAttribute(name)) && name in this[0]) ? this[0][name] : result - ) : - this.each(function(idx){ - if (this.nodeType !== 1) return - if (isObject(name)) for (key in name) setAttribute(this, key, name[key]) - else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name))) - }) - }, - removeAttr: function(name){ - return this.each(function(){ this.nodeType === 1 && setAttribute(this, name) }) - }, - prop: function(name, value){ - name = propMap[name] || name - return (value === undefined) ? - (this[0] && this[0][name]) : - this.each(function(idx){ - this[name] = funcArg(this, value, idx, this[name]) - }) - }, - data: function(name, value){ - var data = this.attr('data-' + name.replace(capitalRE, '-$1').toLowerCase(), value) - return data !== null ? deserializeValue(data) : undefined - }, - val: function(value){ - return arguments.length === 0 ? - (this[0] && (this[0].multiple ? - $(this[0]).find('option').filter(function(){ return this.selected }).pluck('value') : - this[0].value) - ) : - this.each(function(idx){ - this.value = funcArg(this, value, idx, this.value) - }) - }, - offset: function(coordinates){ - if (coordinates) return this.each(function(index){ - var $this = $(this), - coords = funcArg(this, coordinates, index, $this.offset()), - parentOffset = $this.offsetParent().offset(), - props = { - top: coords.top - parentOffset.top, - left: coords.left - parentOffset.left - } - - if ($this.css('position') == 'static') props['position'] = 'relative' - $this.css(props) - }) - if (this.length==0) return null - var obj = this[0].getBoundingClientRect() - return { - left: obj.left + window.pageXOffset, - top: obj.top + window.pageYOffset, - width: Math.round(obj.width), - height: Math.round(obj.height) - } - }, - css: function(property, value){ - if (arguments.length < 2) { - var element = this[0], computedStyle = getComputedStyle(element, '') - if(!element) return - if (typeof property == 'string') - return element.style[camelize(property)] || computedStyle.getPropertyValue(property) - else if (isArray(property)) { - var props = {} - $.each(isArray(property) ? property: [property], function(_, prop){ - props[prop] = (element.style[camelize(prop)] || computedStyle.getPropertyValue(prop)) - }) - return props - } - } - - var css = '' - if (type(property) == 'string') { - if (!value && value !== 0) - this.each(function(){ this.style.removeProperty(dasherize(property)) }) - else - css = dasherize(property) + ":" + maybeAddPx(property, value) - } else { - for (key in property) - if (!property[key] && property[key] !== 0) - this.each(function(){ this.style.removeProperty(dasherize(key)) }) - else - css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';' - } - - return this.each(function(){ this.style.cssText += ';' + css }) - }, - index: function(element){ - return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0]) - }, - hasClass: function(name){ - if (!name) return false - return emptyArray.some.call(this, function(el){ - return this.test(className(el)) - }, classRE(name)) - }, - addClass: function(name){ - if (!name) return this - return this.each(function(idx){ - classList = [] - var cls = className(this), newName = funcArg(this, name, idx, cls) - newName.split(/\s+/g).forEach(function(klass){ - if (!$(this).hasClass(klass)) classList.push(klass) - }, this) - classList.length && className(this, cls + (cls ? " " : "") + classList.join(" ")) - }) - }, - removeClass: function(name){ - return this.each(function(idx){ - if (name === undefined) return className(this, '') - classList = className(this) - funcArg(this, name, idx, classList).split(/\s+/g).forEach(function(klass){ - classList = classList.replace(classRE(klass), " ") - }) - className(this, classList.trim()) - }) - }, - toggleClass: function(name, when){ - if (!name) return this - return this.each(function(idx){ - var $this = $(this), names = funcArg(this, name, idx, className(this)) - names.split(/\s+/g).forEach(function(klass){ - (when === undefined ? !$this.hasClass(klass) : when) ? - $this.addClass(klass) : $this.removeClass(klass) - }) - }) - }, - scrollTop: function(value){ - if (!this.length) return - var hasScrollTop = 'scrollTop' in this[0] - if (value === undefined) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset - return this.each(hasScrollTop ? - function(){ this.scrollTop = value } : - function(){ this.scrollTo(this.scrollX, value) }) - }, - scrollLeft: function(value){ - if (!this.length) return - var hasScrollLeft = 'scrollLeft' in this[0] - if (value === undefined) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset - return this.each(hasScrollLeft ? - function(){ this.scrollLeft = value } : - function(){ this.scrollTo(value, this.scrollY) }) - }, - position: function() { - if (!this.length) return - - var elem = this[0], - // Get *real* offsetParent - offsetParent = this.offsetParent(), - // Get correct offsets - offset = this.offset(), - parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset() - - // Subtract element margins - // note: when an element has margin: auto the offsetLeft and marginLeft - // are the same in Safari causing offset.left to incorrectly be 0 - offset.top -= parseFloat( $(elem).css('margin-top') ) || 0 - offset.left -= parseFloat( $(elem).css('margin-left') ) || 0 - - // Add offsetParent borders - parentOffset.top += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0 - parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0 - - // Subtract the two offsets - return { - top: offset.top - parentOffset.top, - left: offset.left - parentOffset.left - } - }, - offsetParent: function() { - return this.map(function(){ - var parent = this.offsetParent || document.body - while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css("position") == "static") - parent = parent.offsetParent - return parent - }) - } - } - - // for now - $.fn.detach = $.fn.remove - - // Generate the `width` and `height` functions - ;['width', 'height'].forEach(function(dimension){ - var dimensionProperty = - dimension.replace(/./, function(m){ return m[0].toUpperCase() }) - - $.fn[dimension] = function(value){ - var offset, el = this[0] - if (value === undefined) return isWindow(el) ? el['inner' + dimensionProperty] : - isDocument(el) ? el.documentElement['scroll' + dimensionProperty] : - (offset = this.offset()) && offset[dimension] - else return this.each(function(idx){ - el = $(this) - el.css(dimension, funcArg(this, value, idx, el[dimension]())) - }) - } - }) - - function traverseNode(node, fun) { - fun(node) - for (var key in node.childNodes) traverseNode(node.childNodes[key], fun) - } - - // Generate the `after`, `prepend`, `before`, `append`, - // `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods. - adjacencyOperators.forEach(function(operator, operatorIndex) { - var inside = operatorIndex % 2 //=> prepend, append - - $.fn[operator] = function(){ - // arguments can be nodes, arrays of nodes, Zepto objects and HTML strings - var argType, nodes = $.map(arguments, function(arg) { - argType = type(arg) - return argType == "object" || argType == "array" || arg == null ? - arg : zepto.fragment(arg) - }), - parent, copyByClone = this.length > 1 - if (nodes.length < 1) return this - - return this.each(function(_, target){ - parent = inside ? target : target.parentNode - - // convert all methods to a "before" operation - target = operatorIndex == 0 ? target.nextSibling : - operatorIndex == 1 ? target.firstChild : - operatorIndex == 2 ? target : - null - - nodes.forEach(function(node){ - if (copyByClone) node = node.cloneNode(true) - else if (!parent) return $(node).remove() - - traverseNode(parent.insertBefore(node, target), function(el){ - if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' && - (!el.type || el.type === 'text/javascript') && !el.src) - window['eval'].call(window, el.innerHTML) - }) - }) - }) - } - - // after => insertAfter - // prepend => prependTo - // before => insertBefore - // append => appendTo - $.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){ - $(html)[operator](this) - return this - } - }) - - zepto.Z.prototype = $.fn - - // Export internal API functions in the `$.zepto` namespace - zepto.uniq = uniq - zepto.deserializeValue = deserializeValue - $.zepto = zepto - - return $ -})() - -window.Zepto = Zepto -window.$ === undefined && (window.$ = Zepto) - -;(function($){ - var jsonpID = 0, - document = window.document, - key, - name, - rscript = /)<[^<]*)*<\/script>/gi, - scriptTypeRE = /^(?:text|application)\/javascript/i, - xmlTypeRE = /^(?:text|application)\/xml/i, - jsonType = 'application/json', - htmlType = 'text/html', - blankRE = /^\s*$/ - - // trigger a custom event and return false if it was cancelled - function triggerAndReturn(context, eventName, data) { - var event = $.Event(eventName) - $(context).trigger(event, data) - return !event.isDefaultPrevented() - } - - // trigger an Ajax "global" event - function triggerGlobal(settings, context, eventName, data) { - if (settings.global) return triggerAndReturn(context || document, eventName, data) - } - - // Number of active Ajax requests - $.active = 0 - - function ajaxStart(settings) { - if (settings.global && $.active++ === 0) triggerGlobal(settings, null, 'ajaxStart') - } - function ajaxStop(settings) { - if (settings.global && !(--$.active)) triggerGlobal(settings, null, 'ajaxStop') - } - - // triggers an extra global event "ajaxBeforeSend" that's like "ajaxSend" but cancelable - function ajaxBeforeSend(xhr, settings) { - var context = settings.context - if (settings.beforeSend.call(context, xhr, settings) === false || - triggerGlobal(settings, context, 'ajaxBeforeSend', [xhr, settings]) === false) - return false - - triggerGlobal(settings, context, 'ajaxSend', [xhr, settings]) - } - function ajaxSuccess(data, xhr, settings, deferred) { - var context = settings.context, status = 'success' - settings.success.call(context, data, status, xhr) - if (deferred) deferred.resolveWith(context, [data, status, xhr]) - triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data]) - ajaxComplete(status, xhr, settings) - } - // type: "timeout", "error", "abort", "parsererror" - function ajaxError(error, type, xhr, settings, deferred) { - var context = settings.context - settings.error.call(context, xhr, type, error) - if (deferred) deferred.rejectWith(context, [xhr, type, error]) - triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error || type]) - ajaxComplete(type, xhr, settings) - } - // status: "success", "notmodified", "error", "timeout", "abort", "parsererror" - function ajaxComplete(status, xhr, settings) { - var context = settings.context - settings.complete.call(context, xhr, status) - triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings]) - ajaxStop(settings) - } - - // Empty function, used as default callback - function empty() {} - - $.ajaxJSONP = function(options, deferred){ - if (!('type' in options)) return $.ajax(options) - - var _callbackName = options.jsonpCallback, - callbackName = ($.isFunction(_callbackName) ? - _callbackName() : _callbackName) || ('jsonp' + (++jsonpID)), - script = document.createElement('script'), - originalCallback = window[callbackName], - responseData, - abort = function(errorType) { - $(script).triggerHandler('error', errorType || 'abort') - }, - xhr = { abort: abort }, abortTimeout - - if (deferred) deferred.promise(xhr) - - $(script).on('load error', function(e, errorType){ - clearTimeout(abortTimeout) - $(script).off().remove() - - if (e.type == 'error' || !responseData) { - ajaxError(null, errorType || 'error', xhr, options, deferred) - } else { - ajaxSuccess(responseData[0], xhr, options, deferred) - } - - window[callbackName] = originalCallback - if (responseData && $.isFunction(originalCallback)) - originalCallback(responseData[0]) - - originalCallback = responseData = undefined - }) - - if (ajaxBeforeSend(xhr, options) === false) { - abort('abort') - return xhr - } - - window[callbackName] = function(){ - responseData = arguments - } - - script.src = options.url.replace(/=\?/, '=' + callbackName) - document.head.appendChild(script) - - if (options.timeout > 0) abortTimeout = setTimeout(function(){ - abort('timeout') - }, options.timeout) - - return xhr - } - - $.ajaxSettings = { - // Default type of request - type: 'GET', - // Callback that is executed before request - beforeSend: empty, - // Callback that is executed if the request succeeds - success: empty, - // Callback that is executed the the server drops error - error: empty, - // Callback that is executed on request complete (both: error and success) - complete: empty, - // The context for the callbacks - context: null, - // Whether to trigger "global" Ajax events - global: true, - // Transport - xhr: function () { - return new window.XMLHttpRequest() - }, - // MIME types mapping - // IIS returns Javascript as "application/x-javascript" - accepts: { - script: 'text/javascript, application/javascript, application/x-javascript', - json: jsonType, - xml: 'application/xml, text/xml', - html: htmlType, - text: 'text/plain' - }, - // Whether the request is to another domain - crossDomain: false, - // Default timeout - timeout: 0, - // Whether data should be serialized to string - processData: true, - // Whether the browser should be allowed to cache GET responses - cache: true - } - - function mimeToDataType(mime) { - if (mime) mime = mime.split(';', 2)[0] - return mime && ( mime == htmlType ? 'html' : - mime == jsonType ? 'json' : - scriptTypeRE.test(mime) ? 'script' : - xmlTypeRE.test(mime) && 'xml' ) || 'text' - } - - function appendQuery(url, query) { - if (query == '') return url - return (url + '&' + query).replace(/[&?]{1,2}/, '?') - } - - // serialize payload and append it to the URL for GET requests - function serializeData(options) { - if (options.processData && options.data && $.type(options.data) != "string") - options.data = $.param(options.data, options.traditional) - if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) - options.url = appendQuery(options.url, options.data), options.data = undefined - } - - $.ajax = function(options){ - var settings = $.extend({}, options || {}), - deferred = $.Deferred && $.Deferred() - for (key in $.ajaxSettings) if (settings[key] === undefined) settings[key] = $.ajaxSettings[key] - - ajaxStart(settings) - - if (!settings.crossDomain) settings.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(settings.url) && - RegExp.$2 != window.location.host - - if (!settings.url) settings.url = window.location.toString() - serializeData(settings) - if (settings.cache === false) settings.url = appendQuery(settings.url, '_=' + Date.now()) - - var dataType = settings.dataType, hasPlaceholder = /=\?/.test(settings.url) - if (dataType == 'jsonp' || hasPlaceholder) { - if (!hasPlaceholder) - settings.url = appendQuery(settings.url, - settings.jsonp ? (settings.jsonp + '=?') : settings.jsonp === false ? '' : 'callback=?') - return $.ajaxJSONP(settings, deferred) - } - - var mime = settings.accepts[dataType], - headers = { }, - setHeader = function(name, value) { headers[name.toLowerCase()] = [name, value] }, - protocol = /^([\w-]+:)\/\//.test(settings.url) ? RegExp.$1 : window.location.protocol, - xhr = settings.xhr(), - nativeSetHeader = xhr.setRequestHeader, - abortTimeout - - if (deferred) deferred.promise(xhr) - - if (!settings.crossDomain) setHeader('X-Requested-With', 'XMLHttpRequest') - setHeader('Accept', mime || '*/*') - if (mime = settings.mimeType || mime) { - if (mime.indexOf(',') > -1) mime = mime.split(',', 2)[0] - xhr.overrideMimeType && xhr.overrideMimeType(mime) - } - if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() != 'GET')) - setHeader('Content-Type', settings.contentType || 'application/x-www-form-urlencoded') - - if (settings.headers) for (name in settings.headers) setHeader(name, settings.headers[name]) - xhr.setRequestHeader = setHeader - - xhr.onreadystatechange = function(){ - if (xhr.readyState == 4) { - xhr.onreadystatechange = empty - clearTimeout(abortTimeout) - var result, error = false - if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) { - dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type')) - result = xhr.responseText - - try { - // http://perfectionkills.com/global-eval-what-are-the-options/ - if (dataType == 'script') (1,eval)(result) - else if (dataType == 'xml') result = xhr.responseXML - else if (dataType == 'json') result = blankRE.test(result) ? null : $.parseJSON(result) - } catch (e) { error = e } - - if (error) ajaxError(error, 'parsererror', xhr, settings, deferred) - else ajaxSuccess(result, xhr, settings, deferred) - } else { - ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings, deferred) - } - } - } - - if (ajaxBeforeSend(xhr, settings) === false) { - xhr.abort() - ajaxError(null, 'abort', xhr, settings, deferred) - return xhr - } - - if (settings.xhrFields) for (name in settings.xhrFields) xhr[name] = settings.xhrFields[name] - - var async = 'async' in settings ? settings.async : true - xhr.open(settings.type, settings.url, async, settings.username, settings.password) - - for (name in headers) nativeSetHeader.apply(xhr, headers[name]) - - if (settings.timeout > 0) abortTimeout = setTimeout(function(){ - xhr.onreadystatechange = empty - xhr.abort() - ajaxError(null, 'timeout', xhr, settings, deferred) - }, settings.timeout) - - // avoid sending empty string (#319) - xhr.send(settings.data ? settings.data : null) - return xhr - } - - // handle optional data/success arguments - function parseArguments(url, data, success, dataType) { - var hasData = !$.isFunction(data) - return { - url: url, - data: hasData ? data : undefined, - success: !hasData ? data : $.isFunction(success) ? success : undefined, - dataType: hasData ? dataType || success : success - } - } - - $.get = function(url, data, success, dataType){ - return $.ajax(parseArguments.apply(null, arguments)) - } - - $.post = function(url, data, success, dataType){ - var options = parseArguments.apply(null, arguments) - options.type = 'POST' - return $.ajax(options) - } - - $.getJSON = function(url, data, success){ - var options = parseArguments.apply(null, arguments) - options.dataType = 'json' - return $.ajax(options) - } - - $.fn.load = function(url, data, success){ - if (!this.length) return this - var self = this, parts = url.split(/\s/), selector, - options = parseArguments(url, data, success), - callback = options.success - if (parts.length > 1) options.url = parts[0], selector = parts[1] - options.success = function(response){ - self.html(selector ? - $('
').html(response.replace(rscript, "")).find(selector) - : response) - callback && callback.apply(self, arguments) - } - $.ajax(options) - return this - } - - var escape = encodeURIComponent - - function serialize(params, obj, traditional, scope){ - var type, array = $.isArray(obj), hash = $.isPlainObject(obj) - $.each(obj, function(key, value) { - type = $.type(value) - if (scope) key = traditional ? scope : - scope + '[' + (hash || type == 'object' || type == 'array' ? key : '') + ']' - // handle data in serializeArray() format - if (!scope && array) params.add(value.name, value.value) - // recurse into nested objects - else if (type == "array" || (!traditional && type == "object")) - serialize(params, value, traditional, key) - else params.add(key, value) - }) - } - - $.param = function(obj, traditional){ - var params = [] - params.add = function(k, v){ this.push(escape(k) + '=' + escape(v)) } - serialize(params, obj, traditional) - return params.join('&').replace(/%20/g, '+') - } -})(Zepto) - -;(function($){ - var $$ = $.zepto.qsa, _zid = 1, undefined, - slice = Array.prototype.slice, - isFunction = $.isFunction, - isString = function(obj){ return typeof obj == 'string' }, - handlers = {}, - specialEvents={}, - focusinSupported = 'onfocusin' in window, - focus = { focus: 'focusin', blur: 'focusout' }, - hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' } - - specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = 'MouseEvents' - - function zid(element) { - return element._zid || (element._zid = _zid++) - } - function findHandlers(element, event, fn, selector) { - event = parse(event) - if (event.ns) var matcher = matcherFor(event.ns) - return (handlers[zid(element)] || []).filter(function(handler) { - return handler - && (!event.e || handler.e == event.e) - && (!event.ns || matcher.test(handler.ns)) - && (!fn || zid(handler.fn) === zid(fn)) - && (!selector || handler.sel == selector) - }) - } - function parse(event) { - var parts = ('' + event).split('.') - return {e: parts[0], ns: parts.slice(1).sort().join(' ')} - } - function matcherFor(ns) { - return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)') - } - - function eventCapture(handler, captureSetting) { - return handler.del && - (!focusinSupported && (handler.e in focus)) || - !!captureSetting - } - - function realEvent(type) { - return hover[type] || (focusinSupported && focus[type]) || type - } - - function add(element, events, fn, data, selector, delegator, capture){ - var id = zid(element), set = (handlers[id] || (handlers[id] = [])) - events.split(/\s/).forEach(function(event){ - if (event == 'ready') return $(document).ready(fn) - var handler = parse(event) - handler.fn = fn - handler.sel = selector - // emulate mouseenter, mouseleave - if (handler.e in hover) fn = function(e){ - var related = e.relatedTarget - if (!related || (related !== this && !$.contains(this, related))) - return handler.fn.apply(this, arguments) - } - handler.del = delegator - var callback = delegator || fn - handler.proxy = function(e){ - e = compatible(e) - if (e.isImmediatePropagationStopped()) return - e.data = data - var result = callback.apply(element, e._args == undefined ? [e] : [e].concat(e._args)) - if (result === false) e.preventDefault(), e.stopPropagation() - return result - } - handler.i = set.length - set.push(handler) - if ('addEventListener' in element) - element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) - }) - } - function remove(element, events, fn, selector, capture){ - var id = zid(element) - ;(events || '').split(/\s/).forEach(function(event){ - findHandlers(element, event, fn, selector).forEach(function(handler){ - delete handlers[id][handler.i] - if ('removeEventListener' in element) - element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)) - }) - }) - } - - $.event = { add: add, remove: remove } - - $.proxy = function(fn, context) { - if (isFunction(fn)) { - var proxyFn = function(){ return fn.apply(context, arguments) } - proxyFn._zid = zid(fn) - return proxyFn - } else if (isString(context)) { - return $.proxy(fn[context], fn) - } else { - throw new TypeError("expected function") - } - } - - $.fn.bind = function(event, data, callback){ - return this.on(event, data, callback) - } - $.fn.unbind = function(event, callback){ - return this.off(event, callback) - } - $.fn.one = function(event, selector, data, callback){ - return this.on(event, selector, data, callback, 1) - } - - var returnTrue = function(){return true}, - returnFalse = function(){return false}, - ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$)/, - eventMethods = { - preventDefault: 'isDefaultPrevented', - stopImmediatePropagation: 'isImmediatePropagationStopped', - stopPropagation: 'isPropagationStopped' - } - - function compatible(event, source) { - if (source || !event.isDefaultPrevented) { - source || (source = event) - - $.each(eventMethods, function(name, predicate) { - var sourceMethod = source[name] - event[name] = function(){ - this[predicate] = returnTrue - return sourceMethod && sourceMethod.apply(source, arguments) - } - event[predicate] = returnFalse - }) - - if (source.defaultPrevented !== undefined ? source.defaultPrevented : - 'returnValue' in source ? source.returnValue === false : - source.getPreventDefault && source.getPreventDefault()) - event.isDefaultPrevented = returnTrue - } - return event - } - - function createProxy(event) { - var key, proxy = { originalEvent: event } - for (key in event) - if (!ignoreProperties.test(key) && event[key] !== undefined) proxy[key] = event[key] - - return compatible(proxy, event) - } - - $.fn.delegate = function(selector, event, callback){ - return this.on(event, selector, callback) - } - $.fn.undelegate = function(selector, event, callback){ - return this.off(event, selector, callback) - } - - $.fn.live = function(event, callback){ - $(document.body).delegate(this.selector, event, callback) - return this - } - $.fn.die = function(event, callback){ - $(document.body).undelegate(this.selector, event, callback) - return this - } - - $.fn.on = function(event, selector, data, callback, one){ - var autoRemove, delegator, $this = this - if (event && !isString(event)) { - $.each(event, function(type, fn){ - $this.on(type, selector, data, fn, one) - }) - return $this - } - - if (!isString(selector) && !isFunction(callback) && callback !== false) - callback = data, data = selector, selector = undefined - if (isFunction(data) || data === false) - callback = data, data = undefined - - if (callback === false) callback = returnFalse - - return $this.each(function(_, element){ - if (one) autoRemove = function(e){ - remove(element, e.type, callback) - return callback.apply(this, arguments) - } - - if (selector) delegator = function(e){ - var evt, match = $(e.target).closest(selector, element).get(0) - if (match && match !== element) { - evt = $.extend(createProxy(e), {currentTarget: match, liveFired: element}) - return (autoRemove || callback).apply(match, [evt].concat(slice.call(arguments, 1))) - } - } - - add(element, event, callback, data, selector, delegator || autoRemove) - }) - } - $.fn.off = function(event, selector, callback){ - var $this = this - if (event && !isString(event)) { - $.each(event, function(type, fn){ - $this.off(type, selector, fn) - }) - return $this - } - - if (!isString(selector) && !isFunction(callback) && callback !== false) - callback = selector, selector = undefined - - if (callback === false) callback = returnFalse - - return $this.each(function(){ - remove(this, event, callback, selector) - }) - } - - $.fn.trigger = function(event, args){ - event = (isString(event) || $.isPlainObject(event)) ? $.Event(event) : compatible(event) - event._args = args - return this.each(function(){ - // items in the collection might not be DOM elements - if('dispatchEvent' in this) this.dispatchEvent(event) - else $(this).triggerHandler(event, args) - }) - } - - // triggers event handlers on current element just as if an event occurred, - // doesn't trigger an actual event, doesn't bubble - $.fn.triggerHandler = function(event, args){ - var e, result - this.each(function(i, element){ - e = createProxy(isString(event) ? $.Event(event) : event) - e._args = args - e.target = element - $.each(findHandlers(element, event.type || event), function(i, handler){ - result = handler.proxy(e) - if (e.isImmediatePropagationStopped()) return false - }) - }) - return result - } - - // shortcut methods for `.bind(event, fn)` for each event type - ;('focusin focusout load resize scroll unload click dblclick '+ - 'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+ - 'change select keydown keypress keyup error').split(' ').forEach(function(event) { - $.fn[event] = function(callback) { - return callback ? - this.bind(event, callback) : - this.trigger(event) - } - }) - - ;['focus', 'blur'].forEach(function(name) { - $.fn[name] = function(callback) { - if (callback) this.bind(name, callback) - else this.each(function(){ - try { this[name]() } - catch(e) {} - }) - return this - } - }) - - $.Event = function(type, props) { - if (!isString(type)) props = type, type = props.type - var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true - if (props) for (var name in props) (name == 'bubbles') ? (bubbles = !!props[name]) : (event[name] = props[name]) - event.initEvent(type, bubbles, true) - return compatible(event) - } - -})(Zepto) - -;(function($, undefined){ - var prefix = '', eventPrefix, endEventName, endAnimationName, - vendors = { Webkit: 'webkit', Moz: '', O: 'o' }, - document = window.document, testEl = document.createElement('div'), - supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i, - transform, - transitionProperty, transitionDuration, transitionTiming, transitionDelay, - animationName, animationDuration, animationTiming, animationDelay, - cssReset = {} - - function dasherize(str) { return str.replace(/([a-z])([A-Z])/, '$1-$2').toLowerCase() } - function normalizeEvent(name) { return eventPrefix ? eventPrefix + name : name.toLowerCase() } - - $.each(vendors, function(vendor, event){ - if (testEl.style[vendor + 'TransitionProperty'] !== undefined) { - prefix = '-' + vendor.toLowerCase() + '-' - eventPrefix = event - return false - } - }) - - transform = prefix + 'transform' - cssReset[transitionProperty = prefix + 'transition-property'] = - cssReset[transitionDuration = prefix + 'transition-duration'] = - cssReset[transitionDelay = prefix + 'transition-delay'] = - cssReset[transitionTiming = prefix + 'transition-timing-function'] = - cssReset[animationName = prefix + 'animation-name'] = - cssReset[animationDuration = prefix + 'animation-duration'] = - cssReset[animationDelay = prefix + 'animation-delay'] = - cssReset[animationTiming = prefix + 'animation-timing-function'] = '' - - $.fx = { - off: (eventPrefix === undefined && testEl.style.transitionProperty === undefined), - speeds: { _default: 400, fast: 200, slow: 600 }, - cssPrefix: prefix, - transitionEnd: normalizeEvent('TransitionEnd'), - animationEnd: normalizeEvent('AnimationEnd') - } - - $.fn.animate = function(properties, duration, ease, callback, delay){ - if ($.isFunction(duration)) - callback = duration, ease = undefined, duration = undefined - if ($.isFunction(ease)) - callback = ease, ease = undefined - if ($.isPlainObject(duration)) - ease = duration.easing, callback = duration.complete, delay = duration.delay, duration = duration.duration - if (duration) duration = (typeof duration == 'number' ? duration : - ($.fx.speeds[duration] || $.fx.speeds._default)) / 1000 - if (delay) delay = parseFloat(delay) / 1000 - return this.anim(properties, duration, ease, callback, delay) - } - - $.fn.anim = function(properties, duration, ease, callback, delay){ - var key, cssValues = {}, cssProperties, transforms = '', - that = this, wrappedCallback, endEvent = $.fx.transitionEnd, - fired = false - - if (duration === undefined) duration = $.fx.speeds._default / 1000 - if (delay === undefined) delay = 0 - if ($.fx.off) duration = 0 - - if (typeof properties == 'string') { - // keyframe animation - cssValues[animationName] = properties - cssValues[animationDuration] = duration + 's' - cssValues[animationDelay] = delay + 's' - cssValues[animationTiming] = (ease || 'linear') - endEvent = $.fx.animationEnd - } else { - cssProperties = [] - // CSS transitions - for (key in properties) - if (supportedTransforms.test(key)) transforms += key + '(' + properties[key] + ') ' - else cssValues[key] = properties[key], cssProperties.push(dasherize(key)) - - if (transforms) cssValues[transform] = transforms, cssProperties.push(transform) - if (duration > 0 && typeof properties === 'object') { - cssValues[transitionProperty] = cssProperties.join(', ') - cssValues[transitionDuration] = duration + 's' - cssValues[transitionDelay] = delay + 's' - cssValues[transitionTiming] = (ease || 'linear') - } - } - - wrappedCallback = function(event){ - if (typeof event !== 'undefined') { - if (event.target !== event.currentTarget) return // makes sure the event didn't bubble from "below" - $(event.target).unbind(endEvent, wrappedCallback) - } else - $(this).unbind(endEvent, wrappedCallback) // triggered by setTimeout - - fired = true - $(this).css(cssReset) - callback && callback.call(this) - } - if (duration > 0){ - this.bind(endEvent, wrappedCallback) - // transitionEnd is not always firing on older Android phones - // so make sure it gets fired - setTimeout(function(){ - if (fired) return - wrappedCallback.call(that) - }, (duration * 1000) + 25) - } - - // trigger page reflow so new elements can animate - this.size() && this.get(0).clientLeft - - this.css(cssValues) - - if (duration <= 0) setTimeout(function() { - that.each(function(){ wrappedCallback.call(this) }) - }, 0) - - return this - } - - testEl = null -})(Zepto) - -;(function($, undefined){ - var document = window.document, docElem = document.documentElement, - origShow = $.fn.show, origHide = $.fn.hide, origToggle = $.fn.toggle - - function anim(el, speed, opacity, scale, callback) { - if (typeof speed == 'function' && !callback) callback = speed, speed = undefined - var props = { opacity: opacity } - if (scale) { - props.scale = scale - el.css($.fx.cssPrefix + 'transform-origin', '0 0') - } - return el.animate(props, speed, null, callback) - } - - function hide(el, speed, scale, callback) { - return anim(el, speed, 0, scale, function(){ - origHide.call($(this)) - callback && callback.call(this) - }) - } - - $.fn.show = function(speed, callback) { - origShow.call(this) - if (speed === undefined) speed = 0 - else this.css('opacity', 0) - return anim(this, speed, 1, '1,1', callback) - } - - $.fn.hide = function(speed, callback) { - if (speed === undefined) return origHide.call(this) - else return hide(this, speed, '0,0', callback) - } - - $.fn.toggle = function(speed, callback) { - if (speed === undefined || typeof speed == 'boolean') - return origToggle.call(this, speed) - else return this.each(function(){ - var el = $(this) - el[el.css('display') == 'none' ? 'show' : 'hide'](speed, callback) - }) - } - - $.fn.fadeTo = function(speed, opacity, callback) { - return anim(this, speed, opacity, null, callback) - } - - $.fn.fadeIn = function(speed, callback) { - var target = this.css('opacity') - if (target > 0) this.css('opacity', 0) - else target = 1 - return origShow.call(this).fadeTo(speed, target, callback) - } - - $.fn.fadeOut = function(speed, callback) { - return hide(this, speed, null, callback) - } - - $.fn.fadeToggle = function(speed, callback) { - return this.each(function(){ - var el = $(this) - el[ - (el.css('opacity') == 0 || el.css('display') == 'none') ? 'fadeIn' : 'fadeOut' - ](speed, callback) - }) - } - -})(Zepto) - -;(function($){ - var zepto = $.zepto, oldQsa = zepto.qsa, oldMatches = zepto.matches - - function visible(elem){ - elem = $(elem) - return !!(elem.width() || elem.height()) && elem.css("display") !== "none" - } - - // Implements a subset from: - // http://api.jquery.com/category/selectors/jquery-selector-extensions/ - // - // Each filter function receives the current index, all nodes in the - // considered set, and a value if there were parentheses. The value - // of `this` is the node currently being considered. The function returns the - // resulting node(s), null, or undefined. - // - // Complex selectors are not supported: - // li:has(label:contains("foo")) + li:has(label:contains("bar")) - // ul.inner:first > li - var filters = $.expr[':'] = { - visible: function(){ if (visible(this)) return this }, - hidden: function(){ if (!visible(this)) return this }, - selected: function(){ if (this.selected) return this }, - checked: function(){ if (this.checked) return this }, - parent: function(){ return this.parentNode }, - first: function(idx){ if (idx === 0) return this }, - last: function(idx, nodes){ if (idx === nodes.length - 1) return this }, - eq: function(idx, _, value){ if (idx === value) return this }, - contains: function(idx, _, text){ if ($(this).text().indexOf(text) > -1) return this }, - has: function(idx, _, sel){ if (zepto.qsa(this, sel).length) return this } - } - - var filterRe = new RegExp('(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*'), - childRe = /^\s*>/, - classTag = 'Zepto' + (+new Date()) - - function process(sel, fn) { - // quote the hash in `a[href^=#]` expression - sel = sel.replace(/=#\]/g, '="#"]') - var filter, arg, match = filterRe.exec(sel) - if (match && match[2] in filters) { - filter = filters[match[2]], arg = match[3] - sel = match[1] - if (arg) { - var num = Number(arg) - if (isNaN(num)) arg = arg.replace(/^["']|["']$/g, '') - else arg = num - } - } - return fn(sel, filter, arg) - } - - zepto.qsa = function(node, selector) { - return process(selector, function(sel, filter, arg){ - try { - var taggedParent - if (!sel && filter) sel = '*' - else if (childRe.test(sel)) - // support "> *" child queries by tagging the parent node with a - // unique class and prepending that classname onto the selector - taggedParent = $(node).addClass(classTag), sel = '.'+classTag+' '+sel - - var nodes = oldQsa(node, sel) - } catch(e) { - console.error('error performing selector: %o', selector) - throw e - } finally { - if (taggedParent) taggedParent.removeClass(classTag) - } - return !filter ? nodes : - zepto.uniq($.map(nodes, function(n, i){ return filter.call(n, i, nodes, arg) })) - }) - } - - zepto.matches = function(node, selector){ - return process(selector, function(sel, filter, arg){ - return (!sel || oldMatches(node, sel)) && - (!filter || filter.call(node, null, arg) === node) - }) - } -})(Zepto) - -;(function($){ - var touch = {}, - touchTimeout, tapTimeout, swipeTimeout, longTapTimeout, - longTapDelay = 750, - gesture - - function swipeDirection(x1, x2, y1, y2) { - return Math.abs(x1 - x2) >= - Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down') - } - - function longTap() { - longTapTimeout = null - if (touch.last) { - touch.el.trigger('longTap') - touch = {} - } - } - - function cancelLongTap() { - if (longTapTimeout) clearTimeout(longTapTimeout) - longTapTimeout = null - } - - function cancelAll() { - if (touchTimeout) clearTimeout(touchTimeout) - if (tapTimeout) clearTimeout(tapTimeout) - if (swipeTimeout) clearTimeout(swipeTimeout) - if (longTapTimeout) clearTimeout(longTapTimeout) - touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null - touch = {} - } - - function isPrimaryTouch(event){ - return (event.pointerType == 'touch' || - event.pointerType == event.MSPOINTER_TYPE_TOUCH) - && event.isPrimary - } - - function isPointerEventType(e, type){ - return (e.type == 'pointer'+type || - e.type.toLowerCase() == 'mspointer'+type) - } - - $(document).ready(function(){ - var now, delta, deltaX = 0, deltaY = 0, firstTouch, _isPointerType - - if ('MSGesture' in window) { - gesture = new MSGesture() - gesture.target = document.body - } - - $(document) - .bind('MSGestureEnd', function(e){ - var swipeDirectionFromVelocity = - e.velocityX > 1 ? 'Right' : e.velocityX < -1 ? 'Left' : e.velocityY > 1 ? 'Down' : e.velocityY < -1 ? 'Up' : null; - if (swipeDirectionFromVelocity) { - touch.el.trigger('swipe') - touch.el.trigger('swipe'+ swipeDirectionFromVelocity) - } - }) - .on('touchstart MSPointerDown pointerdown', function(e){ - if((_isPointerType = isPointerEventType(e, 'down')) && - !isPrimaryTouch(e)) return - firstTouch = _isPointerType ? e : e.touches[0] - if (e.touches && e.touches.length === 1 && touch.x2) { - // Clear out touch movement data if we have it sticking around - // This can occur if touchcancel doesn't fire due to preventDefault, etc. - touch.x2 = undefined - touch.y2 = undefined - } - now = Date.now() - delta = now - (touch.last || now) - touch.el = $('tagName' in firstTouch.target ? - firstTouch.target : firstTouch.target.parentNode) - touchTimeout && clearTimeout(touchTimeout) - touch.x1 = firstTouch.pageX - touch.y1 = firstTouch.pageY - if (delta > 0 && delta <= 250) touch.isDoubleTap = true - touch.last = now - longTapTimeout = setTimeout(longTap, longTapDelay) - // adds the current touch contact for IE gesture recognition - if (gesture && _isPointerType) gesture.addPointer(e.pointerId); - }) - .on('touchmove MSPointerMove pointermove', function(e){ - if((_isPointerType = isPointerEventType(e, 'move')) && - !isPrimaryTouch(e)) return - firstTouch = _isPointerType ? e : e.touches[0] - cancelLongTap() - touch.x2 = firstTouch.pageX - touch.y2 = firstTouch.pageY - - deltaX += Math.abs(touch.x1 - touch.x2) - deltaY += Math.abs(touch.y1 - touch.y2) - }) - .on('touchend MSPointerUp pointerup', function(e){ - if((_isPointerType = isPointerEventType(e, 'up')) && - !isPrimaryTouch(e)) return - cancelLongTap() - - // swipe - if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) || - (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30)) - - swipeTimeout = setTimeout(function() { - touch.el.trigger('swipe') - touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2))) - touch = {} - }, 0) - - // normal tap - else if ('last' in touch) - // don't fire tap when delta position changed by more than 30 pixels, - // for instance when moving to a point and back to origin - if (deltaX < 30 && deltaY < 30) { - // delay by one tick so we can cancel the 'tap' event if 'scroll' fires - // ('tap' fires before 'scroll') - tapTimeout = setTimeout(function() { - - // trigger universal 'tap' with the option to cancelTouch() - // (cancelTouch cancels processing of single vs double taps for faster 'tap' response) - var event = $.Event('tap') - event.cancelTouch = cancelAll - touch.el.trigger(event) - - // trigger double tap immediately - if (touch.isDoubleTap) { - if (touch.el) touch.el.trigger('doubleTap') - touch = {} - } - - // trigger single tap after 250ms of inactivity - else { - touchTimeout = setTimeout(function(){ - touchTimeout = null - if (touch.el) touch.el.trigger('singleTap') - touch = {} - }, 250) - } - }, 0) - } else { - touch = {} - } - deltaX = deltaY = 0 - - }) - // when the browser window loses focus, - // for example when a modal dialog is shown, - // cancel all ongoing events - .on('touchcancel MSPointerCancel pointercancel', cancelAll) - - // scrolling the window indicates intention of the user - // to scroll, not tap or swipe, so cancel all ongoing events - $(window).on('scroll', cancelAll) - }) - - ;['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', - 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(eventName){ - $.fn[eventName] = function(callback){ return this.on(eventName, callback) } - }) -})(Zepto) diff --git a/js/zepto.min.js b/js/zepto.min.js new file mode 100644 index 0000000..4821a1c --- /dev/null +++ b/js/zepto.min.js @@ -0,0 +1,2 @@ +/* Zepto v1.2.0 - zepto event ajax form ie - zeptojs.com/license */ +!function(t,e){"function"==typeof define&&define.amd?define(function(){return e(t)}):e(t)}(this,function(t){var e=function(){function $(t){return null==t?String(t):S[C.call(t)]||"object"}function F(t){return"function"==$(t)}function k(t){return null!=t&&t==t.window}function M(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function R(t){return"object"==$(t)}function Z(t){return R(t)&&!k(t)&&Object.getPrototypeOf(t)==Object.prototype}function z(t){var e=!!t&&"length"in t&&t.length,n=r.type(t);return"function"!=n&&!k(t)&&("array"==n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function q(t){return a.call(t,function(t){return null!=t})}function H(t){return t.length>0?r.fn.concat.apply([],t):t}function I(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function V(t){return t in l?l[t]:l[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function _(t,e){return"number"!=typeof e||h[I(t)]?e:e+"px"}function B(t){var e,n;return c[t]||(e=f.createElement(t),f.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),c[t]=n),c[t]}function U(t){return"children"in t?u.call(t.children):r.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function X(t,e){var n,r=t?t.length:0;for(n=0;r>n;n++)this[n]=t[n];this.length=r,this.selector=e||""}function J(t,r,i){for(n in r)i&&(Z(r[n])||L(r[n]))?(Z(r[n])&&!Z(t[n])&&(t[n]={}),L(r[n])&&!L(t[n])&&(t[n]=[]),J(t[n],r[n],i)):r[n]!==e&&(t[n]=r[n])}function W(t,e){return null==e?r(t):r(t).filter(e)}function Y(t,e,n,r){return F(e)?e.call(t,n,r):e}function G(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function K(t,n){var r=t.className||"",i=r&&r.baseVal!==e;return n===e?i?r.baseVal:r:void(i?r.baseVal=n:t.className=n)}function Q(t){try{return t?"true"==t||("false"==t?!1:"null"==t?null:+t+""==t?+t:/^[\[\{]/.test(t)?r.parseJSON(t):t):t}catch(e){return t}}function tt(t,e){e(t);for(var n=0,r=t.childNodes.length;r>n;n++)tt(t.childNodes[n],e)}var e,n,r,i,O,P,o=[],s=o.concat,a=o.filter,u=o.slice,f=t.document,c={},l={},h={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},p=/^\s*<(\w+|!)[^>]*>/,d=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,m=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,g=/^(?:body|html)$/i,v=/([A-Z])/g,y=["val","css","html","text","data","width","height","offset"],x=["after","prepend","before","append"],b=f.createElement("table"),E=f.createElement("tr"),j={tr:f.createElement("tbody"),tbody:b,thead:b,tfoot:b,td:E,th:E,"*":f.createElement("div")},w=/complete|loaded|interactive/,T=/^[\w-]*$/,S={},C=S.toString,N={},A=f.createElement("div"),D={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},L=Array.isArray||function(t){return t instanceof Array};return N.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var r,i=t.parentNode,o=!i;return o&&(i=A).appendChild(t),r=~N.qsa(i,e).indexOf(t),o&&A.removeChild(t),r},O=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},P=function(t){return a.call(t,function(e,n){return t.indexOf(e)==n})},N.fragment=function(t,n,i){var o,s,a;return d.test(t)&&(o=r(f.createElement(RegExp.$1))),o||(t.replace&&(t=t.replace(m,"<$1>")),n===e&&(n=p.test(t)&&RegExp.$1),n in j||(n="*"),a=j[n],a.innerHTML=""+t,o=r.each(u.call(a.childNodes),function(){a.removeChild(this)})),Z(i)&&(s=r(o),r.each(i,function(t,e){y.indexOf(t)>-1?s[t](e):s.attr(t,e)})),o},N.Z=function(t,e){return new X(t,e)},N.isZ=function(t){return t instanceof N.Z},N.init=function(t,n){var i;if(!t)return N.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&p.test(t))i=N.fragment(t,RegExp.$1,n),t=null;else{if(n!==e)return r(n).find(t);i=N.qsa(f,t)}else{if(F(t))return r(f).ready(t);if(N.isZ(t))return t;if(L(t))i=q(t);else if(R(t))i=[t],t=null;else if(p.test(t))i=N.fragment(t.trim(),RegExp.$1,n),t=null;else{if(n!==e)return r(n).find(t);i=N.qsa(f,t)}}return N.Z(i,t)},r=function(t,e){return N.init(t,e)},r.extend=function(t){var e,n=u.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){J(t,n,e)}),t},N.qsa=function(t,e){var n,r="#"==e[0],i=!r&&"."==e[0],o=r||i?e.slice(1):e,s=T.test(o);return t.getElementById&&s&&r?(n=t.getElementById(o))?[n]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:u.call(s&&!r&&t.getElementsByClassName?i?t.getElementsByClassName(o):t.getElementsByTagName(e):t.querySelectorAll(e))},r.contains=f.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},r.type=$,r.isFunction=F,r.isWindow=k,r.isArray=L,r.isPlainObject=Z,r.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},r.isNumeric=function(t){var e=Number(t),n=typeof t;return null!=t&&"boolean"!=n&&("string"!=n||t.length)&&!isNaN(e)&&isFinite(e)||!1},r.inArray=function(t,e,n){return o.indexOf.call(e,t,n)},r.camelCase=O,r.trim=function(t){return null==t?"":String.prototype.trim.call(t)},r.uuid=0,r.support={},r.expr={},r.noop=function(){},r.map=function(t,e){var n,i,o,r=[];if(z(t))for(i=0;i=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return o.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return F(t)?this.not(this.not(t)):r(a.call(this,function(e){return N.matches(e,t)}))},add:function(t,e){return r(P(this.concat(r(t,e))))},is:function(t){return this.length>0&&N.matches(this[0],t)},not:function(t){var n=[];if(F(t)&&t.call!==e)this.each(function(e){t.call(this,e)||n.push(this)});else{var i="string"==typeof t?this.filter(t):z(t)&&F(t.item)?u.call(t):r(t);this.forEach(function(t){i.indexOf(t)<0&&n.push(t)})}return r(n)},has:function(t){return this.filter(function(){return R(t)?r.contains(this,t):r(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!R(t)?t:r(t)},last:function(){var t=this[this.length-1];return t&&!R(t)?t:r(t)},find:function(t){var e,n=this;return e=t?"object"==typeof t?r(t).filter(function(){var t=this;return o.some.call(n,function(e){return r.contains(e,t)})}):1==this.length?r(N.qsa(this[0],t)):this.map(function(){return N.qsa(this,t)}):r()},closest:function(t,e){var n=[],i="object"==typeof t&&r(t);return this.each(function(r,o){for(;o&&!(i?i.indexOf(o)>=0:N.matches(o,t));)o=o!==e&&!M(o)&&o.parentNode;o&&n.indexOf(o)<0&&n.push(o)}),r(n)},parents:function(t){for(var e=[],n=this;n.length>0;)n=r.map(n,function(t){return(t=t.parentNode)&&!M(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return W(e,t)},parent:function(t){return W(P(this.pluck("parentNode")),t)},children:function(t){return W(this.map(function(){return U(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||u.call(this.childNodes)})},siblings:function(t){return W(this.map(function(t,e){return a.call(U(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return r.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=B(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var e=F(t);if(this[0]&&!e)var n=r(t).get(0),i=n.parentNode||this.length>1;return this.each(function(o){r(this).wrapAll(e?t.call(this,o):i?n.cloneNode(!0):n)})},wrapAll:function(t){if(this[0]){r(this[0]).before(t=r(t));for(var e;(e=t.children()).length;)t=e.first();r(t).append(this)}return this},wrapInner:function(t){var e=F(t);return this.each(function(n){var i=r(this),o=i.contents(),s=e?t.call(this,n):t;o.length?o.wrapAll(s):i.append(s)})},unwrap:function(){return this.parent().each(function(){r(this).replaceWith(r(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var n=r(this);(t===e?"none"==n.css("display"):t)?n.show():n.hide()})},prev:function(t){return r(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return r(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var n=this.innerHTML;r(this).empty().append(Y(this,t,e,n))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=Y(this,t,e,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this.pluck("textContent").join(""):null},attr:function(t,r){var i;return"string"!=typeof t||1 in arguments?this.each(function(e){if(1===this.nodeType)if(R(t))for(n in t)G(this,n,t[n]);else G(this,t,Y(this,r,e,this.getAttribute(t)))}):0 in this&&1==this[0].nodeType&&null!=(i=this[0].getAttribute(t))?i:e},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){G(this,t)},this)})},prop:function(t,e){return t=D[t]||t,1 in arguments?this.each(function(n){this[t]=Y(this,e,n,this[t])}):this[0]&&this[0][t]},removeProp:function(t){return t=D[t]||t,this.each(function(){delete this[t]})},data:function(t,n){var r="data-"+t.replace(v,"-$1").toLowerCase(),i=1 in arguments?this.attr(r,n):this.attr(r);return null!==i?Q(i):e},val:function(t){return 0 in arguments?(null==t&&(t=""),this.each(function(e){this.value=Y(this,t,e,this.value)})):this[0]&&(this[0].multiple?r(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(e){if(e)return this.each(function(t){var n=r(this),i=Y(this,e,t,n.offset()),o=n.offsetParent().offset(),s={top:i.top-o.top,left:i.left-o.left};"static"==n.css("position")&&(s.position="relative"),n.css(s)});if(!this.length)return null;if(f.documentElement!==this[0]&&!r.contains(f.documentElement,this[0]))return{top:0,left:0};var n=this[0].getBoundingClientRect();return{left:n.left+t.pageXOffset,top:n.top+t.pageYOffset,width:Math.round(n.width),height:Math.round(n.height)}},css:function(t,e){if(arguments.length<2){var i=this[0];if("string"==typeof t){if(!i)return;return i.style[O(t)]||getComputedStyle(i,"").getPropertyValue(t)}if(L(t)){if(!i)return;var o={},s=getComputedStyle(i,"");return r.each(t,function(t,e){o[e]=i.style[O(e)]||s.getPropertyValue(e)}),o}}var a="";if("string"==$(t))e||0===e?a=I(t)+":"+_(t,e):this.each(function(){this.style.removeProperty(I(t))});else for(n in t)t[n]||0===t[n]?a+=I(n)+":"+_(n,t[n])+";":this.each(function(){this.style.removeProperty(I(n))});return this.each(function(){this.style.cssText+=";"+a})},index:function(t){return t?this.indexOf(r(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return t?o.some.call(this,function(t){return this.test(K(t))},V(t)):!1},addClass:function(t){return t?this.each(function(e){if("className"in this){i=[];var n=K(this),o=Y(this,t,e,n);o.split(/\s+/g).forEach(function(t){r(this).hasClass(t)||i.push(t)},this),i.length&&K(this,n+(n?" ":"")+i.join(" "))}}):this},removeClass:function(t){return this.each(function(n){if("className"in this){if(t===e)return K(this,"");i=K(this),Y(this,t,n,i).split(/\s+/g).forEach(function(t){i=i.replace(V(t)," ")}),K(this,i.trim())}})},toggleClass:function(t,n){return t?this.each(function(i){var o=r(this),s=Y(this,t,i,K(this));s.split(/\s+/g).forEach(function(t){(n===e?!o.hasClass(t):n)?o.addClass(t):o.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var n="scrollTop"in this[0];return t===e?n?this[0].scrollTop:this[0].pageYOffset:this.each(n?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var n="scrollLeft"in this[0];return t===e?n?this[0].scrollLeft:this[0].pageXOffset:this.each(n?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),n=this.offset(),i=g.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(r(t).css("margin-top"))||0,n.left-=parseFloat(r(t).css("margin-left"))||0,i.top+=parseFloat(r(e[0]).css("border-top-width"))||0,i.left+=parseFloat(r(e[0]).css("border-left-width"))||0,{top:n.top-i.top,left:n.left-i.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||f.body;t&&!g.test(t.nodeName)&&"static"==r(t).css("position");)t=t.offsetParent;return t})}},r.fn.detach=r.fn.remove,["width","height"].forEach(function(t){var n=t.replace(/./,function(t){return t[0].toUpperCase()});r.fn[t]=function(i){var o,s=this[0];return i===e?k(s)?s["inner"+n]:M(s)?s.documentElement["scroll"+n]:(o=this.offset())&&o[t]:this.each(function(e){s=r(this),s.css(t,Y(this,i,e,s[t]()))})}}),x.forEach(function(n,i){var o=i%2;r.fn[n]=function(){var n,a,s=r.map(arguments,function(t){var i=[];return n=$(t),"array"==n?(t.forEach(function(t){return t.nodeType!==e?i.push(t):r.zepto.isZ(t)?i=i.concat(t.get()):void(i=i.concat(N.fragment(t)))}),i):"object"==n||null==t?t:N.fragment(t)}),u=this.length>1;return s.length<1?this:this.each(function(e,n){a=o?n:n.parentNode,n=0==i?n.nextSibling:1==i?n.firstChild:2==i?n:null;var c=r.contains(f.documentElement,a);s.forEach(function(e){if(u)e=e.cloneNode(!0);else if(!a)return r(e).remove();a.insertBefore(e,n),c&&tt(e,function(e){if(!(null==e.nodeName||"SCRIPT"!==e.nodeName.toUpperCase()||e.type&&"text/javascript"!==e.type||e.src)){var n=e.ownerDocument?e.ownerDocument.defaultView:t;n.eval.call(n,e.innerHTML)}})})})},r.fn[o?n+"To":"insert"+(i?"Before":"After")]=function(t){return r(t)[n](this),this}}),N.Z.prototype=X.prototype=r.fn,N.uniq=P,N.deserializeValue=Q,r.zepto=N,r}();return t.Zepto=e,void 0===t.$&&(t.$=e),function(e){function h(t){return t._zid||(t._zid=n++)}function p(t,e,n,r){if(e=d(e),e.ns)var i=m(e.ns);return(a[h(t)]||[]).filter(function(t){return t&&(!e.e||t.e==e.e)&&(!e.ns||i.test(t.ns))&&(!n||h(t.fn)===h(n))&&(!r||t.sel==r)})}function d(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function m(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function g(t,e){return t.del&&!f&&t.e in c||!!e}function v(t){return l[t]||f&&c[t]||t}function y(t,n,i,o,s,u,f){var c=h(t),p=a[c]||(a[c]=[]);n.split(/\s/).forEach(function(n){if("ready"==n)return e(document).ready(i);var a=d(n);a.fn=i,a.sel=s,a.e in l&&(i=function(t){var n=t.relatedTarget;return!n||n!==this&&!e.contains(this,n)?a.fn.apply(this,arguments):void 0}),a.del=u;var c=u||i;a.proxy=function(e){if(e=T(e),!e.isImmediatePropagationStopped()){e.data=o;var n=c.apply(t,e._args==r?[e]:[e].concat(e._args));return n===!1&&(e.preventDefault(),e.stopPropagation()),n}},a.i=p.length,p.push(a),"addEventListener"in t&&t.addEventListener(v(a.e),a.proxy,g(a,f))})}function x(t,e,n,r,i){var o=h(t);(e||"").split(/\s/).forEach(function(e){p(t,e,n,r).forEach(function(e){delete a[o][e.i],"removeEventListener"in t&&t.removeEventListener(v(e.e),e.proxy,g(e,i))})})}function T(t,n){return(n||!t.isDefaultPrevented)&&(n||(n=t),e.each(w,function(e,r){var i=n[e];t[e]=function(){return this[r]=b,i&&i.apply(n,arguments)},t[r]=E}),t.timeStamp||(t.timeStamp=Date.now()),(n.defaultPrevented!==r?n.defaultPrevented:"returnValue"in n?n.returnValue===!1:n.getPreventDefault&&n.getPreventDefault())&&(t.isDefaultPrevented=b)),t}function S(t){var e,n={originalEvent:t};for(e in t)j.test(e)||t[e]===r||(n[e]=t[e]);return T(n,t)}var r,n=1,i=Array.prototype.slice,o=e.isFunction,s=function(t){return"string"==typeof t},a={},u={},f="onfocusin"in t,c={focus:"focusin",blur:"focusout"},l={mouseenter:"mouseover",mouseleave:"mouseout"};u.click=u.mousedown=u.mouseup=u.mousemove="MouseEvents",e.event={add:y,remove:x},e.proxy=function(t,n){var r=2 in arguments&&i.call(arguments,2);if(o(t)){var a=function(){return t.apply(n,r?r.concat(i.call(arguments)):arguments)};return a._zid=h(t),a}if(s(n))return r?(r.unshift(t[n],t),e.proxy.apply(null,r)):e.proxy(t[n],t);throw new TypeError("expected function")},e.fn.bind=function(t,e,n){return this.on(t,e,n)},e.fn.unbind=function(t,e){return this.off(t,e)},e.fn.one=function(t,e,n,r){return this.on(t,e,n,r,1)};var b=function(){return!0},E=function(){return!1},j=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,w={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};e.fn.delegate=function(t,e,n){return this.on(e,t,n)},e.fn.undelegate=function(t,e,n){return this.off(e,t,n)},e.fn.live=function(t,n){return e(document.body).delegate(this.selector,t,n),this},e.fn.die=function(t,n){return e(document.body).undelegate(this.selector,t,n),this},e.fn.on=function(t,n,a,u,f){var c,l,h=this;return t&&!s(t)?(e.each(t,function(t,e){h.on(t,n,a,e,f)}),h):(s(n)||o(u)||u===!1||(u=a,a=n,n=r),(u===r||a===!1)&&(u=a,a=r),u===!1&&(u=E),h.each(function(r,o){f&&(c=function(t){return x(o,t.type,u),u.apply(this,arguments)}),n&&(l=function(t){var r,s=e(t.target).closest(n,o).get(0);return s&&s!==o?(r=e.extend(S(t),{currentTarget:s,liveFired:o}),(c||u).apply(s,[r].concat(i.call(arguments,1)))):void 0}),y(o,t,u,a,n,l||c)}))},e.fn.off=function(t,n,i){var a=this;return t&&!s(t)?(e.each(t,function(t,e){a.off(t,n,e)}),a):(s(n)||o(i)||i===!1||(i=n,n=r),i===!1&&(i=E),a.each(function(){x(this,t,i,n)}))},e.fn.trigger=function(t,n){return t=s(t)||e.isPlainObject(t)?e.Event(t):T(t),t._args=n,this.each(function(){t.type in c&&"function"==typeof this[t.type]?this[t.type]():"dispatchEvent"in this?this.dispatchEvent(t):e(this).triggerHandler(t,n)})},e.fn.triggerHandler=function(t,n){var r,i;return this.each(function(o,a){r=S(s(t)?e.Event(t):t),r._args=n,r.target=a,e.each(p(a,t.type||t),function(t,e){return i=e.proxy(r),r.isImmediatePropagationStopped()?!1:void 0})}),i},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(t){e.fn[t]=function(e){return 0 in arguments?this.bind(t,e):this.trigger(t)}}),e.Event=function(t,e){s(t)||(e=t,t=e.type);var n=document.createEvent(u[t]||"Events"),r=!0;if(e)for(var i in e)"bubbles"==i?r=!!e[i]:n[i]=e[i];return n.initEvent(t,r,!0),T(n)}}(e),function(e){function p(t,n,r){var i=e.Event(n);return e(t).trigger(i,r),!i.isDefaultPrevented()}function d(t,e,n,i){return t.global?p(e||r,n,i):void 0}function m(t){t.global&&0===e.active++&&d(t,null,"ajaxStart")}function g(t){t.global&&!--e.active&&d(t,null,"ajaxStop")}function v(t,e){var n=e.context;return e.beforeSend.call(n,t,e)===!1||d(e,n,"ajaxBeforeSend",[t,e])===!1?!1:void d(e,n,"ajaxSend",[t,e])}function y(t,e,n,r){var i=n.context,o="success";n.success.call(i,t,o,e),r&&r.resolveWith(i,[t,o,e]),d(n,i,"ajaxSuccess",[e,n,t]),b(o,e,n)}function x(t,e,n,r,i){var o=r.context;r.error.call(o,n,e,t),i&&i.rejectWith(o,[n,e,t]),d(r,o,"ajaxError",[n,r,t||e]),b(e,n,r)}function b(t,e,n){var r=n.context;n.complete.call(r,e,t),d(n,r,"ajaxComplete",[e,n]),g(n)}function E(t,e,n){if(n.dataFilter==j)return t;var r=n.context;return n.dataFilter.call(r,t,e)}function j(){}function w(t){return t&&(t=t.split(";",2)[0]),t&&(t==c?"html":t==f?"json":a.test(t)?"script":u.test(t)&&"xml")||"text"}function T(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function S(t){t.processData&&t.data&&"string"!=e.type(t.data)&&(t.data=e.param(t.data,t.traditional)),!t.data||t.type&&"GET"!=t.type.toUpperCase()&&"jsonp"!=t.dataType||(t.url=T(t.url,t.data),t.data=void 0)}function C(t,n,r,i){return e.isFunction(n)&&(i=r,r=n,n=void 0),e.isFunction(r)||(i=r,r=void 0),{url:t,data:n,success:r,dataType:i}}function O(t,n,r,i){var o,s=e.isArray(n),a=e.isPlainObject(n);e.each(n,function(n,u){o=e.type(u),i&&(n=r?i:i+"["+(a||"object"==o||"array"==o?n:"")+"]"),!i&&s?t.add(u.name,u.value):"array"==o||!r&&"object"==o?O(t,u,r,n):t.add(n,u)})}var i,o,n=+new Date,r=t.document,s=/)<[^<]*)*<\/script>/gi,a=/^(?:text|application)\/javascript/i,u=/^(?:text|application)\/xml/i,f="application/json",c="text/html",l=/^\s*$/,h=r.createElement("a");h.href=t.location.href,e.active=0,e.ajaxJSONP=function(i,o){if(!("type"in i))return e.ajax(i);var c,p,s=i.jsonpCallback,a=(e.isFunction(s)?s():s)||"Zepto"+n++,u=r.createElement("script"),f=t[a],l=function(t){e(u).triggerHandler("error",t||"abort")},h={abort:l};return o&&o.promise(h),e(u).on("load error",function(n,r){clearTimeout(p),e(u).off().remove(),"error"!=n.type&&c?y(c[0],h,i,o):x(null,r||"error",h,i,o),t[a]=f,c&&e.isFunction(f)&&f(c[0]),f=c=void 0}),v(h,i)===!1?(l("abort"),h):(t[a]=function(){c=arguments},u.src=i.url.replace(/\?(.+)=\?/,"?$1="+a),r.head.appendChild(u),i.timeout>0&&(p=setTimeout(function(){l("timeout")},i.timeout)),h)},e.ajaxSettings={type:"GET",beforeSend:j,success:j,error:j,complete:j,context:null,global:!0,xhr:function(){return new t.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:f,xml:"application/xml, text/xml",html:c,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:j},e.ajax=function(n){var u,f,s=e.extend({},n||{}),a=e.Deferred&&e.Deferred();for(i in e.ajaxSettings)void 0===s[i]&&(s[i]=e.ajaxSettings[i]);m(s),s.crossDomain||(u=r.createElement("a"),u.href=s.url,u.href=u.href,s.crossDomain=h.protocol+"//"+h.host!=u.protocol+"//"+u.host),s.url||(s.url=t.location.toString()),(f=s.url.indexOf("#"))>-1&&(s.url=s.url.slice(0,f)),S(s);var c=s.dataType,p=/\?.+=\?/.test(s.url);if(p&&(c="jsonp"),s.cache!==!1&&(n&&n.cache===!0||"script"!=c&&"jsonp"!=c)||(s.url=T(s.url,"_="+Date.now())),"jsonp"==c)return p||(s.url=T(s.url,s.jsonp?s.jsonp+"=?":s.jsonp===!1?"":"callback=?")),e.ajaxJSONP(s,a);var P,d=s.accepts[c],g={},b=function(t,e){g[t.toLowerCase()]=[t,e]},C=/^([\w-]+:)\/\//.test(s.url)?RegExp.$1:t.location.protocol,N=s.xhr(),O=N.setRequestHeader;if(a&&a.promise(N),s.crossDomain||b("X-Requested-With","XMLHttpRequest"),b("Accept",d||"*/*"),(d=s.mimeType||d)&&(d.indexOf(",")>-1&&(d=d.split(",",2)[0]),N.overrideMimeType&&N.overrideMimeType(d)),(s.contentType||s.contentType!==!1&&s.data&&"GET"!=s.type.toUpperCase())&&b("Content-Type",s.contentType||"application/x-www-form-urlencoded"),s.headers)for(o in s.headers)b(o,s.headers[o]);if(N.setRequestHeader=b,N.onreadystatechange=function(){if(4==N.readyState){N.onreadystatechange=j,clearTimeout(P);var t,n=!1;if(N.status>=200&&N.status<300||304==N.status||0==N.status&&"file:"==C){if(c=c||w(s.mimeType||N.getResponseHeader("content-type")),"arraybuffer"==N.responseType||"blob"==N.responseType)t=N.response;else{t=N.responseText;try{t=E(t,c,s),"script"==c?(1,eval)(t):"xml"==c?t=N.responseXML:"json"==c&&(t=l.test(t)?null:e.parseJSON(t))}catch(r){n=r}if(n)return x(n,"parsererror",N,s,a)}y(t,N,s,a)}else x(N.statusText||null,N.status?"error":"abort",N,s,a)}},v(N,s)===!1)return N.abort(),x(null,"abort",N,s,a),N;var A="async"in s?s.async:!0;if(N.open(s.type,s.url,A,s.username,s.password),s.xhrFields)for(o in s.xhrFields)N[o]=s.xhrFields[o];for(o in g)O.apply(N,g[o]);return s.timeout>0&&(P=setTimeout(function(){N.onreadystatechange=j,N.abort(),x(null,"timeout",N,s,a)},s.timeout)),N.send(s.data?s.data:null),N},e.get=function(){return e.ajax(C.apply(null,arguments))},e.post=function(){var t=C.apply(null,arguments);return t.type="POST",e.ajax(t)},e.getJSON=function(){var t=C.apply(null,arguments);return t.dataType="json",e.ajax(t)},e.fn.load=function(t,n,r){if(!this.length)return this;var a,i=this,o=t.split(/\s/),u=C(t,n,r),f=u.success;return o.length>1&&(u.url=o[0],a=o[1]),u.success=function(t){i.html(a?e("
").html(t.replace(s,"")).find(a):t),f&&f.apply(i,arguments)},e.ajax(u),this};var N=encodeURIComponent;e.param=function(t,n){var r=[];return r.add=function(t,n){e.isFunction(n)&&(n=n()),null==n&&(n=""),this.push(N(t)+"="+N(n))},O(r,t,n),r.join("&").replace(/%20/g,"+")}}(e),function(t){t.fn.serializeArray=function(){var e,n,r=[],i=function(t){return t.forEach?t.forEach(i):void r.push({name:e,value:t})};return this[0]&&t.each(this[0].elements,function(r,o){n=o.type,e=o.name,e&&"fieldset"!=o.nodeName.toLowerCase()&&!o.disabled&&"submit"!=n&&"reset"!=n&&"button"!=n&&"file"!=n&&("radio"!=n&&"checkbox"!=n||o.checked)&&i(t(o).val())}),r},t.fn.serialize=function(){var t=[];return this.serializeArray().forEach(function(e){t.push(encodeURIComponent(e.name)+"="+encodeURIComponent(e.value))}),t.join("&")},t.fn.submit=function(e){if(0 in arguments)this.bind("submit",e);else if(this.length){var n=t.Event("submit");this.eq(0).trigger(n),n.isDefaultPrevented()||this.get(0).submit()}return this}}(e),function(){try{getComputedStyle(void 0)}catch(e){var n=getComputedStyle;t.getComputedStyle=function(t,e){try{return n(t,e)}catch(r){return null}}}}(),e}); \ No newline at end of file From 8e4d4393d43ac6bec9eda098d0542e5bace99df7 Mon Sep 17 00:00:00 2001 From: huangjue Date: Thu, 30 Dec 2021 15:13:49 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2cf1eb9..ecf596e 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,15 @@ # N年前写的年会抽奖程序 -[demo](https://fouber.github.io/lottery/) +使用的话有以下几个点需要注意: +1. 需要成员需要提前替换,可以按照`member.js`文件中的格式来填入 +2. 这个抽奖小程序使用的是本地localStorage来存储,刷新后之前抽奖数据会保留,需要重置后数据才会清空 +3. 如果需要替换下面的按钮名字和值,替换`index.html`中的btns变量即可,具体可以看代码 ## 抽奖流程: -1. 选择当次要抽奖的人数(30、10、5、2、1) +1. 选择当次要抽奖的人数 2. 点击『开始』按钮,进入抽奖状态(这个过程仍可修改抽奖人数) 3. 点击『停!』按钮,生成抽奖结果 4. 点击任意人数按钮,可以回到闲置状态,已中奖的用户标记为黄色,不会二次命中 From a02e0b9e5678fba6137f7c143a74c8b7e983606c Mon Sep 17 00:00:00 2001 From: huangjue Date: Thu, 30 Dec 2021 15:14:38 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0readme=E6=A0=87?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ecf596e..4023f0d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# N年前写的年会抽奖程序 +# 网上看到一个不错的年会抽奖程序改良版 使用的话有以下几个点需要注意: From 4f34023e2508519c7c8915b9be0d846a0ea33617 Mon Sep 17 00:00:00 2001 From: huangjue Date: Thu, 30 Dec 2021 15:15:42 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4023f0d..6502a09 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,14 @@ 使用的话有以下几个点需要注意: 1. 需要成员需要提前替换,可以按照`member.js`文件中的格式来填入 -2. 这个抽奖小程序使用的是本地localStorage来存储,刷新后之前抽奖数据会保留,需要重置后数据才会清空 -3. 如果需要替换下面的按钮名字和值,替换`index.html`中的btns变量即可,具体可以看代码 - +2. 这个抽奖小程序使用的是本地`localStorage`来存储,刷新后之前抽奖数据会保留,需要重置后数据才会清空 +3. 如果需要替换下面的按钮名字和值,替换`index.html`中的`btns`变量即可,具体可以看代码 ## 抽奖流程: +> 滚动鼠标滚轮,可以放大或缩小球体 + 1. 选择当次要抽奖的人数 2. 点击『开始』按钮,进入抽奖状态(这个过程仍可修改抽奖人数) 3. 点击『停!』按钮,生成抽奖结果 4. 点击任意人数按钮,可以回到闲置状态,已中奖的用户标记为黄色,不会二次命中 - -PS:滚动鼠标滚轮,可以放大或缩小球体 \ No newline at end of file From fb231cc05f8da37736b03d4ad9550264cd14837d Mon Sep 17 00:00:00 2001 From: huangjue Date: Thu, 30 Dec 2021 15:22:44 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6502a09..4b6be9e 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,17 @@ # 网上看到一个不错的年会抽奖程序改良版 -使用的话有以下几个点需要注意: +## 使用和改动须知 1. 需要成员需要提前替换,可以按照`member.js`文件中的格式来填入 2. 这个抽奖小程序使用的是本地`localStorage`来存储,刷新后之前抽奖数据会保留,需要重置后数据才会清空 3. 如果需要替换下面的按钮名字和值,替换`index.html`中的`btns`变量即可,具体可以看代码 -## 抽奖流程: +## 抽奖流程 > 滚动鼠标滚轮,可以放大或缩小球体 -1. 选择当次要抽奖的人数 -2. 点击『开始』按钮,进入抽奖状态(这个过程仍可修改抽奖人数) -3. 点击『停!』按钮,生成抽奖结果 -4. 点击任意人数按钮,可以回到闲置状态,已中奖的用户标记为黄色,不会二次命中 +1. 用浏览器打开文件夹中的`index.html`文件 +2. 选择当次要抽奖的人数 +3. 点击『开始』按钮,进入抽奖状态(这个过程仍可修改抽奖人数) +4. 点击『停!』按钮,生成抽奖结果 +5. 点击任意人数按钮,可以回到闲置状态,已中奖的用户标记为黄色,不会二次命中 From 3dd2233c16f787c25deaaf59c60003bde94ea8db Mon Sep 17 00:00:00 2001 From: huangjue Date: Thu, 30 Dec 2021 15:35:41 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 1ac3935..6ac9366 100755 --- a/index.html +++ b/index.html @@ -187,7 +187,7 @@ 'button-success': running}">{{running?'停!':'开始'}}
- + From 4048c3fc647d50012594b226f3fe1042f47637cf Mon Sep 17 00:00:00 2001 From: huangjue Date: Thu, 30 Dec 2021 15:37:47 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 4b6be9e..2961458 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,12 @@ 3. 点击『开始』按钮,进入抽奖状态(这个过程仍可修改抽奖人数) 4. 点击『停!』按钮,生成抽奖结果 5. 点击任意人数按钮,可以回到闲置状态,已中奖的用户标记为黄色,不会二次命中 + +## 小工具 + +如果你只有名字,需要生成`member.js`中的格式,可以在控制台按照以下方式: + +```JavaScript +arr = ['张三', '李四', '王五', '赵二']; +copy(arr.map((e,i)=>{return {phone:`No.${i+1}`, name:e}})) +``` From 14e6b1ced932b5958da59572ecb76edeb34b7afe Mon Sep 17 00:00:00 2001 From: huangjue Date: Thu, 30 Dec 2021 15:38:29 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2961458..2aa8361 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ ## 小工具 -如果你只有名字,需要生成`member.js`中的格式,可以在控制台按照以下方式: +如果你只有名字,需要生成`member.js`中的格式,可以在浏览器控制台按照以下方式生成: ```JavaScript arr = ['张三', '李四', '王五', '赵二']; From 2961ad2123849b28af2677309ed5a33179a35c5b Mon Sep 17 00:00:00 2001 From: huangjue Date: Fri, 31 Dec 2021 21:08:11 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E9=87=8D=E6=9E=84=E6=8A=BD=E5=A5=96?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .prettierrc.js | 22 + css/main.css | 227 +++++++++ css/reset.css | 104 ++-- css/wall.css | 140 ------ index.html | 498 +++++++++---------- js/allMembers.js | 286 +++++++++++ js/member.js | 1202 ---------------------------------------------- result.html | 321 ------------- 8 files changed, 830 insertions(+), 1970 deletions(-) create mode 100644 .prettierrc.js create mode 100644 css/main.css delete mode 100644 css/wall.css create mode 100644 js/allMembers.js delete mode 100644 js/member.js delete mode 100755 result.html diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..cdd6736 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,22 @@ +module.exports = { + printWidth: 120, + tabWidth: 2, + useTabs: false, + semi: true, + singleQuote: true, + quoteProps: "as-needed", + jsxSingleQuote: false, + trailingComma: "all", + bracketSpacing: true, + jsxBracketSameLine: true, + arrowParens: "avoid", + rangeStart: 0, + rangeEnd: Infinity, + requirePragma: false, + insertPragma: false, + proseWrap: "preserve", + htmlWhitespaceSensitivity: "css", + vueIndentScriptAndStyle: false, + endOfLine: "lf", + embeddedLanguageFormatting: "auto", +}; diff --git a/css/main.css b/css/main.css new file mode 100644 index 0000000..1003b1f --- /dev/null +++ b/css/main.css @@ -0,0 +1,227 @@ +body, +html { + width: 100%; + height: 100%; +} + +.wall { + background-image: url(../img/icon-wall.jpg); + overflow: hidden; + background-color: #121936; + background-size: 100% 100%; + background-position: center center; + background-repeat: no-repeat; + line-height: 0; +} + +.result { + position: absolute; + height: 320px; + width: 100%; + left: 0; + top: 50%; + margin-top: -160px; + text-align: center; + padding: 10px; + display: none; +} + +.winnerRecords { + position: absolute; + height: 320px; + width: 100%; + left: 0; + top: 50%; + margin-top: -160px; + text-align: center; + padding: 10px; + display: none; + overflow-y: auto; +} + +.winnerRecords::-webkit-scrollbar { + width: 6px; + height: 100%; +} +.winnerRecords::-webkit-scrollbar-thumb { + width: 4px; + height: 60px; + background-color: #ccc; + border-radius: 3px; +} +.winnerRecords::-webkit-scrollbar-track { + border-radius: 10px; + background-color: rgba(255, 255, 255, 0.5); +} + +.winnerRecord { + display: block; + font-size: 25px; + width: 100%; + background: #fff; + line-height: 30px; + color: #000; + margin: 5px; + border-radius: 10px; + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.8); + padding: 10px 10px; + margin: 10px auto 10px auto; + text-align: left; +} + +.result span { + display: inline-block; + font-size: 25px; + width: 150px; + background: #fff; + line-height: 30px; + color: #000; + margin: 5px; + border-radius: 10px; + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.8); + padding: 10px 0; +} + +button, +input, +optgroup, +select, +textarea { + color: inherit; + font: inherit; + margin: 0; + border: none; +} + +button { + overflow: visible; +} + +button, +select { + text-transform: none; +} + +button, +html input[type='button'], +input[type='reset'], +input[type='submit'] { + -webkit-appearance: button; + cursor: pointer; +} + +.pure-button { + display: inline-block; + zoom: 1; + line-height: normal; + white-space: nowrap; + vertical-align: middle; + text-align: center; + cursor: pointer; + -webkit-user-drag: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.pure-button { + font-family: inherit; + font-size: 100%; + padding: 0.5em 1em; + color: #444; + color: rgba(0, 0, 0, 0.8); + border: 0 rgba(0, 0, 0, 0); + background-color: #e6e6e6; + text-decoration: none; + border-radius: 2px; +} + +.pure-button:focus { + outline: 0; +} + +.pure-button-hover, +.pure-button:hover, +.pure-button:focus { + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#1a000000', GradientType=0); + background-image: -webkit-gradient( + linear, + 0 0, + 0 100%, + from(transparent), + color-stop(40%, rgba(0, 0, 0, 0.05)), + to(rgba(0, 0, 0, 0.1)) + ); + background-image: -webkit-linear-gradient(transparent, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.1)); + background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0.05) 0, rgba(0, 0, 0, 0.1)); + background-image: -o-linear-gradient(transparent, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.1)); + background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.1)); +} + +.button-success, +.button-error, +.button-warning, +.button-secondary { + color: white; + border-radius: 4px; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); +} + +.button-success { + background: rgb(28, 184, 65); +} + +.button-error { + background: rgb(202, 60, 60); +} + +.button-warning { + background: rgb(223, 117, 20); +} + +.button-secondary { + background: rgb(66, 184, 221); +} + +.tools { + position: absolute; + bottom: 20px; + right: 20px; + text-align: center; +} + +.tools .pure-button { + display: inline-block; + margin: 5px; + padding: 10px 0; + text-align: center; + width: 100px; +} + +.mask { + -webkit-filter: blur(5px); + filter: blur(5px); +} + +#main { + -webkit-transition: all 1s; + transition: all 1s; +} + +.result-btn { + position: absolute; + margin: 20px 25px 0 0; + right: 0px; +} + +.member { + color: #fff; +} + +.winner { + color: #ff0; +} diff --git a/css/reset.css b/css/reset.css index bb9d34f..b59d4bf 100644 --- a/css/reset.css +++ b/css/reset.css @@ -3,55 +3,95 @@ cursor: pointer; } -body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, -form, fieldset, input, textarea, p, blockquote, th, td { - padding: 0; - margin: 0; - -webkit-box-sizing: border-box; - box-sizing: border-box; - word-wrap: break-word; - word-break: break-all; +body, +div, +dl, +dt, +dd, +ul, +ol, +li, +h1, +h2, +h3, +h4, +h5, +h6, +pre, +form, +fieldset, +input, +textarea, +p, +blockquote, +th, +td { + padding: 0; + margin: 0; + -webkit-box-sizing: border-box; + box-sizing: border-box; + word-wrap: break-word; + word-break: break-all; } table { - border-collapse: collapse; - border-spacing: 0; + border-collapse: collapse; + border-spacing: 0; } -fieldset, img { - border: 0; +fieldset, +img { + border: 0; } -address, caption, cite, code, dfn, em, strong, th, var { - font-weight: normal; - font-style: normal; +address, +caption, +cite, +code, +dfn, +em, +strong, +th, +var { + font-weight: normal; + font-style: normal; } -ol, ul { - list-style: none; +ol, +ul { + list-style: none; } -caption, th { - text-align: left; +caption, +th { + text-align: left; } -h1, h2, h3, h4, h5, h6, i { - font-weight: normal; - font-style: normal; - font-size: 100%; +h1, +h2, +h3, +h4, +h5, +h6, +i { + font-weight: normal; + font-style: normal; + font-size: 100%; } -q:before, q:after { - content:''; +q:before, +q:after { + content: ''; } -abbr, acronym { - border: 0; +abbr, +acronym { + border: 0; } body { - font-family: "Hiragino Sans GB","DroidSansFallback","Microsoft YaHei","微软雅黑",arial,simsun; - color: #333; - line-height: 22px; - font-size: 16px; -} \ No newline at end of file + font-family: 'Hiragino Sans GB', 'DroidSansFallback', 'Microsoft YaHei', '微软雅黑', arial, simsun; + color: #333; + line-height: 22px; + font-size: 16px; +} diff --git a/css/wall.css b/css/wall.css deleted file mode 100644 index 0ce63f4..0000000 --- a/css/wall.css +++ /dev/null @@ -1,140 +0,0 @@ -html, body {width: 100%; height: 100%;} -.wall {width: 100%; height: 100%; - background-image: url(../img/icon-wall.jpg); - overflow: hidden; - background-color: #121936; - background-size: 100% 100% ; - background-position: center center; - background-repeat: no-repeat;} -.photos-wall {width:100%; height:100%;} -.messages {width: 30%; float: left; position: relative; top: 52px; left: 0} - - -/*照片墙*/ -.wall .photos {width: 75%; height: 50%; float: left; position: relative; top: 270px; left: 100px; padding-left: 130px;} -.wall .photo-title { - position: absolute; - top: -280px; left: 50%; - background: url(../img/title.png) no-repeat 0 0; - background-size: 100% auto; - width: 800px; height: 350px; - margin-left: -350px; -} -/* -.wall .photo-title{position: absolute; top:-137px ;left:50%; background: url(../img/title.png) no-repeat 0 0; - background-size:380px 107px; width:380px; height: 107px; margin-left:-190px;}*/ -.wall .photo-content{width:100%;height: 100%; margin:0 auto; position: relative;} -.wall .photo {position: absolute;} -.wall .photo .photo-inner{position: relative; width:100%;height: 100%;} -.wall .photo .photo-inner .img-wrap{position: absolute; top:0; left:0;} -.wall .photo .photo-inner .old{z-index: 10; opacity: 1; -webkit-transform-origin: center center; /*-webkit-transition:all 2s linear;*/} -.wall .photo .photo-inner .new{z-index: 11; opacity: 0; -webkit-transform-origin: center center; /*-webkit-transition:all 2s linear;*/} -.wall .photo .photo-inner .show{-webkit-animation: show_photo 2s ease-in-out;} -.wall .photo .photo-inner .hide{-webkit-animation: hide_photo 2s ease-in-out;} -@-webkit-keyframes show_photo{ - 0% {opacity:0;-webkit-transform:scale(0, 0);} - 100% { opacity:1;-webkit-transform:scale(1, 1);} -} -@-webkit-keyframes hide_photo{ - 0% {opacity:1;} - 100% { opacity:0;} -} -/*.wall .photo .photo-inner .old{z-index: 10; opacity: 1; -webkit-transition:all 2s linear;}*/ -/*.wall .photo .photo-inner .new{z-index: 11; opacity: 0; -webkit-transition:all 2s linear;}*/ -/*.wall .photo .photo-inner .show{opacity: 1;}*/ -/*.wall .photo .photo-inner .hide{opacity: 0;}*/ - -.wall .photo img { - width: 100%; height: 100%; - box-shadow: 0 5px 8px rgba(0, 0, 0, 0.8); -} - -.wall .pos-0 {top:10px; left:0;width:65px; height:65px;} -.wall .pos-1 {top:30px; left:70px;width:70px; height:70px;} -.wall .pos-2 {top:0; left:145px;width:100px;height:100px;} -.wall .pos-3 {top:30px; left:250px;width:70px; height:70px;} -.wall .pos-4 {top:55px; left:325px;width:100px;height:100px;} -.wall .pos-5 {top:70px; left:430px;width:85px;height:85px;} -.wall .pos-6{top:15px; left:520px;width:65px;height:65px;} -.wall .pos-7{top:-15px; left:595px;width:80px;height:80px;} - -.wall .pos-8{top:105px; left:40px;width:80px;height:80px;} -.wall .pos-9{top:105px; left:125px;width:80px;height:80px;} -.wall .pos-10{top:105px; left:210px;width:110px;height:110px;} -.wall .pos-11{top:160px; left:325px;width:85px;height:85px;} -.wall .pos-12{top:160px; left:415px;width:80px;height:80px;} -.wall .pos-13{top:160px; left:500px;width:100px;height:100px;} -.wall .pos-14{top:85px; left:520px;width:70px;height:70px;} - -.wall .pos-15{top:265px; left:-55px;width:80px;height:80px;} - -.wall .pos-16{top:190px; left:30px;width:70px;height:70px;} -.wall .pos-17{top:190px; left:105px;width:100px;height:100px;} - -.wall .pos-18{top:220px; left:210px;width:110px;height:110px;} - -.wall .pos-19{top:250px; left:325px;width:85px;height:85px;} -.wall .pos-20{top:245px; left:415px;width:75px;height:75px;} -.wall .pos-21{top:265px; left:500px;width:85px;height:85px;} -.wall .pos-22{top:70px; left:595px;width:85px;height:85px;} -.wall .pos-23{top:160px; left:605px;width:75px;height:75px;} -.wall .pos-24{top:240px; left:605px;width:65px;height:65px;} -.wall .pos-25{top:310px; left:650px;width:60px;height:60px;} -.wall .pos-26{top:265px; left:37px;width:65px;height:65px;} -.wall .pos-27{ - top: 15px; -left: 685px; -width: 65px; -height: 65px;} -.wall .pos-28{top: -67px; -left: 685px; -width: 75px; -height: 75px;} - - - -.wall .pos-29{top: 103px; -left: -44px; -width: 75px; -height: 75px;} -.wall .pos-30{top: -45px; -left: -81px; -width: 75px; -height: 75px;} - -.wall .pos-31 { -top: 295px; -left: 105px; -width: 60px; -height: 60px; -} - -.wall .pos-32 { -top: 240px; -left: 675px; -width: 65px; -height: 65px; -} - -.wall .messages {width: 25%; float: right; position: relative; top: 77px; left: 0;} -/*.wall .messages {width: 25%;float: right;position: relative;top: 80px;left: 0;}*/ -/*.wall .message { margin: 25px 35px 25px 10px;}*/ -.wall .message {margin: 25px 35px 25px 50px;} -.wall .message span {line-height: 25px;color: #000000;font-size: 18px;display: inline-block;padding: 5px;margin: 0;} - -.wall .message{height: auto;overflow: hidden;opacity: 1;} -.wall .message.newMsg {-webkit-animation: change_height .7s linear;} - @-webkit-keyframes change_height{ - 0% {opacity:0;height: 0;} - 100% { opacity:1;height:32px;} - } - -.wall .message .message-inner{position: relative; float:right; display: inline-block; background: #ffffff; border: 1px solid #ffffff; border-radius: 4px;margin-right: 20px;} - -.wall .message .message-inner:before {content: '';width: 0;height: 0;border-width: 5px 11px 0px 11px;position: absolute;border-style: solid;border-color: transparent transparent transparent #ffffff;right: -19px;bottom: -1px;} - -#qrcode{width:105px;height:105px;position: absolute;top:20px;left:20px;} -#qrcode img{width:100%;} -#qrcode {background: white; padding: 5px;} - -.logo{color:#D13C3F;font-family: "Microsoft YaHei"; font-weight: bold; font-size: 13px; position: absolute;left:20px; bottom:20px;} \ No newline at end of file diff --git a/index.html b/index.html index 6ac9366..b2cffe7 100755 --- a/index.html +++ b/index.html @@ -8,312 +8,260 @@ content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" /> 年会抽奖小程序 - - + -
-
- 获奖名单 +
+
+
+ +
+
-
-
-
-
- -
+
+
+
+ + - + + +
- + - + diff --git a/js/allMembers.js b/js/allMembers.js new file mode 100644 index 0000000..65ce708 --- /dev/null +++ b/js/allMembers.js @@ -0,0 +1,286 @@ +var allMembers = [ + { + phone: "No.1", + name: "zhoudunyang", + }, + { + phone: "No.2", + name: "huangjue", + }, + { + phone: "No.3", + name: "liujiang04", + }, + { + phone: "No.4", + name: "zhumengzhu", + }, + { + phone: "No.5", + name: "huozhiying", + }, + { + phone: "No.6", + name: "zhangzhe15", + }, + { + phone: "No.7", + name: "wangtong09", + }, + { + phone: "No.8", + name: "shihuashen", + }, + { + phone: "No.9", + name: "wangzhicheng03", + }, + { + phone: "No.10", + name: "liuyanghe02", + }, + { + phone: "No.11", + name: "yangzhongjing", + }, + { + phone: "No.12", + name: "peiyu02", + }, + { + phone: "No.13", + name: "zhidi.xia", + }, + { + phone: "No.14", + name: "zhangchen29", + }, + { + phone: "No.15", + name: "liteng07", + }, + { + phone: "No.16", + name: "liruifeng", + }, + { + phone: "No.17", + name: "zhouchangshun", + }, + { + phone: "No.18", + name: "qiushi02", + }, + { + phone: "No.19", + name: "yangguoliang", + }, + { + phone: "No.20", + name: "wangpeng42", + }, + { + phone: "No.21", + name: "zhangxianpeng", + }, + { + phone: "No.22", + name: "wangyafei07", + }, + { + phone: "No.23", + name: "yangliuning", + }, + { + phone: "No.24", + name: "hante", + }, + { + phone: "No.25", + name: "xusuxuan", + }, + { + phone: "No.26", + name: "maiming", + }, + { + phone: "No.27", + name: "changjing03", + }, + { + phone: "No.28", + name: "qinzhanqiang", + }, + { + phone: "No.29", + name: "yangjingwen05", + }, + { + phone: "No.30", + name: "yangyidong02", + }, + { + phone: "No.31", + name: "zhangyuchen04", + }, + { + phone: "No.32", + name: "xutaokai", + }, + { + phone: "No.33", + name: "zhaohailong06", + }, + { + phone: "No.34", + name: "suxun", + }, + { + phone: "No.35", + name: "zhangtengteng03", + }, + { + phone: "No.36", + name: "caozhengwei", + }, + { + phone: "No.37", + name: "zhangxilin02", + }, + { + phone: "No.38", + name: "liuhenglin", + }, + { + phone: "No.39", + name: "litao63", + }, + { + phone: "No.40", + name: "chenhaitao04", + }, + { + phone: "No.41", + name: "qujingguo", + }, + { + phone: "No.42", + name: "liyuxin06", + }, + { + phone: "No.43", + name: "zhaohuiying02", + }, + { + phone: "No.44", + name: "chenxiang25", + }, + { + phone: "No.45", + name: "gaozhong03", + }, + { + phone: "No.46", + name: "houzhiyuan02", + }, + { + phone: "No.47", + name: "wb_suzhehui", + }, + { + phone: "No.48", + name: "xujinkang02", + }, + { + phone: "No.49", + name: "zhouzhe04", + }, + { + phone: "No.50", + name: "maye04", + }, + { + phone: "No.51", + name: "qinwenchao02", + }, + { + phone: "No.52", + name: "wb_wangshenbing", + }, + { + phone: "No.53", + name: "shenzhili", + }, + { + phone: "No.54", + name: "fangxiaoming", + }, + { + phone: "No.55", + name: "zhangyusheng05", + }, + { + phone: "No.56", + name: "chenjian45", + }, + { + phone: "No.57", + name: "yangwenqing", + }, + { + phone: "No.58", + name: "guohuang", + }, + { + phone: "No.59", + name: "hukaidi", + }, + { + phone: "No.60", + name: "tongxiaotian", + }, + { + phone: "No.61", + name: "sunsongtao", + }, + { + phone: "No.62", + name: "liukaiyuan", + }, + { + phone: "No.63", + name: "nichengyu", + }, + { + phone: "No.64", + name: "yaodan03", + }, + { + phone: "No.65", + name: "wudijia", + }, + { + phone: "No.66", + name: "sunqi24", + }, + { + phone: "No.67", + name: "liangyuanhao", + }, + { + phone: "No.68", + name: "zhanghuaxiang", + }, + { + phone: "No.69", + name: "chenhualei", + }, + { + phone: "No.70", + name: "mijing02", + }, + { + phone: "No.71", + name: "yangfei34", + }, +]; \ No newline at end of file diff --git a/js/member.js b/js/member.js deleted file mode 100644 index ca2ea09..0000000 --- a/js/member.js +++ /dev/null @@ -1,1202 +0,0 @@ -var member = [ - { - "phone": "No.2038", - "name": "星野冥一" - }, - { - "phone": "No.0282", - "name": "Mr.Q" - }, - { - "phone": "No.3392", - "name": "一般人类" - }, - { - "phone": "No.8080", - "name": "萝莉捕捉者" - }, - { - "phone": "No.3855", - "name": "四代猫愿" - }, - { - "phone": "No.6389", - "name": "人形大魔王" - }, - { - "phone": "No.4440", - "name": "痴言心醉" - }, - { - "phone": "No.3170", - "name": "渣瓜一隻" - }, - { - "phone": "No.1688", - "name": "住之江圭太" - }, - { - "phone": "No.0018", - "name": "九条鱼卡" - }, - { - "phone": "No.0318", - "name": "nightor" - }, - { - "phone": "No.7712", - "name": "井下落石" - }, - { - "phone": "No.6561", - "name": "埃尔o妮娅" - }, - { - "phone": "No.1260", - "name": "Sapha" - }, - { - "phone": "No.6280", - "name": "西行寺蓝蓝路" - }, - { - "phone": "No.8517", - "name": "堀江由衣" - }, - { - "phone": "No.2335", - "name": "十万巫女" - }, - { - "phone": "No.2681", - "name": "Halu" - }, - { - "phone": "No.4024", - "name": "lupin" - }, - { - "phone": "No.0463", - "name": "太阳主宰" - }, - { - "phone": "No.2423", - "name": "alkd" - }, - { - "phone": "No.5357", - "name": "Allenz" - }, - { - "phone": "No.8751", - "name": "达也的背影" - }, - { - "phone": "No.0737", - "name": "神隐少女" - }, - { - "phone": "No.5959", - "name": "尐疯寳児不尐了" - }, - { - "phone": "No.8909", - "name": "⌒袶醽之子↓" - }, - { - "phone": "No.8441", - "name": "我家的二喵" - }, - { - "phone": "No.1746", - "name": "维他酱酱" - }, - { - "phone": "No.2856", - "name": "dodo" - }, - { - "phone": "No.6703", - "name": "米哟哟的咧" - }, - { - "phone": "No.9092", - "name": "一根呆毛" - }, - { - "phone": "No.3539", - "name": "Nadia" - }, - { - "phone": "No.7180", - "name": "hunter" - }, - { - "phone": "No.3679", - "name": "名将FG" - }, - { - "phone": "No.5131", - "name": "线性近似" - }, - { - "phone": "No.4146", - "name": "LOCKOFF" - }, - { - "phone": "No.2812", - "name": "jessie" - }, - { - "phone": "No.6918", - "name": "unoo" - }, - { - "phone": "No.3776", - "name": "上升气流君" - }, - { - "phone": "No.9873", - "name": "匿名希望" - }, - { - "phone": "No.1240", - "name": "下载好慢" - }, - { - "phone": "No.4839", - "name": "敢来一炮么" - }, - { - "phone": "No.0832", - "name": "高町奈叶" - }, - { - "phone": "No.5205", - "name": "我来打酱油" - }, - { - "phone": "No.4787", - "name": "JackDee" - }, - { - "phone": "No.2957", - "name": "加藤雪冬" - }, - { - "phone": "No.1294", - "name": "轻抿一口菊花茶" - }, - { - "phone": "No.2104", - "name": "捕猎Xloli" - }, - { - "phone": "No.3113", - "name": "南山有瓜" - }, - { - "phone": "No.8897", - "name": "きょうし" - }, - { - "phone": "No.1823", - "name": "50cent" - }, - { - "phone": "No.4174", - "name": "菊花交出来" - }, - { - "phone": "No.2189", - "name": "Fire小殳" - }, - { - "phone": "No.1691", - "name": "漆黑の斗狼" - }, - { - "phone": "No.9511", - "name": "远野志贵" - }, - { - "phone": "No.1513", - "name": "12週期新月" - }, - { - "phone": "No.1881", - "name": "狂气的月的兔" - }, - { - "phone": "No.8433", - "name": "田村ゆかり" - }, - { - "phone": "No.4468", - "name": "右代宫战人" - }, - { - "phone": "No.2172", - "name": "藤原妹紅" - }, - { - "phone": "No.1038", - "name": "萌萌自由" - }, - { - "phone": "No.8794", - "name": "八宝五圆杀" - }, - { - "phone": "No.0869", - "name": "Raryooh" - }, - { - "phone": "No.6173", - "name": "3y3s" - }, - { - "phone": "No.0857", - "name": "长门有妻" - }, - { - "phone": "No.3128", - "name": "装满酱油的好船" - }, - { - "phone": "No.9433", - "name": "超魔理沙" - }, - { - "phone": "No.5573", - "name": "灯灯灯等" - }, - { - "phone": "No.6059", - "name": "回lao家结婚" - }, - { - "phone": "No.9924", - "name": "奥妮克西娅" - }, - { - "phone": "No.7851", - "name": "道羝王者" - }, - { - "phone": "No.3350", - "name": "加納佳代子" - }, - { - "phone": "No.0520", - "name": "K - MAID" - }, - { - "phone": "No.2617", - "name": "山寨荼荼丸1" - }, - { - "phone": "No.7819", - "name": "墙角渣渣颓废子" - }, - { - "phone": "No.1714", - "name": "心理医生" - }, - { - "phone": "No.8236", - "name": "加纳佳代子" - }, - { - "phone": "No.8025", - "name": "库里艾拉" - }, - { - "phone": "No.9004", - "name": "手只是装饰" - }, - { - "phone": "No.9650", - "name": "秋庭里香酱" - }, - { - "phone": "No.0829", - "name": "彼方和歌" - }, - { - "phone": "No.2356", - "name": "里世界的我" - }, - { - "phone": "No.2219", - "name": "七夜栗琦不姓朱" - }, - { - "phone": "No.5832", - "name": "玄岚法師" - }, - { - "phone": "No.1550", - "name": "staya" - }, - { - "phone": "No.5450", - "name": "露露緹娅" - }, - { - "phone": "No.9498", - "name": "朝仓音姬" - }, - { - "phone": "No.6912", - "name": "东方橘君" - }, - { - "phone": "No.1414", - "name": "幻月之舞" - }, - { - "phone": "No.9994", - "name": "六月沐夏w" - }, - { - "phone": "No.8350", - "name": "推倒不管埋" - }, - { - "phone": "No.2392", - "name": "约修亚布莱特" - }, - { - "phone": "No.1506", - "name": "白钟莎罗" - }, - { - "phone": "No.4702", - "name": "翻滚吧贡丸" - }, - { - "phone": "No.7014", - "name": "安布雷拉" - }, - { - "phone": "No.9099", - "name": "钉宫病重症患" - }, - { - "phone": "No.4343", - "name": "摘花五十铃" - }, - { - "phone": "No.6606", - "name": "阿SAM" - }, - { - "phone": "No.5478", - "name": "qoyozy" - }, - { - "phone": "No.2292", - "name": "沙漠孤魂" - }, - { - "phone": "No.2879", - "name": "WSDS" - }, - { - "phone": "No.6300", - "name": "刀子子刀" - }, - { - "phone": "No.6392", - "name": "CNo15" - }, - { - "phone": "No.8092", - "name": "地狱の天使" - }, - { - "phone": "No.0647", - "name": "幻月陇睨" - }, - { - "phone": "No.1289", - "name": "家具全毁" - }, - { - "phone": "No.9142", - "name": "fishal" - }, - { - "phone": "No.0853", - "name": "Miku的内裤" - }, - { - "phone": "No.6973", - "name": "铃仙因番" - }, - { - "phone": "No.3898", - "name": "╲PAD长╱" - }, - { - "phone": "No.9806", - "name": "呼噜leon" - }, - { - "phone": "No.8117", - "name": "CCAV" - }, - { - "phone": "No.8835", - "name": "xxmu317" - }, - { - "phone": "No.6238", - "name": "水無灯里" - }, - { - "phone": "No.3758", - "name": "高达试作1号机" - }, - { - "phone": "No.8718", - "name": "蓬莱山の辉夜" - }, - { - "phone": "No.3226", - "name": "久保帶人" - }, - { - "phone": "No.0577", - "name": "山那边的饼子" - }, - { - "phone": "No.9028", - "name": "木下秀吉" - }, - { - "phone": "No.5881", - "name": "アルファルド" - }, - { - "phone": "No.3443", - "name": "normal" - }, - { - "phone": "No.3541", - "name": "ORZlag" - }, - { - "phone": "No.8875", - "name": "传说中的废材" - }, - { - "phone": "No.7828", - "name": "搞基按次收费" - }, - { - "phone": "No.8828", - "name": "御坂妹妹" - }, - { - "phone": "No.6552", - "name": "蓬莱山輝夜" - }, - { - "phone": "No.6784", - "name": "白龙跃居紫玉星" - }, - { - "phone": "No.5513", - "name": "达玛婆婆" - }, - { - "phone": "No.7891", - "name": "我可不敢和你争" - }, - { - "phone": "No.7607", - "name": "伊吹风子" - }, - { - "phone": "No.9754", - "name": "亲爱的翠翠" - }, - { - "phone": "No.0933", - "name": "クオリア" - }, - { - "phone": "No.1989", - "name": "深水阳菜" - }, - { - "phone": "No.3730", - "name": "骑车的牛" - }, - { - "phone": "No.7281", - "name": "karma" - }, - { - "phone": "No.2933", - "name": "元首的笔" - }, - { - "phone": "No.7132", - "name": "瞌睡の默默" - }, - { - "phone": "No.3869", - "name": "灰过灰过" - }, - { - "phone": "No.6211", - "name": "水无灯里" - }, - { - "phone": "No.2067", - "name": "川添珠姬" - }, - { - "phone": "No.7349", - "name": "水桥帕露西" - }, - { - "phone": "No.0828", - "name": "Loki" - }, - { - "phone": "No.3081", - "name": "不识院苍月" - }, - { - "phone": "No.6784", - "name": "空闲蝙蝠" - }, - { - "phone": "No.6257", - "name": "愉悦的小蛇君" - }, - { - "phone": "No.4402", - "name": "月光下的追忆" - }, - { - "phone": "No.1745", - "name": "mono" - }, - { - "phone": "No.7825", - "name": "ritz" - }, - { - "phone": "No.7509", - "name": "狂暴四倍速" - }, - { - "phone": "No.9798", - "name": "绯鵺之森" - }, - { - "phone": "No.4168", - "name": "井上美羽" - }, - { - "phone": "No.2310", - "name": "人形大魔王V" - }, - { - "phone": "No.8251", - "name": "坂上斗真" - }, - { - "phone": "No.3271", - "name": "真目斗真" - }, - { - "phone": "No.5871", - "name": "我才不是触手" - }, - { - "phone": "No.2562", - "name": "云雀恭弥" - }, - { - "phone": "No.1477", - "name": "中禅寺远子" - }, - { - "phone": "No.1566", - "name": "惡魔の禮讚" - }, - { - "phone": "No.7651", - "name": "reno" - }, - { - "phone": "No.1979", - "name": "八九寺真宵" - }, - { - "phone": "No.0749", - "name": "睡意朦胧" - }, - { - "phone": "No.3888", - "name": "峰岛由宇" - }, - { - "phone": "No.6929", - "name": "终于整得号了" - }, - { - "phone": "No.4990", - "name": "猥琐神教教徒" - }, - { - "phone": "No.5406", - "name": "玻璃渣渣" - }, - { - "phone": "No.8348", - "name": "dio的世界" - }, - { - "phone": "No.3779", - "name": "洩矢诹访子" - }, - { - "phone": "No.6907", - "name": "冰蓝若幻" - }, - { - "phone": "No.3014", - "name": "鵺野鸣介" - }, - { - "phone": "No.3244", - "name": "村纱水蜜" - }, - { - "phone": "No.6815", - "name": "D..猫殿" - }, - { - "phone": "No.6466", - "name": "河城荷取" - }, - { - "phone": "No.4002", - "name": "月光下的八雲紫" - }, - { - "phone": "No.9101", - "name": "御坂御坂" - }, - { - "phone": "No.3374", - "name": "火焰猫燐" - }, - { - "phone": "No.1151", - "name": "云居一轮" - }, - { - "phone": "No.0128", - "name": "日野あかね" - }, - { - "phone": "No.3955", - "name": "存在感↓" - }, - { - "phone": "No.3178", - "name": "纱 亚美丶" - }, - { - "phone": "No.0023", - "name": "十六夜咲夜℡" - }, - { - "phone": "No.9882", - "name": "金坷垃直销" - }, - { - "phone": "No.8628", - "name": "羽桐柠檬" - }, - { - "phone": "No.4824", - "name": "石之纷如" - }, - { - "phone": "No.2931", - "name": "聖地大哥" - }, - { - "phone": "No.7093", - "name": "admin " - }, - { - "phone": "No.5541", - "name": "佐天泪子" - }, - { - "phone": "No.4469", - "name": "池田由纪" - }, - { - "phone": "No.6416", - "name": "三千院风" - }, - { - "phone": "No.1934", - "name": "轻闭双眼" - }, - { - "phone": "No.9001", - "name": "小狐仙仙" - }, - { - "phone": "No.8177", - "name": "阿道夫希特勒" - }, - { - "phone": "No.4009", - "name": "高岭爱花" - }, - { - "phone": "No.0536", - "name": "snoopy" - }, - { - "phone": "No.6819", - "name": "Maiニャン" - }, - { - "phone": "No.9980", - "name": "怜情惜缘" - }, - { - "phone": "No.1778", - "name": "柾木天地" - }, - { - "phone": "No.8285", - "name": "混乱与雄伟大臣" - }, - { - "phone": "No.7089", - "name": "茵蒂克丝" - }, - { - "phone": "No.4694", - "name": "哈曼卡恩" - }, - { - "phone": "No.7697", - "name": "┼六夜咲夜" - }, - { - "phone": "No.4458", - "name": "一方通行" - }, - { - "phone": "No.0593", - "name": "forluna" - }, - { - "phone": "No.6579", - "name": "红颜晕墨色" - }, - { - "phone": "No.0276", - "name": "絕望先生" - }, - { - "phone": "No.2417", - "name": "我是伪的人" - }, - { - "phone": "No.1831", - "name": "藍沢ヒカル" - }, - { - "phone": "No.4487", - "name": "我爱吃黄瓜" - }, - { - "phone": "No.5587", - "name": "毅丝不挂" - }, - { - "phone": "No.7726", - "name": "无聊至极" - }, - { - "phone": "No.7721", - "name": "哎哟射你" - }, - { - "phone": "No.8680", - "name": "琴吹七濑" - }, - { - "phone": "No.5445", - "name": "欧泥酱~" - }, - { - "phone": "No.7369", - "name": "枫の雨菡" - }, - { - "phone": "No.5991", - "name": "望尘莫及" - }, - { - "phone": "No.6437", - "name": "新的沙包" - }, - { - "phone": "No.8579", - "name": "崩坏の狸猫" - }, - { - "phone": "No.7952", - "name": "伪の琪露诺" - }, - { - "phone": "No.0675", - "name": "戏言跟班" - }, - { - "phone": "No.2894", - "name": "七転八倒" - }, - { - "phone": "No.2213", - "name": "米娜·柴佩西" - }, - { - "phone": "No.2686", - "name": "в.α.d" - }, - { - "phone": "No.6736", - "name": "佐佐玛利亚" - }, - { - "phone": "No.1785", - "name": "CCAV - H" - }, - { - "phone": "No.8544", - "name": "咕噜噜XD" - }, - { - "phone": "No.5730", - "name": "siriusY" - }, - { - "phone": "No.7852", - "name": ".@.@." - }, - { - "phone": "No.2050", - "name": "生女当如泉此方" - }, - { - "phone": "No.2505", - "name": "鞠部有羽" - }, - { - "phone": "No.7396", - "name": "Skaka - 冰" - }, - { - "phone": "No.1046", - "name": "泷月まなつ" - }, - { - "phone": "No.0039", - "name": "天草十三" - }, - { - "phone": "No.7358", - "name": "八城十八" - }, - { - "phone": "No.0815", - "name": "ee.zsy" - }, - { - "phone": "No.0088", - "name": "ユリ.妖" - }, - { - "phone": "No.9780", - "name": "夢の雪緣" - }, - { - "phone": "No.8224", - "name": "光电総菊" - }, - { - "phone": "No.5922", - "name": "夕阳月梦" - }, - { - "phone": "No.3149", - "name": "lj之成" - }, - { - "phone": "No.9229", - "name": "发奋涂墙不能" - }, - { - "phone": "No.4397", - "name": "莪悩殘孒" - }, - { - "phone": "No.6519", - "name": "人间失格" - }, - { - "phone": "No.1967", - "name": "姬路瑞希" - }, - { - "phone": "No.2663", - "name": "亞特蘭斯蒂" - }, - { - "phone": "No.9624", - "name": "上条当妈" - }, - { - "phone": "No.2978", - "name": "油焖罐头" - }, - { - "phone": "No.8795", - "name": "┿六夜咲夜" - }, - { - "phone": "No.9272", - "name": "pjj007" - }, - { - "phone": "No.9188", - "name": "风灵の礼赞" - }, - { - "phone": "No.8639", - "name": "傻逼同化中心" - }, - { - "phone": "No.7784", - "name": "托奇老师" - }, - { - "phone": "No.5276", - "name": "竜骑士07" - }, - { - "phone": "No.5482", - "name": "木之本小可" - }, - { - "phone": "No.7228", - "name": "因幡てゐ" - }, - { - "phone": "No.8435", - "name": "ばくまる" - }, - { - "phone": "No.3811", - "name": "蛋疼超人" - }, - { - "phone": "No.0339", - "name": "火星上的F91" - }, - { - "phone": "No.2985", - "name": "木下優子" - }, - { - "phone": "No.6558", - "name": "上条 - 当麻" - }, - { - "phone": "No.4008", - "name": "小五兄贵" - }, - { - "phone": "No.3978", - "name": "linhxl" - }, - { - "phone": "No.9703", - "name": "LINK" - }, - { - "phone": "No.6287", - "name": "花生闲人" - }, - { - "phone": "No.0376", - "name": "nono" - }, - { - "phone": "No.6635", - "name": "allen" - }, - { - "phone": "No.2273", - "name": "藤原兄肛" - }, - { - "phone": "No.9176", - "name": "岛田美波" - }, - { - "phone": "No.6679", - "name": "ZUN伞" - }, - { - "phone": "No.8407", - "name": "我就是这么绅士" - }, - { - "phone": "No.1396", - "name": "嘎嘎i狼" - }, - { - "phone": "No.2657", - "name": "夏亚.阿兹纳布" - }, - { - "phone": "No.1602", - "name": "TMCP123" - }, - { - "phone": "No.4119", - "name": "纯情286" - }, - { - "phone": "No.4504", - "name": "操蛇之神" - }, - { - "phone": "No.0869", - "name": "铃仙·优昙华院" - }, - { - "phone": "No.7883", - "name": "咆哮的由希" - }, - { - "phone": "No.2114", - "name": "亡者王者" - }, - { - "phone": "No.3214", - "name": "放开那个流氓" - }, - { - "phone": "No.2161", - "name": "╂六夜咲夜" - }, - { - "phone": "No.2487", - "name": "Elifaus" - }, - { - "phone": "No.0947", - "name": "二小姐の玩具" - }, - { - "phone": "No.3867", - "name": "吾妻玲二" - }, - { - "phone": "No.6884", - "name": "逆袭の阿姆罗" - }, - { - "phone": "No.9884", - "name": "给爷平滑" - }, - { - "phone": "No.3538", - "name": "yyuhz" - }, - { - "phone": "No.6602", - "name": "炉心熔解" - }, - { - "phone": "No.5757", - "name": "风见幽香" - }, - { - "phone": "No.4833", - "name": "拉尔夏娅" - }, - { - "phone": "No.6726", - "name": "犯罪高手" - }, - { - "phone": "No.4343", - "name": "华丽de没落" - }, - { - "phone": "No.4652", - "name": "ViNO" - }, - { - "phone": "No.9206", - "name": "狂图看天" - }, - { - "phone": "No.7008", - "name": "圈圈外加叉叉" - }, - { - "phone": "No.1657", - "name": "湛蓝之炎" - }, - { - "phone": "No.2802", - "name": "迷茫的虫" - }, - { - "phone": "No.8920", - "name": "欺霜胜雪" - }, - { - "phone": "No.1822", - "name": "北方丈助" - }, - { - "phone": "No.9032", - "name": "「沙耶の唄」" - }, - { - "phone": "No.5723", - "name": "adfs88" - }, - { - "phone": "No.6327", - "name": "cyc123" - }, - { - "phone": "No.5311", - "name": "サリアの歌" - } -] \ No newline at end of file diff --git a/result.html b/result.html deleted file mode 100755 index f4bc10d..0000000 --- a/result.html +++ /dev/null @@ -1,321 +0,0 @@ - - - - - - - - 年会抽奖小程序 - - - - - - -
- -
-
-
-
- - - -
- - - - - - - - \ No newline at end of file From b469f0afd94060953faacff1fd94db786e0750e3 Mon Sep 17 00:00:00 2001 From: huangjue Date: Tue, 4 Jan 2022 10:56:43 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 44 +++++++- index.html | 229 +------------------------------------ js/allMembers.js | 286 +++++++++++------------------------------------ js/index.js | 225 +++++++++++++++++++++++++++++++++++++ 4 files changed, 335 insertions(+), 449 deletions(-) create mode 100644 js/index.js diff --git a/.gitignore b/.gitignore index 7a1537b..5a4f061 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,42 @@ -.idea -node_modules + +# Created by https://www.toptal.com/developers/gitignore/api/macos,vuejs +# Edit at https://www.toptal.com/developers/gitignore?templates=macos,vuejs + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Vuejs ### +# Recommended template: Node.gitignore + +node_modules/ +dist/ +npm-debug.log +yarn-error.log + +# End of https://www.toptal.com/developers/gitignore/api/macos,vuejs \ No newline at end of file diff --git a/index.html b/index.html index b2cffe7..2d022b4 100755 --- a/index.html +++ b/index.html @@ -36,234 +36,7 @@ - + \ No newline at end of file diff --git a/js/allMembers.js b/js/allMembers.js index 65ce708..c4e5133 100644 --- a/js/allMembers.js +++ b/js/allMembers.js @@ -1,286 +1,134 @@ var allMembers = [ { - phone: "No.1", - name: "zhoudunyang", + phone: 'No.1', + name: '骆晶明', }, { - phone: "No.2", - name: "huangjue", + phone: 'No.2', + name: '高菲菲', }, { - phone: "No.3", - name: "liujiang04", + phone: 'No.3', + name: '康琪', }, { - phone: "No.4", - name: "zhumengzhu", + phone: 'No.4', + name: '李静', }, { - phone: "No.5", - name: "huozhiying", + phone: 'No.5', + name: '刘静', }, { - phone: "No.6", - name: "zhangzhe15", + phone: 'No.6', + name: '陈静', }, { - phone: "No.7", - name: "wangtong09", + phone: 'No.7', + name: '夏美玲', }, { - phone: "No.8", - name: "shihuashen", + phone: 'No.8', + name: '宋亚萍', }, { - phone: "No.9", - name: "wangzhicheng03", + phone: 'No.9', + name: '冯秀娟', }, { - phone: "No.10", - name: "liuyanghe02", + phone: 'No.10', + name: '唐晨', }, { - phone: "No.11", - name: "yangzhongjing", + phone: 'No.11', + name: '邱敏欣', }, { - phone: "No.12", - name: "peiyu02", + phone: 'No.12', + name: '杨云', }, { - phone: "No.13", - name: "zhidi.xia", + phone: 'No.13', + name: '王青', }, { - phone: "No.14", - name: "zhangchen29", + phone: 'No.14', + name: '王馨悦', }, { - phone: "No.15", - name: "liteng07", + phone: 'No.15', + name: '芦丹', }, { - phone: "No.16", - name: "liruifeng", + phone: 'No.16', + name: '李静雯', }, { - phone: "No.17", - name: "zhouchangshun", + phone: 'No.17', + name: '徐亭亭', }, { - phone: "No.18", - name: "qiushi02", + phone: 'No.18', + name: '杜祝英', }, { - phone: "No.19", - name: "yangguoliang", + phone: 'No.19', + name: '董旭冉', }, { - phone: "No.20", - name: "wangpeng42", + phone: 'No.20', + name: '杨露', }, { - phone: "No.21", - name: "zhangxianpeng", + phone: 'No.21', + name: '孟瑞雪', }, { - phone: "No.22", - name: "wangyafei07", + phone: 'No.22', + name: '孙金玥', }, { - phone: "No.23", - name: "yangliuning", + phone: 'No.23', + name: '刘素素', }, { - phone: "No.24", - name: "hante", + phone: 'No.24', + name: '钟国伟', }, { - phone: "No.25", - name: "xusuxuan", + phone: 'No.25', + name: '杨喆', }, { - phone: "No.26", - name: "maiming", + phone: 'No.26', + name: '王瑶', }, { - phone: "No.27", - name: "changjing03", + phone: 'No.27', + name: '张莹', }, { - phone: "No.28", - name: "qinzhanqiang", + phone: 'No.28', + name: '郭瑞', }, { - phone: "No.29", - name: "yangjingwen05", + phone: 'No.29', + name: '白力丞', }, { - phone: "No.30", - name: "yangyidong02", + phone: 'No.30', + name: '胡学艺', }, { - phone: "No.31", - name: "zhangyuchen04", + phone: 'No.31', + name: '韩月宾', }, { - phone: "No.32", - name: "xutaokai", + phone: 'No.32', + name: '朱洁', }, { - phone: "No.33", - name: "zhaohailong06", + phone: 'No.33', + name: '鲁萍', }, - { - phone: "No.34", - name: "suxun", - }, - { - phone: "No.35", - name: "zhangtengteng03", - }, - { - phone: "No.36", - name: "caozhengwei", - }, - { - phone: "No.37", - name: "zhangxilin02", - }, - { - phone: "No.38", - name: "liuhenglin", - }, - { - phone: "No.39", - name: "litao63", - }, - { - phone: "No.40", - name: "chenhaitao04", - }, - { - phone: "No.41", - name: "qujingguo", - }, - { - phone: "No.42", - name: "liyuxin06", - }, - { - phone: "No.43", - name: "zhaohuiying02", - }, - { - phone: "No.44", - name: "chenxiang25", - }, - { - phone: "No.45", - name: "gaozhong03", - }, - { - phone: "No.46", - name: "houzhiyuan02", - }, - { - phone: "No.47", - name: "wb_suzhehui", - }, - { - phone: "No.48", - name: "xujinkang02", - }, - { - phone: "No.49", - name: "zhouzhe04", - }, - { - phone: "No.50", - name: "maye04", - }, - { - phone: "No.51", - name: "qinwenchao02", - }, - { - phone: "No.52", - name: "wb_wangshenbing", - }, - { - phone: "No.53", - name: "shenzhili", - }, - { - phone: "No.54", - name: "fangxiaoming", - }, - { - phone: "No.55", - name: "zhangyusheng05", - }, - { - phone: "No.56", - name: "chenjian45", - }, - { - phone: "No.57", - name: "yangwenqing", - }, - { - phone: "No.58", - name: "guohuang", - }, - { - phone: "No.59", - name: "hukaidi", - }, - { - phone: "No.60", - name: "tongxiaotian", - }, - { - phone: "No.61", - name: "sunsongtao", - }, - { - phone: "No.62", - name: "liukaiyuan", - }, - { - phone: "No.63", - name: "nichengyu", - }, - { - phone: "No.64", - name: "yaodan03", - }, - { - phone: "No.65", - name: "wudijia", - }, - { - phone: "No.66", - name: "sunqi24", - }, - { - phone: "No.67", - name: "liangyuanhao", - }, - { - phone: "No.68", - name: "zhanghuaxiang", - }, - { - phone: "No.69", - name: "chenhualei", - }, - { - phone: "No.70", - name: "mijing02", - }, - { - phone: "No.71", - name: "yangfei34", - }, -]; \ No newline at end of file +]; diff --git a/js/index.js b/js/index.js new file mode 100644 index 0000000..c882916 --- /dev/null +++ b/js/index.js @@ -0,0 +1,225 @@ +const KEY = '_lottery_winner'; +const RECORD_KEY = '_lottery_winner_record'; +const winnerMap = new Map(); +const winRecords = []; + +function loadStorage() { + try { + let result = localStorage.getItem(KEY); + let record = localStorage.getItem(RECORD_KEY); + + if (result && record) { + winnerMap = new Map(JSON.parse(result)); + winRecords = JSON.parse(record); + } else { + winnerMap.clear(); + winRecords = []; + } + } catch (e) {} +} + +function clearStorage() { + localStorage.clear(KEY); + localStorage.clear(RECORD_KEY); +} + +function setStorage() { + localStorage.setItem(KEY, JSON.stringify(Array.from(winnerMap.entries()))); + localStorage.setItem(RECORD_KEY, JSON.stringify(winRecords)); +} + +function addWinners(winners) { + winRecords.push({ time: Date.now(), winners }); + winners.forEach(winner => { + winnerMap.set(getKey(winner), true); + }); +} + +function initTagCanvas() { + TagCanvas.Start('memberCanvas', '', { + textColour: null, + initial: speed(), + dragControl: 1, + textHeight: 14, + }); +} + +function speed() { + return [0.1 * Math.random() + 0.01, -(0.1 * Math.random() + 0.01)]; +} + +function speedUp() { + TagCanvas.SetSpeed('memberCanvas', speed()); +} + +function speedDown() { + TagCanvas.SetSpeed('memberCanvas', [5, 1]); +} + +function reloadTagCanvas() { + TagCanvas.Reload('memberCanvas'); +} + +function getKey(item) { + return item.name + '-' + item.phone; +} + +function updateCanvasInnerHTML() { + const html = ['
    ']; + allMembers.forEach(item => { + let className = winnerMap.has(getKey(item)) ? 'winner' : 'member'; + + html.push(`
  • ${item.name}
  • `); + }); + html.push('
'); + document.getElementById('memberCanvas').innerHTML = html.join(''); +} + +function getRandomMembers(members, selectedNumber) { + if (members.length <= selectedNumber) { + return [...members]; + } + + let currentSelectedMembers = []; + + while (currentSelectedMembers.length < selectedNumber) { + let random = Math.floor(Math.random() * members.length); + let randomMember = members[random]; + if ( + currentSelectedMembers.findIndex(element => { + return element.name === randomMember.name; + }) === -1 + ) { + currentSelectedMembers.push(randomMember); + } + } + + return currentSelectedMembers; +} + +function isWinner(member) { + return winnerMap.has(getKey(member)); +} + +function createWinnerHTML(winners) { + return winners.reduce((prev, next) => { + return `${prev}${next.phone}-${next.name}`; + }, ''); +} + +function createWinnerRecordsHTML() { + if (winRecords.length === 0) { + return `
无记录!
`; + } + + return winRecords.reduce((prev, next) => { + let winnersHTML = next.winners.map(winner => { + return `${winner.phone}-${winner.name}`; + }); + + return `${prev}
${new Date( + next.time, + ).toLocaleString()}${winnersHTML.join(',')}
`; + }, ''); +} + +function lottery(number) { + let list = document.getElementById('memberCanvas').getElementsByTagName('a'); + let color = 'yellow'; + let notSelectedMembers = allMembers.filter(member => !isWinner(member)); + let newWinners = getRandomMembers(notSelectedMembers, number); + + addWinners(newWinners); + setStorage(); + + return newWinners; +} + +function initVue() { + new Vue({ + el: '#container', + data: { + selected: 3, + running: false, + btns: [ + { name: '三等奖(3)人', value: 3 }, + { name: '二等奖(2)人', value: 2 }, + { name: '一等奖(1)人', value: 1 }, + ], + }, + mounted() { + updateCanvasInnerHTML(); + initTagCanvas(); + }, + methods: { + reset: function () { + if (confirm('确定要重置么?所有之前的抽奖历史将被清除!')) { + clearStorage(); + loadStorage(); + updateCanvasInnerHTML(); + } + }, + loadStorageInfo() { + loadStorage(); + updateCanvasInnerHTML(); + }, + showWinnerRecords() { + let $winnerRecords = document.querySelector('#winnerRecords'); + if ($winnerRecords.style.display !== 'block') { + $winnerRecords.innerHTML = createWinnerRecordsHTML(); + $winnerRecords.style.display = 'block'; + } + }, + hideWinnerRecords() { + let $winnerRecords = document.querySelector('#winnerRecords'); + if ($winnerRecords.style.display !== ' none') { + $winnerRecords.innerHTML = ''; + $winnerRecords.style.display = 'none'; + } + }, + onClick: function (num) { + document.querySelector('#result').style.display = 'none'; + document.querySelector('#main').classList.remove('mask'); + + this.selected = num; + }, + toggle: function () { + this.hideWinnerRecords(); + if (this.running) { + let $result = document.querySelector('#result'); + + speedUp(); + if (allMembers.length === winnerMap.size) { + $result.style.display = 'block'; + $result.innerHTML = '已抽完'; + return; + } + let winners = lottery(this.selected); + + $result.style.display = 'block'; + $result.innerHTML = createWinnerHTML(winners); + updateCanvasInnerHTML(); + reloadTagCanvas(); + setTimeout(function () { + document.querySelector('#main').classList.add('mask'); + }, 300); + } else { + document.querySelector('#result').style.display = 'none'; + document.querySelector('#main').classList.remove('mask'); + speedDown(); + } + this.running = !this.running; + }, + }, + }); +} + +function init() { + let canvas = document.querySelector('#memberCanvas'); + canvas.width = document.body.offsetWidth; + canvas.height = document.body.offsetHeight; + + initVue(); +} + +init(); From b701b2a58f9723adcf188bf9b68f796e858a376f Mon Sep 17 00:00:00 2001 From: huangjue Date: Tue, 4 Jan 2022 16:25:24 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8DUI=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/index.js | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/js/index.js b/js/index.js index c882916..4ffb459 100644 --- a/js/index.js +++ b/js/index.js @@ -123,6 +123,23 @@ function createWinnerRecordsHTML() { }, ''); } +function hideWinnersMask() { + document.querySelector('#result').style.display = 'none'; + document.querySelector('#main').classList.remove('mask'); +} + +function showWinnersMask() { + document.querySelector('#main').classList.add('mask'); +} + +function hideWinnerRecords() { + let $winnerRecords = document.querySelector('#winnerRecords'); + if ($winnerRecords.style.display !== ' none') { + $winnerRecords.innerHTML = ''; + $winnerRecords.style.display = 'none'; + } +} + function lottery(number) { let list = document.getElementById('memberCanvas').getElementsByTagName('a'); let color = 'yellow'; @@ -154,14 +171,20 @@ function initVue() { methods: { reset: function () { if (confirm('确定要重置么?所有之前的抽奖历史将被清除!')) { + hideWinnerRecords(); + hideWinnersMask(); + clearStorage(); loadStorage(); updateCanvasInnerHTML(); + reloadTagCanvas(); } }, + loadStorageInfo() { loadStorage(); updateCanvasInnerHTML(); + reloadTagCanvas(); }, showWinnerRecords() { let $winnerRecords = document.querySelector('#winnerRecords'); @@ -170,21 +193,13 @@ function initVue() { $winnerRecords.style.display = 'block'; } }, - hideWinnerRecords() { - let $winnerRecords = document.querySelector('#winnerRecords'); - if ($winnerRecords.style.display !== ' none') { - $winnerRecords.innerHTML = ''; - $winnerRecords.style.display = 'none'; - } - }, onClick: function (num) { - document.querySelector('#result').style.display = 'none'; - document.querySelector('#main').classList.remove('mask'); + hideWinnersMask(); this.selected = num; }, toggle: function () { - this.hideWinnerRecords(); + hideWinnerRecords(); if (this.running) { let $result = document.querySelector('#result'); @@ -200,12 +215,11 @@ function initVue() { $result.innerHTML = createWinnerHTML(winners); updateCanvasInnerHTML(); reloadTagCanvas(); - setTimeout(function () { - document.querySelector('#main').classList.add('mask'); + setTimeout(() => { + showWinnersMask(); }, 300); } else { - document.querySelector('#result').style.display = 'none'; - document.querySelector('#main').classList.remove('mask'); + hideWinnersMask(); speedDown(); } this.running = !this.running; From ce0c368ab724c0136dca14c71d09873d4a5100ff Mon Sep 17 00:00:00 2001 From: huangjue Date: Tue, 4 Jan 2022 17:09:07 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=A0=B7=E5=BC=8F,?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BE=93=E5=85=A5=E6=A1=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/main.css | 17 +++++++++++++++++ css/pure.css | 11 +++++++++++ index.html | 6 ++++-- js/index.js | 2 -- 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 css/pure.css diff --git a/css/main.css b/css/main.css index 1003b1f..af8a40c 100644 --- a/css/main.css +++ b/css/main.css @@ -225,3 +225,20 @@ input[type='submit'] { .winner { color: #ff0; } + +input { + outline-style: none; + border: 1px solid #ccc; + border-radius: 3px; + padding: 10px 14px; + width: 100px; + font-size: 14px; + font-weight: 700; +} + +input:focus{ + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6) +} \ No newline at end of file diff --git a/css/pure.css b/css/pure.css new file mode 100644 index 0000000..5b2aaf8 --- /dev/null +++ b/css/pure.css @@ -0,0 +1,11 @@ +/*! +Pure v2.0.6 +Copyright 2013 Yahoo! +Licensed under the BSD License. +https://github.com/pure-css/pure/blob/master/LICENSE +*/ +/*! +normalize.css v | MIT License | git.io/normalize +Copyright (c) Nicolas Gallagher and Jonathan Neal +*/ +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html{font-family:sans-serif}.hidden,[hidden]{display:none!important}.pure-img{max-width:100%;height:auto;display:block}.pure-g{letter-spacing:-.31em;text-rendering:optimizespeed;font-family:FreeSans,Arimo,"Droid Sans",Helvetica,Arial,sans-serif;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-line-pack:start;align-content:flex-start}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){table .pure-g{display:block}}.opera-only :-o-prefocus,.pure-g{word-spacing:-0.43em}.pure-u{display:inline-block;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-g [class*=pure-u]{font-family:sans-serif}.pure-u-1,.pure-u-1-1,.pure-u-1-12,.pure-u-1-2,.pure-u-1-24,.pure-u-1-3,.pure-u-1-4,.pure-u-1-5,.pure-u-1-6,.pure-u-1-8,.pure-u-10-24,.pure-u-11-12,.pure-u-11-24,.pure-u-12-24,.pure-u-13-24,.pure-u-14-24,.pure-u-15-24,.pure-u-16-24,.pure-u-17-24,.pure-u-18-24,.pure-u-19-24,.pure-u-2-24,.pure-u-2-3,.pure-u-2-5,.pure-u-20-24,.pure-u-21-24,.pure-u-22-24,.pure-u-23-24,.pure-u-24-24,.pure-u-3-24,.pure-u-3-4,.pure-u-3-5,.pure-u-3-8,.pure-u-4-24,.pure-u-4-5,.pure-u-5-12,.pure-u-5-24,.pure-u-5-5,.pure-u-5-6,.pure-u-5-8,.pure-u-6-24,.pure-u-7-12,.pure-u-7-24,.pure-u-7-8,.pure-u-8-24,.pure-u-9-24{display:inline-block;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-u-1-24{width:4.1667%}.pure-u-1-12,.pure-u-2-24{width:8.3333%}.pure-u-1-8,.pure-u-3-24{width:12.5%}.pure-u-1-6,.pure-u-4-24{width:16.6667%}.pure-u-1-5{width:20%}.pure-u-5-24{width:20.8333%}.pure-u-1-4,.pure-u-6-24{width:25%}.pure-u-7-24{width:29.1667%}.pure-u-1-3,.pure-u-8-24{width:33.3333%}.pure-u-3-8,.pure-u-9-24{width:37.5%}.pure-u-2-5{width:40%}.pure-u-10-24,.pure-u-5-12{width:41.6667%}.pure-u-11-24{width:45.8333%}.pure-u-1-2,.pure-u-12-24{width:50%}.pure-u-13-24{width:54.1667%}.pure-u-14-24,.pure-u-7-12{width:58.3333%}.pure-u-3-5{width:60%}.pure-u-15-24,.pure-u-5-8{width:62.5%}.pure-u-16-24,.pure-u-2-3{width:66.6667%}.pure-u-17-24{width:70.8333%}.pure-u-18-24,.pure-u-3-4{width:75%}.pure-u-19-24{width:79.1667%}.pure-u-4-5{width:80%}.pure-u-20-24,.pure-u-5-6{width:83.3333%}.pure-u-21-24,.pure-u-7-8{width:87.5%}.pure-u-11-12,.pure-u-22-24{width:91.6667%}.pure-u-23-24{width:95.8333%}.pure-u-1,.pure-u-1-1,.pure-u-24-24,.pure-u-5-5{width:100%}.pure-button{display:inline-block;line-height:normal;white-space:nowrap;vertical-align:middle;text-align:center;cursor:pointer;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:border-box;box-sizing:border-box}.pure-button::-moz-focus-inner{padding:0;border:0}.pure-button-group{letter-spacing:-.31em;text-rendering:optimizespeed}.opera-only :-o-prefocus,.pure-button-group{word-spacing:-0.43em}.pure-button-group .pure-button{letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-button{font-family:inherit;font-size:100%;padding:.5em 1em;color:rgba(0,0,0,.8);border:none transparent;background-color:#e6e6e6;text-decoration:none;border-radius:2px}.pure-button-hover,.pure-button:focus,.pure-button:hover{background-image:-webkit-gradient(linear,left top,left bottom,from(transparent),color-stop(40%,rgba(0,0,0,.05)),to(rgba(0,0,0,.1)));background-image:linear-gradient(transparent,rgba(0,0,0,.05) 40%,rgba(0,0,0,.1))}.pure-button:focus{outline:0}.pure-button-active,.pure-button:active{-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.15) inset,0 0 6px rgba(0,0,0,.2) inset;box-shadow:0 0 0 1px rgba(0,0,0,.15) inset,0 0 6px rgba(0,0,0,.2) inset;border-color:#000}.pure-button-disabled,.pure-button-disabled:active,.pure-button-disabled:focus,.pure-button-disabled:hover,.pure-button[disabled]{border:none;background-image:none;opacity:.4;cursor:not-allowed;-webkit-box-shadow:none;box-shadow:none;pointer-events:none}.pure-button-hidden{display:none}.pure-button-primary,.pure-button-selected,a.pure-button-primary,a.pure-button-selected{background-color:#0078e7;color:#fff}.pure-button-group .pure-button{margin:0;border-radius:0;border-right:1px solid rgba(0,0,0,.2)}.pure-button-group .pure-button:first-child{border-top-left-radius:2px;border-bottom-left-radius:2px}.pure-button-group .pure-button:last-child{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:none}.pure-form input[type=color],.pure-form input[type=date],.pure-form input[type=datetime-local],.pure-form input[type=datetime],.pure-form input[type=email],.pure-form input[type=month],.pure-form input[type=number],.pure-form input[type=password],.pure-form input[type=search],.pure-form input[type=tel],.pure-form input[type=text],.pure-form input[type=time],.pure-form input[type=url],.pure-form input[type=week],.pure-form select,.pure-form textarea{padding:.5em .6em;display:inline-block;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 3px #ddd;box-shadow:inset 0 1px 3px #ddd;border-radius:4px;vertical-align:middle;-webkit-box-sizing:border-box;box-sizing:border-box}.pure-form input:not([type]){padding:.5em .6em;display:inline-block;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 3px #ddd;box-shadow:inset 0 1px 3px #ddd;border-radius:4px;-webkit-box-sizing:border-box;box-sizing:border-box}.pure-form input[type=color]{padding:.2em .5em}.pure-form input[type=color]:focus,.pure-form input[type=date]:focus,.pure-form input[type=datetime-local]:focus,.pure-form input[type=datetime]:focus,.pure-form input[type=email]:focus,.pure-form input[type=month]:focus,.pure-form input[type=number]:focus,.pure-form input[type=password]:focus,.pure-form input[type=search]:focus,.pure-form input[type=tel]:focus,.pure-form input[type=text]:focus,.pure-form input[type=time]:focus,.pure-form input[type=url]:focus,.pure-form input[type=week]:focus,.pure-form select:focus,.pure-form textarea:focus{outline:0;border-color:#129fea}.pure-form input:not([type]):focus{outline:0;border-color:#129fea}.pure-form input[type=checkbox]:focus,.pure-form input[type=file]:focus,.pure-form input[type=radio]:focus{outline:thin solid #129FEA;outline:1px auto #129FEA}.pure-form .pure-checkbox,.pure-form .pure-radio{margin:.5em 0;display:block}.pure-form input[type=color][disabled],.pure-form input[type=date][disabled],.pure-form input[type=datetime-local][disabled],.pure-form input[type=datetime][disabled],.pure-form input[type=email][disabled],.pure-form input[type=month][disabled],.pure-form input[type=number][disabled],.pure-form input[type=password][disabled],.pure-form input[type=search][disabled],.pure-form input[type=tel][disabled],.pure-form input[type=text][disabled],.pure-form input[type=time][disabled],.pure-form input[type=url][disabled],.pure-form input[type=week][disabled],.pure-form select[disabled],.pure-form textarea[disabled]{cursor:not-allowed;background-color:#eaeded;color:#cad2d3}.pure-form input:not([type])[disabled]{cursor:not-allowed;background-color:#eaeded;color:#cad2d3}.pure-form input[readonly],.pure-form select[readonly],.pure-form textarea[readonly]{background-color:#eee;color:#777;border-color:#ccc}.pure-form input:focus:invalid,.pure-form select:focus:invalid,.pure-form textarea:focus:invalid{color:#b94a48;border-color:#e9322d}.pure-form input[type=checkbox]:focus:invalid:focus,.pure-form input[type=file]:focus:invalid:focus,.pure-form input[type=radio]:focus:invalid:focus{outline-color:#e9322d}.pure-form select{height:2.25em;border:1px solid #ccc;background-color:#fff}.pure-form select[multiple]{height:auto}.pure-form label{margin:.5em 0 .2em}.pure-form fieldset{margin:0;padding:.35em 0 .75em;border:0}.pure-form legend{display:block;width:100%;padding:.3em 0;margin-bottom:.3em;color:#333;border-bottom:1px solid #e5e5e5}.pure-form-stacked input[type=color],.pure-form-stacked input[type=date],.pure-form-stacked input[type=datetime-local],.pure-form-stacked input[type=datetime],.pure-form-stacked input[type=email],.pure-form-stacked input[type=file],.pure-form-stacked input[type=month],.pure-form-stacked input[type=number],.pure-form-stacked input[type=password],.pure-form-stacked input[type=search],.pure-form-stacked input[type=tel],.pure-form-stacked input[type=text],.pure-form-stacked input[type=time],.pure-form-stacked input[type=url],.pure-form-stacked input[type=week],.pure-form-stacked label,.pure-form-stacked select,.pure-form-stacked textarea{display:block;margin:.25em 0}.pure-form-stacked input:not([type]){display:block;margin:.25em 0}.pure-form-aligned input,.pure-form-aligned select,.pure-form-aligned textarea,.pure-form-message-inline{display:inline-block;vertical-align:middle}.pure-form-aligned textarea{vertical-align:top}.pure-form-aligned .pure-control-group{margin-bottom:.5em}.pure-form-aligned .pure-control-group label{text-align:right;display:inline-block;vertical-align:middle;width:10em;margin:0 1em 0 0}.pure-form-aligned .pure-controls{margin:1.5em 0 0 11em}.pure-form .pure-input-rounded,.pure-form input.pure-input-rounded{border-radius:2em;padding:.5em 1em}.pure-form .pure-group fieldset{margin-bottom:10px}.pure-form .pure-group input,.pure-form .pure-group textarea{display:block;padding:10px;margin:0 0 -1px;border-radius:0;position:relative;top:-1px}.pure-form .pure-group input:focus,.pure-form .pure-group textarea:focus{z-index:3}.pure-form .pure-group input:first-child,.pure-form .pure-group textarea:first-child{top:1px;border-radius:4px 4px 0 0;margin:0}.pure-form .pure-group input:first-child:last-child,.pure-form .pure-group textarea:first-child:last-child{top:1px;border-radius:4px;margin:0}.pure-form .pure-group input:last-child,.pure-form .pure-group textarea:last-child{top:-2px;border-radius:0 0 4px 4px;margin:0}.pure-form .pure-group button{margin:.35em 0}.pure-form .pure-input-1{width:100%}.pure-form .pure-input-3-4{width:75%}.pure-form .pure-input-2-3{width:66%}.pure-form .pure-input-1-2{width:50%}.pure-form .pure-input-1-3{width:33%}.pure-form .pure-input-1-4{width:25%}.pure-form-message-inline{display:inline-block;padding-left:.3em;color:#666;vertical-align:middle;font-size:.875em}.pure-form-message{display:block;color:#666;font-size:.875em}@media only screen and (max-width :480px){.pure-form button[type=submit]{margin:.7em 0 0}.pure-form input:not([type]),.pure-form input[type=color],.pure-form input[type=date],.pure-form input[type=datetime-local],.pure-form input[type=datetime],.pure-form input[type=email],.pure-form input[type=month],.pure-form input[type=number],.pure-form input[type=password],.pure-form input[type=search],.pure-form input[type=tel],.pure-form input[type=text],.pure-form input[type=time],.pure-form input[type=url],.pure-form input[type=week],.pure-form label{margin-bottom:.3em;display:block}.pure-group input:not([type]),.pure-group input[type=color],.pure-group input[type=date],.pure-group input[type=datetime-local],.pure-group input[type=datetime],.pure-group input[type=email],.pure-group input[type=month],.pure-group input[type=number],.pure-group input[type=password],.pure-group input[type=search],.pure-group input[type=tel],.pure-group input[type=text],.pure-group input[type=time],.pure-group input[type=url],.pure-group input[type=week]{margin-bottom:0}.pure-form-aligned .pure-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.pure-form-aligned .pure-controls{margin:1.5em 0 0 0}.pure-form-message,.pure-form-message-inline{display:block;font-size:.75em;padding:.2em 0 .8em}}.pure-menu{-webkit-box-sizing:border-box;box-sizing:border-box}.pure-menu-fixed{position:fixed;left:0;top:0;z-index:3}.pure-menu-item,.pure-menu-list{position:relative}.pure-menu-list{list-style:none;margin:0;padding:0}.pure-menu-item{padding:0;margin:0;height:100%}.pure-menu-heading,.pure-menu-link{display:block;text-decoration:none;white-space:nowrap}.pure-menu-horizontal{width:100%;white-space:nowrap}.pure-menu-horizontal .pure-menu-list{display:inline-block}.pure-menu-horizontal .pure-menu-heading,.pure-menu-horizontal .pure-menu-item,.pure-menu-horizontal .pure-menu-separator{display:inline-block;vertical-align:middle}.pure-menu-item .pure-menu-item{display:block}.pure-menu-children{display:none;position:absolute;left:100%;top:0;margin:0;padding:0;z-index:3}.pure-menu-horizontal .pure-menu-children{left:0;top:auto;width:inherit}.pure-menu-active>.pure-menu-children,.pure-menu-allow-hover:hover>.pure-menu-children{display:block;position:absolute}.pure-menu-has-children>.pure-menu-link:after{padding-left:.5em;content:"\25B8";font-size:small}.pure-menu-horizontal .pure-menu-has-children>.pure-menu-link:after{content:"\25BE"}.pure-menu-scrollable{overflow-y:scroll;overflow-x:hidden}.pure-menu-scrollable .pure-menu-list{display:block}.pure-menu-horizontal.pure-menu-scrollable .pure-menu-list{display:inline-block}.pure-menu-horizontal.pure-menu-scrollable{white-space:nowrap;overflow-y:hidden;overflow-x:auto;padding:.5em 0}.pure-menu-horizontal .pure-menu-children .pure-menu-separator,.pure-menu-separator{background-color:#ccc;height:1px;margin:.3em 0}.pure-menu-horizontal .pure-menu-separator{width:1px;height:1.3em;margin:0 .3em}.pure-menu-horizontal .pure-menu-children .pure-menu-separator{display:block;width:auto}.pure-menu-heading{text-transform:uppercase;color:#565d64}.pure-menu-link{color:#777}.pure-menu-children{background-color:#fff}.pure-menu-heading,.pure-menu-link{padding:.5em 1em}.pure-menu-disabled{opacity:.5}.pure-menu-disabled .pure-menu-link:hover{background-color:transparent;cursor:default}.pure-menu-active>.pure-menu-link,.pure-menu-link:focus,.pure-menu-link:hover{background-color:#eee}.pure-menu-selected>.pure-menu-link,.pure-menu-selected>.pure-menu-link:visited{color:#000}.pure-table{border-collapse:collapse;border-spacing:0;empty-cells:show;border:1px solid #cbcbcb}.pure-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.pure-table td,.pure-table th{border-left:1px solid #cbcbcb;border-width:0 0 0 1px;font-size:inherit;margin:0;overflow:visible;padding:.5em 1em}.pure-table thead{background-color:#e0e0e0;color:#000;text-align:left;vertical-align:bottom}.pure-table td{background-color:transparent}.pure-table-odd td{background-color:#f2f2f2}.pure-table-striped tr:nth-child(2n-1) td{background-color:#f2f2f2}.pure-table-bordered td{border-bottom:1px solid #cbcbcb}.pure-table-bordered tbody>tr:last-child>td{border-bottom-width:0}.pure-table-horizontal td,.pure-table-horizontal th{border-width:0 0 1px 0;border-bottom:1px solid #cbcbcb}.pure-table-horizontal tbody>tr:last-child>td{border-bottom-width:0} \ No newline at end of file diff --git a/index.html b/index.html index 2d022b4..1914acd 100755 --- a/index.html +++ b/index.html @@ -8,6 +8,7 @@ content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" /> 年会抽奖小程序 + @@ -24,8 +25,9 @@
- + + diff --git a/js/index.js b/js/index.js index 4ffb459..8e46fa5 100644 --- a/js/index.js +++ b/js/index.js @@ -141,8 +141,6 @@ function hideWinnerRecords() { } function lottery(number) { - let list = document.getElementById('memberCanvas').getElementsByTagName('a'); - let color = 'yellow'; let notSelectedMembers = allMembers.filter(member => !isWinner(member)); let newWinners = getRandomMembers(notSelectedMembers, number); From 857cf02b2c9078d163d60ca891e2d8fdbe325fc0 Mon Sep 17 00:00:00 2001 From: huangjue Date: Tue, 4 Jan 2022 17:20:24 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/main.css | 16 ++++++++++------ css/pure.css | 11 ----------- index.html | 2 +- js/index.js | 11 ++++++++--- 4 files changed, 19 insertions(+), 21 deletions(-) delete mode 100644 css/pure.css diff --git a/css/main.css b/css/main.css index af8a40c..ab7bfe1 100644 --- a/css/main.css +++ b/css/main.css @@ -226,6 +226,10 @@ input[type='submit'] { color: #ff0; } +.anouncement { + color: #fff; +} + input { outline-style: none; border: 1px solid #ccc; @@ -236,9 +240,9 @@ input { font-weight: 700; } -input:focus{ - border-color: #66afe9; - outline: 0; - -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6); - box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6) -} \ No newline at end of file +input:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); +} diff --git a/css/pure.css b/css/pure.css deleted file mode 100644 index 5b2aaf8..0000000 --- a/css/pure.css +++ /dev/null @@ -1,11 +0,0 @@ -/*! -Pure v2.0.6 -Copyright 2013 Yahoo! -Licensed under the BSD License. -https://github.com/pure-css/pure/blob/master/LICENSE -*/ -/*! -normalize.css v | MIT License | git.io/normalize -Copyright (c) Nicolas Gallagher and Jonathan Neal -*/ -/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html{font-family:sans-serif}.hidden,[hidden]{display:none!important}.pure-img{max-width:100%;height:auto;display:block}.pure-g{letter-spacing:-.31em;text-rendering:optimizespeed;font-family:FreeSans,Arimo,"Droid Sans",Helvetica,Arial,sans-serif;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-line-pack:start;align-content:flex-start}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){table .pure-g{display:block}}.opera-only :-o-prefocus,.pure-g{word-spacing:-0.43em}.pure-u{display:inline-block;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-g [class*=pure-u]{font-family:sans-serif}.pure-u-1,.pure-u-1-1,.pure-u-1-12,.pure-u-1-2,.pure-u-1-24,.pure-u-1-3,.pure-u-1-4,.pure-u-1-5,.pure-u-1-6,.pure-u-1-8,.pure-u-10-24,.pure-u-11-12,.pure-u-11-24,.pure-u-12-24,.pure-u-13-24,.pure-u-14-24,.pure-u-15-24,.pure-u-16-24,.pure-u-17-24,.pure-u-18-24,.pure-u-19-24,.pure-u-2-24,.pure-u-2-3,.pure-u-2-5,.pure-u-20-24,.pure-u-21-24,.pure-u-22-24,.pure-u-23-24,.pure-u-24-24,.pure-u-3-24,.pure-u-3-4,.pure-u-3-5,.pure-u-3-8,.pure-u-4-24,.pure-u-4-5,.pure-u-5-12,.pure-u-5-24,.pure-u-5-5,.pure-u-5-6,.pure-u-5-8,.pure-u-6-24,.pure-u-7-12,.pure-u-7-24,.pure-u-7-8,.pure-u-8-24,.pure-u-9-24{display:inline-block;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-u-1-24{width:4.1667%}.pure-u-1-12,.pure-u-2-24{width:8.3333%}.pure-u-1-8,.pure-u-3-24{width:12.5%}.pure-u-1-6,.pure-u-4-24{width:16.6667%}.pure-u-1-5{width:20%}.pure-u-5-24{width:20.8333%}.pure-u-1-4,.pure-u-6-24{width:25%}.pure-u-7-24{width:29.1667%}.pure-u-1-3,.pure-u-8-24{width:33.3333%}.pure-u-3-8,.pure-u-9-24{width:37.5%}.pure-u-2-5{width:40%}.pure-u-10-24,.pure-u-5-12{width:41.6667%}.pure-u-11-24{width:45.8333%}.pure-u-1-2,.pure-u-12-24{width:50%}.pure-u-13-24{width:54.1667%}.pure-u-14-24,.pure-u-7-12{width:58.3333%}.pure-u-3-5{width:60%}.pure-u-15-24,.pure-u-5-8{width:62.5%}.pure-u-16-24,.pure-u-2-3{width:66.6667%}.pure-u-17-24{width:70.8333%}.pure-u-18-24,.pure-u-3-4{width:75%}.pure-u-19-24{width:79.1667%}.pure-u-4-5{width:80%}.pure-u-20-24,.pure-u-5-6{width:83.3333%}.pure-u-21-24,.pure-u-7-8{width:87.5%}.pure-u-11-12,.pure-u-22-24{width:91.6667%}.pure-u-23-24{width:95.8333%}.pure-u-1,.pure-u-1-1,.pure-u-24-24,.pure-u-5-5{width:100%}.pure-button{display:inline-block;line-height:normal;white-space:nowrap;vertical-align:middle;text-align:center;cursor:pointer;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:border-box;box-sizing:border-box}.pure-button::-moz-focus-inner{padding:0;border:0}.pure-button-group{letter-spacing:-.31em;text-rendering:optimizespeed}.opera-only :-o-prefocus,.pure-button-group{word-spacing:-0.43em}.pure-button-group .pure-button{letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-button{font-family:inherit;font-size:100%;padding:.5em 1em;color:rgba(0,0,0,.8);border:none transparent;background-color:#e6e6e6;text-decoration:none;border-radius:2px}.pure-button-hover,.pure-button:focus,.pure-button:hover{background-image:-webkit-gradient(linear,left top,left bottom,from(transparent),color-stop(40%,rgba(0,0,0,.05)),to(rgba(0,0,0,.1)));background-image:linear-gradient(transparent,rgba(0,0,0,.05) 40%,rgba(0,0,0,.1))}.pure-button:focus{outline:0}.pure-button-active,.pure-button:active{-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.15) inset,0 0 6px rgba(0,0,0,.2) inset;box-shadow:0 0 0 1px rgba(0,0,0,.15) inset,0 0 6px rgba(0,0,0,.2) inset;border-color:#000}.pure-button-disabled,.pure-button-disabled:active,.pure-button-disabled:focus,.pure-button-disabled:hover,.pure-button[disabled]{border:none;background-image:none;opacity:.4;cursor:not-allowed;-webkit-box-shadow:none;box-shadow:none;pointer-events:none}.pure-button-hidden{display:none}.pure-button-primary,.pure-button-selected,a.pure-button-primary,a.pure-button-selected{background-color:#0078e7;color:#fff}.pure-button-group .pure-button{margin:0;border-radius:0;border-right:1px solid rgba(0,0,0,.2)}.pure-button-group .pure-button:first-child{border-top-left-radius:2px;border-bottom-left-radius:2px}.pure-button-group .pure-button:last-child{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right:none}.pure-form input[type=color],.pure-form input[type=date],.pure-form input[type=datetime-local],.pure-form input[type=datetime],.pure-form input[type=email],.pure-form input[type=month],.pure-form input[type=number],.pure-form input[type=password],.pure-form input[type=search],.pure-form input[type=tel],.pure-form input[type=text],.pure-form input[type=time],.pure-form input[type=url],.pure-form input[type=week],.pure-form select,.pure-form textarea{padding:.5em .6em;display:inline-block;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 3px #ddd;box-shadow:inset 0 1px 3px #ddd;border-radius:4px;vertical-align:middle;-webkit-box-sizing:border-box;box-sizing:border-box}.pure-form input:not([type]){padding:.5em .6em;display:inline-block;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 3px #ddd;box-shadow:inset 0 1px 3px #ddd;border-radius:4px;-webkit-box-sizing:border-box;box-sizing:border-box}.pure-form input[type=color]{padding:.2em .5em}.pure-form input[type=color]:focus,.pure-form input[type=date]:focus,.pure-form input[type=datetime-local]:focus,.pure-form input[type=datetime]:focus,.pure-form input[type=email]:focus,.pure-form input[type=month]:focus,.pure-form input[type=number]:focus,.pure-form input[type=password]:focus,.pure-form input[type=search]:focus,.pure-form input[type=tel]:focus,.pure-form input[type=text]:focus,.pure-form input[type=time]:focus,.pure-form input[type=url]:focus,.pure-form input[type=week]:focus,.pure-form select:focus,.pure-form textarea:focus{outline:0;border-color:#129fea}.pure-form input:not([type]):focus{outline:0;border-color:#129fea}.pure-form input[type=checkbox]:focus,.pure-form input[type=file]:focus,.pure-form input[type=radio]:focus{outline:thin solid #129FEA;outline:1px auto #129FEA}.pure-form .pure-checkbox,.pure-form .pure-radio{margin:.5em 0;display:block}.pure-form input[type=color][disabled],.pure-form input[type=date][disabled],.pure-form input[type=datetime-local][disabled],.pure-form input[type=datetime][disabled],.pure-form input[type=email][disabled],.pure-form input[type=month][disabled],.pure-form input[type=number][disabled],.pure-form input[type=password][disabled],.pure-form input[type=search][disabled],.pure-form input[type=tel][disabled],.pure-form input[type=text][disabled],.pure-form input[type=time][disabled],.pure-form input[type=url][disabled],.pure-form input[type=week][disabled],.pure-form select[disabled],.pure-form textarea[disabled]{cursor:not-allowed;background-color:#eaeded;color:#cad2d3}.pure-form input:not([type])[disabled]{cursor:not-allowed;background-color:#eaeded;color:#cad2d3}.pure-form input[readonly],.pure-form select[readonly],.pure-form textarea[readonly]{background-color:#eee;color:#777;border-color:#ccc}.pure-form input:focus:invalid,.pure-form select:focus:invalid,.pure-form textarea:focus:invalid{color:#b94a48;border-color:#e9322d}.pure-form input[type=checkbox]:focus:invalid:focus,.pure-form input[type=file]:focus:invalid:focus,.pure-form input[type=radio]:focus:invalid:focus{outline-color:#e9322d}.pure-form select{height:2.25em;border:1px solid #ccc;background-color:#fff}.pure-form select[multiple]{height:auto}.pure-form label{margin:.5em 0 .2em}.pure-form fieldset{margin:0;padding:.35em 0 .75em;border:0}.pure-form legend{display:block;width:100%;padding:.3em 0;margin-bottom:.3em;color:#333;border-bottom:1px solid #e5e5e5}.pure-form-stacked input[type=color],.pure-form-stacked input[type=date],.pure-form-stacked input[type=datetime-local],.pure-form-stacked input[type=datetime],.pure-form-stacked input[type=email],.pure-form-stacked input[type=file],.pure-form-stacked input[type=month],.pure-form-stacked input[type=number],.pure-form-stacked input[type=password],.pure-form-stacked input[type=search],.pure-form-stacked input[type=tel],.pure-form-stacked input[type=text],.pure-form-stacked input[type=time],.pure-form-stacked input[type=url],.pure-form-stacked input[type=week],.pure-form-stacked label,.pure-form-stacked select,.pure-form-stacked textarea{display:block;margin:.25em 0}.pure-form-stacked input:not([type]){display:block;margin:.25em 0}.pure-form-aligned input,.pure-form-aligned select,.pure-form-aligned textarea,.pure-form-message-inline{display:inline-block;vertical-align:middle}.pure-form-aligned textarea{vertical-align:top}.pure-form-aligned .pure-control-group{margin-bottom:.5em}.pure-form-aligned .pure-control-group label{text-align:right;display:inline-block;vertical-align:middle;width:10em;margin:0 1em 0 0}.pure-form-aligned .pure-controls{margin:1.5em 0 0 11em}.pure-form .pure-input-rounded,.pure-form input.pure-input-rounded{border-radius:2em;padding:.5em 1em}.pure-form .pure-group fieldset{margin-bottom:10px}.pure-form .pure-group input,.pure-form .pure-group textarea{display:block;padding:10px;margin:0 0 -1px;border-radius:0;position:relative;top:-1px}.pure-form .pure-group input:focus,.pure-form .pure-group textarea:focus{z-index:3}.pure-form .pure-group input:first-child,.pure-form .pure-group textarea:first-child{top:1px;border-radius:4px 4px 0 0;margin:0}.pure-form .pure-group input:first-child:last-child,.pure-form .pure-group textarea:first-child:last-child{top:1px;border-radius:4px;margin:0}.pure-form .pure-group input:last-child,.pure-form .pure-group textarea:last-child{top:-2px;border-radius:0 0 4px 4px;margin:0}.pure-form .pure-group button{margin:.35em 0}.pure-form .pure-input-1{width:100%}.pure-form .pure-input-3-4{width:75%}.pure-form .pure-input-2-3{width:66%}.pure-form .pure-input-1-2{width:50%}.pure-form .pure-input-1-3{width:33%}.pure-form .pure-input-1-4{width:25%}.pure-form-message-inline{display:inline-block;padding-left:.3em;color:#666;vertical-align:middle;font-size:.875em}.pure-form-message{display:block;color:#666;font-size:.875em}@media only screen and (max-width :480px){.pure-form button[type=submit]{margin:.7em 0 0}.pure-form input:not([type]),.pure-form input[type=color],.pure-form input[type=date],.pure-form input[type=datetime-local],.pure-form input[type=datetime],.pure-form input[type=email],.pure-form input[type=month],.pure-form input[type=number],.pure-form input[type=password],.pure-form input[type=search],.pure-form input[type=tel],.pure-form input[type=text],.pure-form input[type=time],.pure-form input[type=url],.pure-form input[type=week],.pure-form label{margin-bottom:.3em;display:block}.pure-group input:not([type]),.pure-group input[type=color],.pure-group input[type=date],.pure-group input[type=datetime-local],.pure-group input[type=datetime],.pure-group input[type=email],.pure-group input[type=month],.pure-group input[type=number],.pure-group input[type=password],.pure-group input[type=search],.pure-group input[type=tel],.pure-group input[type=text],.pure-group input[type=time],.pure-group input[type=url],.pure-group input[type=week]{margin-bottom:0}.pure-form-aligned .pure-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.pure-form-aligned .pure-controls{margin:1.5em 0 0 0}.pure-form-message,.pure-form-message-inline{display:block;font-size:.75em;padding:.2em 0 .8em}}.pure-menu{-webkit-box-sizing:border-box;box-sizing:border-box}.pure-menu-fixed{position:fixed;left:0;top:0;z-index:3}.pure-menu-item,.pure-menu-list{position:relative}.pure-menu-list{list-style:none;margin:0;padding:0}.pure-menu-item{padding:0;margin:0;height:100%}.pure-menu-heading,.pure-menu-link{display:block;text-decoration:none;white-space:nowrap}.pure-menu-horizontal{width:100%;white-space:nowrap}.pure-menu-horizontal .pure-menu-list{display:inline-block}.pure-menu-horizontal .pure-menu-heading,.pure-menu-horizontal .pure-menu-item,.pure-menu-horizontal .pure-menu-separator{display:inline-block;vertical-align:middle}.pure-menu-item .pure-menu-item{display:block}.pure-menu-children{display:none;position:absolute;left:100%;top:0;margin:0;padding:0;z-index:3}.pure-menu-horizontal .pure-menu-children{left:0;top:auto;width:inherit}.pure-menu-active>.pure-menu-children,.pure-menu-allow-hover:hover>.pure-menu-children{display:block;position:absolute}.pure-menu-has-children>.pure-menu-link:after{padding-left:.5em;content:"\25B8";font-size:small}.pure-menu-horizontal .pure-menu-has-children>.pure-menu-link:after{content:"\25BE"}.pure-menu-scrollable{overflow-y:scroll;overflow-x:hidden}.pure-menu-scrollable .pure-menu-list{display:block}.pure-menu-horizontal.pure-menu-scrollable .pure-menu-list{display:inline-block}.pure-menu-horizontal.pure-menu-scrollable{white-space:nowrap;overflow-y:hidden;overflow-x:auto;padding:.5em 0}.pure-menu-horizontal .pure-menu-children .pure-menu-separator,.pure-menu-separator{background-color:#ccc;height:1px;margin:.3em 0}.pure-menu-horizontal .pure-menu-separator{width:1px;height:1.3em;margin:0 .3em}.pure-menu-horizontal .pure-menu-children .pure-menu-separator{display:block;width:auto}.pure-menu-heading{text-transform:uppercase;color:#565d64}.pure-menu-link{color:#777}.pure-menu-children{background-color:#fff}.pure-menu-heading,.pure-menu-link{padding:.5em 1em}.pure-menu-disabled{opacity:.5}.pure-menu-disabled .pure-menu-link:hover{background-color:transparent;cursor:default}.pure-menu-active>.pure-menu-link,.pure-menu-link:focus,.pure-menu-link:hover{background-color:#eee}.pure-menu-selected>.pure-menu-link,.pure-menu-selected>.pure-menu-link:visited{color:#000}.pure-table{border-collapse:collapse;border-spacing:0;empty-cells:show;border:1px solid #cbcbcb}.pure-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.pure-table td,.pure-table th{border-left:1px solid #cbcbcb;border-width:0 0 0 1px;font-size:inherit;margin:0;overflow:visible;padding:.5em 1em}.pure-table thead{background-color:#e0e0e0;color:#000;text-align:left;vertical-align:bottom}.pure-table td{background-color:transparent}.pure-table-odd td{background-color:#f2f2f2}.pure-table-striped tr:nth-child(2n-1) td{background-color:#f2f2f2}.pure-table-bordered td{border-bottom:1px solid #cbcbcb}.pure-table-bordered tbody>tr:last-child>td{border-bottom-width:0}.pure-table-horizontal td,.pure-table-horizontal th{border-width:0 0 1px 0;border-bottom:1px solid #cbcbcb}.pure-table-horizontal tbody>tr:last-child>td{border-bottom-width:0} \ No newline at end of file diff --git a/index.html b/index.html index 1914acd..2b05c93 100755 --- a/index.html +++ b/index.html @@ -8,7 +8,6 @@ content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" /> 年会抽奖小程序 - @@ -16,6 +15,7 @@
+ 美团黄Java技术支持
diff --git a/js/index.js b/js/index.js index 8e46fa5..8bbae18 100644 --- a/js/index.js +++ b/js/index.js @@ -1,7 +1,7 @@ const KEY = '_lottery_winner'; const RECORD_KEY = '_lottery_winner_record'; -const winnerMap = new Map(); -const winRecords = []; +let winnerMap = new Map(); +let winRecords = []; function loadStorage() { try { @@ -15,7 +15,9 @@ function loadStorage() { winnerMap.clear(); winRecords = []; } - } catch (e) {} + } catch (e) { + console.error('读取数据异常', e); + } } function clearStorage() { @@ -180,6 +182,9 @@ function initVue() { }, loadStorageInfo() { + // if(confirm('是否需要读取之前的缓存记录?')) { + + // } loadStorage(); updateCanvasInnerHTML(); reloadTagCanvas();