/** * jquery.imgpreload 1.6.2 * copyright 2009-2014 dimas begunoff * license mit */ "undefined"!=typeof jquery&&!function(a){"use strict";a.imgpreload=function(b,c){c=a.extend({},a.fn.imgpreload.defaults,c instanceof function?{all:c}:c),"string"==typeof b&&(b=[b]);var d=[];a.each(b,function(e,f){var g=new image,h=f,i=g;"string"!=typeof f&&(h=a(f).attr("src")||a(f).css("background-image").replace(/^url\((?:"|')?(.*)(?:'|")?\)$/gm,"$1"),i=f),a(g).bind("load error",function(e){d.push(i),a.data(i,"loaded","error"==e.type?!1:!0),c.each instanceof function&&c.each.call(i,d.slice(0)),d.length>=b.length&&c.all instanceof function&&c.all.call(d),a(this).unbind("load error")}),g.src=h})},a.fn.imgpreload=function(b){return a.imgpreload(this,b),this},a.fn.imgpreload.defaults={each:null,all:null}}(jquery); //分享 !function(r){"use strict";function t(t,e,n,o){function i(r,t){return r-=o,t-=o,!(0>r||r>=u||0>t||t>=u)&&a.isdark(r,t)}var a=r(n,e);a.adddata(t),a.make(),o=o||0;var u=a.getmodulecount(),f=a.getmodulecount()+2*o,c=function(r,t,e,n){var o=this.isdark,i=1/f;this.isdark=function(a,u){var f=u*i,c=a*i,s=f+i,l=c+i;return o(a,u)&&(r>s||f>e||t>l||c>n)}};this.text=t,this.level=e,this.version=n,this.modulecount=f,this.isdark=i,this.addblank=c}function e(r,e,n,o,i){n=math.max(1,n||1),o=math.min(40,o||40);for(var a=n;o>=a;a+=1)try{return new t(r,e,a,i)}catch(r){}}function n(r,t,e){var n=e.size,o="bold "+e.msize*n+"px "+e.fontname,i=p("")[0].getcontext("2d");i.font=o;var a=i.measuretext(e.label).width,u=e.msize,f=a/n,c=(1-f)*e.mposx,s=(1-u)*e.mposy,l=c+f,h=s+u,d=.01;1===e.mode?r.addblank(0,s-d,n,h+d):r.addblank(c-d,s-d,l+d,h+d),t.fillstyle=e.fontcolor,t.font=o,t.filltext(e.label,c*n,s*n+.75*e.msize*n)}function o(r,t,e){var n=e.size,o=e.image.naturalwidth||1,i=e.image.naturalheight||1,a=e.msize,u=a*o/i,f=(1-u)*e.mposx,c=(1-a)*e.mposy,s=f+u,l=c+a,h=.01;3===e.mode?r.addblank(0,c-h,n,l+h):r.addblank(f-h,c-h,s+h,l+h),t.drawimage(e.image,f*n,c*n,u*n,a*n)}function i(r,t,e){p(e.background).is("img")?t.drawimage(e.background,0,0,e.size,e.size):e.background&&(t.fillstyle=e.background,t.fillrect(e.left,e.top,e.size,e.size));var i=e.mode;1===i||2===i?n(r,t,e):(3===i||4===i)&&o(r,t,e)}function a(r,t,e,n,o,i,a,u){r.isdark(a,u)&&t.rect(n,o,i,i)}function u(r,t,e,n,o,i,a,u,f,c){a?r.moveto(t+i,e):r.moveto(t,e),u?(r.lineto(n-i,e),r.arcto(n,e,n,o,i)):r.lineto(n,e),f?(r.lineto(n,o-i),r.arcto(n,o,t,o,i)):r.lineto(n,o),c?(r.lineto(t+i,o),r.arcto(t,o,t,e,i)):r.lineto(t,o),a?(r.lineto(t,e+i),r.arcto(t,e,n,e,i)):r.lineto(t,e)}function f(r,t,e,n,o,i,a,u,f,c){a&&(r.moveto(t+i,e),r.lineto(t,e),r.lineto(t,e+i),r.arcto(t,e,t+i,e,i)),u&&(r.moveto(n-i,e),r.lineto(n,e),r.lineto(n,e+i),r.arcto(n,e,n-i,e,i)),f&&(r.moveto(n-i,o),r.lineto(n,o),r.lineto(n,o-i),r.arcto(n,o,n-i,o,i)),c&&(r.moveto(t+i,o),r.lineto(t,o),r.lineto(t,o-i),r.arcto(t,o,t+i,o,i))}function c(r,t,e,n,o,i,a,c){var s=r.isdark,l=n+i,h=o+i,d=e.radius*i,g=a-1,v=a+1,p=c-1,w=c+1,m=s(a,c),t=s(g,p),y=s(g,c),e=s(g,w),a=s(a,w),b=s(v,w),k=s(v,c),b=s(v,p),c=s(a,p);m?u(t,n,o,l,h,d,!y&&!c,!y&&!a,!k&&!a,!k&&!c):f(t,n,o,l,h,d,y&&c&&t,y&&a&&e,k&&a&&b,k&&c&&b)}function s(r,t,e){var n,o,i=r.modulecount,u=e.size/i,f=a;for(m&&e.radius>0&&e.radius<=.5&&(f=c),t.beginpath(),n=0;i>n;n+=1)for(o=0;i>o;o+=1){var s=e.left+o*u,l=e.top+n*u,h=u;f(r,t,e,s,l,h,n,o)}if(p(e.fill).is("img")){t.strokestyle="rgba(0,0,0,0.5)",t.linewidth=2,t.stroke();var d=t.globalcompositeoperation;t.globalcompositeoperation="destination-out",t.fill(),t.globalcompositeoperation=d,t.clip(),t.drawimage(e.fill,0,0,e.size,e.size),t.restore()}else t.fillstyle=e.fill,t.fill()}function l(r,t){var n=e(t.text,t.eclevel,t.minversion,t.maxversion,t.quiet);if(!n)return null;var o=p(r).data("qrcode",n),a=o[0].getcontext("2d");return i(n,a,t),s(n,a,t),o}function h(r){var t=p("").attr("width",r.size).attr("height",r.size);return l(t,r)}function d(r){return p("").attr("src",h(r)[0].todataurl("image/png"))}function g(r){var t=e(r.text,r.eclevel,r.minversion,r.maxversion,r.quiet);if(!t)return null;var n,o,i=r.size,a=r.background,u=math.floor,f=t.modulecount,c=u(i/f),s=u(.5*(i-c*f)),l={position:"relative",left:0,top:0,padding:0,margin:0,width:i,height:i},h={position:"absolute",padding:0,margin:0,width:c,height:c,"background-color":r.fill},d=p("
").data("qrcode",t).css(l);for(a&&d.css("background-color",a),n=0;f>n;n+=1)for(o=0;f>o;o+=1)t.isdark(n,o)&&p("
").css(h).css({left:s+o*c,top:s+n*c}).appendto(d);return d}function v(r){return w&&"canvas"===r.render?h(r):w&&"image"===r.render?d(r):g(r)}var p=jquery,w=function(){var r=document.createelement("canvas");return boolean(r.getcontext&&r.getcontext("2d"))}(),m="[object opera]"!==object.prototype.tostring.call(window.opera),t={render:"canvas",minversion:1,maxversion:40,eclevel:"l",left:0,top:0,size:200,fill:"#000",background:null,text:"no text",radius:0,quiet:0,mode:0,msize:.1,mposx:.5,mposy:.5,label:"no label",fontname:"sans",fontcolor:"#000",image:null};p.fn.qrcode=function(r){var t=p.extend({},t,r);return this.each(function(){"canvas"===this.nodename.tolowercase()?l(this,t):p(this).append(v(t))})}}(function(){var r=function(){function r(t,e){if("undefined"==typeof t.length)throw new error(t.length+"/"+e);var n=function(){for(var r=0;re;e+=1){t[e]=new array(r);for(var n=0;r>n;n+=1)t[e][n]=null}return t}(d),t(0,0),t(d-7,0),t(0,d-7),a(),e(),k(r,t),s>=7&&b(r),null==v&&(v=m(s,l,p)),b(v,t)},t=function(r,t){for(var e=-1;7>=e;e+=1)if(!(-1>=r+e||r+e>=d))for(var n=-1;7>=n;n+=1)-1>=t+n||t+n>=d||(e>=0&&6>=e&&(0==n||6==n)||n>=0&&6>=n&&(0==e||6==e)||e>=2&&4>=e&&n>=2&&4>=n?h[r+e][t+n]=!0:h[r+e][t+n]=!1)},y=function(){for(var r=0,t=0,e=0;8>e;e+=1){m(!0,e);var n=i.getlostpoint(w);(0==e||r>n)&&(r=n,t=e)}return t},e=function(){for(var r=8;d-8>r;r+=1)null==h[r][6]&&(h[r][6]=r%2==0);for(var t=8;d-8>t;t+=1)null==h[6][t]&&(h[6][t]=t%2==0)},a=function(){for(var r=i.getpatternposition(s),t=0;t=a;a+=1)for(var u=-2;2>=u;u+=1)-2==a||2==a||-2==u||2==u||0==a&&0==u?h[n+a][o+u]=!0:h[n+a][o+u]=!1}},b=function(r){for(var t=i.getbchtypenumber(s),e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);h[math.floor(e/3)][e%3+d-8-3]=n}for(var e=0;18>e;e+=1){var n=!r&&1==(t>>e&1);h[e%3+d-8-3][math.floor(e/3)]=n}},k=function(r,t){for(var e=l<<3|t,n=i.getbchtypeinfo(e),o=0;15>o;o+=1){var a=!r&&1==(n>>o&1);6>o?h[o][8]=a:8>o?h[o+1][8]=a:h[d-15+o][8]=a}for(var o=0;15>o;o+=1){var a=!r&&1==(n>>o&1);8>o?h[8][d-o-1]=a:9>o?h[8][15-o-1+1]=a:h[8][15-o-1]=a}h[d-8][8]=!r},b=function(r,t){for(var e=-1,n=d-1,o=7,a=0,u=i.getmaskfunction(t),f=d-1;f>0;f-=2)for(6==f&&(f-=1);;){for(var c=0;2>c;c+=1)if(null==h[n][f-c]){var s=!1;a>>o&1));var l=u(n,f-c);l&&(s=!s),h[n][f-c]=s,o-=1,-1==o&&(a+=1,o=7)}if(n+=e,0>n||n>=d){n-=e,e=-e;break}}},c=function(t,e){for(var n=0,o=0,a=0,u=new array(e.length),f=new array(e.length),c=0;c=0?v.getat(p):0}}for(var w=0,h=0;hh;h+=1)for(var c=0;ch;h+=1)for(var c=0;c8*h)throw new error("code length overflow. ("+c.getlengthinbits()+">"+8*h+")");for(c.getlengthinbits()+4<=8*h&&c.put(0,4);c.getlengthinbits()%8!=0;)c.putbit(!1);for(;!(c.getlengthinbits()>=8*h)&&(c.put(o,8),!(c.getlengthinbits()>=8*h));)c.put(a,8);return c(c,n)};return w.adddata=function(r){var t=c(r);p.push(t),v=null},w.isdark=function(r,t){if(0>r||r>=d||0>t||t>=d)throw new error(r+","+t);return h[r][t]},w.getmodulecount=function(){return d},w.make=function(){m(!1,y())},w.createtabletag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e="";e+='";for(var o=0;o';e+=""}return e+="",e+="
"},w.createimgtag=function(r,t){r=r||2,t="undefined"==typeof t?4*r:t;var e=w.getmodulecount()*r+2*t,n=t,o=e-t;return g(e,e,function(t,e){if(t>=n&&o>t&&e>=n&&o>e){var i=math.floor((t-n)/r),a=math.floor((e-n)/r);return w.isdark(a,i)?0:1}return 1})},w};t.stringtobytes=function(r){for(var t=new array,e=0;ei)t.push(i);else{var a=e[r.charat(o)];"number"==typeof a?(255&a)==a?t.push(a):(t.push(a>>>8),t.push(255&a)):t.push(n)}}return t}};var e={mode_number:1,mode_alpha_num:2,mode_8bit_byte:4,mode_kanji:8},n={l:1,m:0,q:3,h:2},o={pattern000:0,pattern001:1,pattern010:2,pattern011:3,pattern100:4,pattern101:5,pattern110:6,pattern111:7},i=function(){var t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],n=1335,i=7973,u=21522,f={},c=function(r){for(var t=0;0!=r;)t+=1,r>>>=1;return t};return f.getbchtypeinfo=function(r){for(var t=r<<10;c(t)-c(n)>=0;)t^=n<=0;)t^=i<n;n+=1)e=e.multiply(r([1,a.gexp(n)],0));return e},f.getlengthinbits=function(r,t){if(t>=1&&10>t)switch(r){case e.mode_number:return 10;case e.mode_alpha_num:return 9;case e.mode_8bit_byte:return 8;case e.mode_kanji:return 8;default:throw new error("mode:"+r)}else if(27>t)switch(r){case e.mode_number:return 12;case e.mode_alpha_num:return 11;case e.mode_8bit_byte:return 16;case e.mode_kanji:return 10;default:throw new error("mode:"+r)}else{if(!(41>t))throw new error("type:"+t);switch(r){case e.mode_number:return 14;case e.mode_alpha_num:return 13;case e.mode_8bit_byte:return 16;case e.mode_kanji:return 12;default:throw new error("mode:"+r)}}},f.getlostpoint=function(r){for(var t=r.getmodulecount(),e=0,n=0;t>n;n+=1)for(var o=0;t>o;o+=1){for(var i=0,a=r.isdark(n,o),u=-1;1>=u;u+=1)if(!(0>n+u||n+u>=t))for(var f=-1;1>=f;f+=1)0>o+f||o+f>=t||(0!=u||0!=f)&&a==r.isdark(n+u,o+f)&&(i+=1);i>5&&(e+=3+i-5)}for(var n=0;t-1>n;n+=1)for(var o=0;t-1>o;o+=1){var c=0;r.isdark(n,o)&&(c+=1),r.isdark(n+1,o)&&(c+=1),r.isdark(n,o+1)&&(c+=1),r.isdark(n+1,o+1)&&(c+=1),(0==c||4==c)&&(e+=3)}for(var n=0;t>n;n+=1)for(var o=0;t-6>o;o+=1)r.isdark(n,o)&&!r.isdark(n,o+1)&&r.isdark(n,o+2)&&r.isdark(n,o+3)&&r.isdark(n,o+4)&&!r.isdark(n,o+5)&&r.isdark(n,o+6)&&(e+=40);for(var o=0;t>o;o+=1)for(var n=0;t-6>n;n+=1)r.isdark(n,o)&&!r.isdark(n+1,o)&&r.isdark(n+2,o)&&r.isdark(n+3,o)&&r.isdark(n+4,o)&&!r.isdark(n+5,o)&&r.isdark(n+6,o)&&(e+=40);for(var s=0,o=0;t>o;o+=1)for(var n=0;t>n;n+=1)r.isdark(n,o)&&(s+=1);var l=math.abs(100*s/t/t-50)/5;return e+=10*l},f}(),a=function(){for(var r=new array(256),t=new array(256),e=0;8>e;e+=1)r[e]=1<e;e+=1)r[e]=r[e-4]^r[e-5]^r[e-6]^r[e-8];for(var e=0;255>e;e+=1)t[r[e]]=e;var n={};return n.glog=function(r){if(1>r)throw new error("glog("+r+")");return t[r]},n.gexp=function(t){for(;0>t;)t+=255;for(;t>=256;)t-=255;return r[t]},n}(),u=function(){var r=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(r,t){var e={};return e.totalcount=r,e.datacount=t,e},e={},o=function(t,e){switch(e){case n.l:return r[4*(t-1)+0];case n.m:return r[4*(t-1)+1];case n.q:return r[4*(t-1)+2];case n.h:return r[4*(t-1)+3];default:return}};return e.getrsblocks=function(r,e){var n=o(r,e);if("undefined"==typeof n)throw new error("bad rs block @ typenumber:"+r+"/errorcorrectlevel:"+e);for(var i=n.length/3,a=new array,u=0;i>u;u+=1)for(var f=n[3*u+0],c=n[3*u+1],s=n[3*u+2],l=0;f>l;l+=1)a.push(t(c,s));return a},e}(),f=function(){var r=new array,t=0,e={};return e.getbuffer=function(){return r},e.getat=function(t){var e=math.floor(t/8);return 1==(r[e]>>>7-t%8&1)},e.put=function(r,t){for(var n=0;t>n;n+=1)e.putbit(1==(r>>>t-n-1&1))},e.getlengthinbits=function(){return t},e.putbit=function(e){var n=math.floor(t/8);r.length<=n&&r.push(0),e&&(r[n]|=128>>>t%8),t+=1},e},c=function(r){var n=e.mode_8bit_byte,o=t.stringtobytes(r),i={};return i.getmode=function(){return n},i.getlength=function(r){return o.length},i.write=function(r){for(var t=0;t>>8)},t.writebytes=function(r,e,n){e=e||0,n=n||r.length;for(var o=0;n>o;o+=1)t.writebyte(r[o+e])},t.writestring=function(r){for(var e=0;e0&&(t+=","),t+=r[e];return t+="]"},t},l=function(){var r=0,t=0,e=0,n="",o={},i=function(r){n+=string.fromcharcode(a(63&r))},a=function(r){if(0>r);else{if(26>r)return 65+r;if(52>r)return 97+(r-26);if(62>r)return 48+(r-52);if(62==r)return 43;if(63==r)return 47}throw new error("n:"+r)};return o.writebyte=function(n){for(r=r<<8|255&n,t+=8,e+=1;t>=6;)i(r>>>t-6),t-=6},o.flush=function(){if(t>0&&(i(r<<6-t),r=0,t=0),e%3!=0)for(var o=3-e%3,a=0;o>a;a+=1)n+="="},o.tostring=function(){return n},o},h=function(r){var t=r,e=0,n=0,o=0,i={};i.read=function(){for(;8>o;){if(e>=t.length){if(0==o)return-1;throw new error("unexpected end of file./"+o)}var r=t.charat(e);if(e+=1,"="==r)return o=0,-1;r.match(/^\s$/)||(n=n<<6|a(r.charcodeat(0)),o+=6)}var i=n>>>o-8&255;return o-=8,i};var a=function(r){if(r>=65&&90>=r)return r-65;if(r>=97&&122>=r)return r-97+26;if(r>=48&&57>=r)return r-48+52;if(43==r)return 62;if(47==r)return 63;throw new error("c:"+r)};return i},d=function(r,t){var e=r,n=t,o=new array(r*t),i={};i.setpixel=function(r,t,n){o[t*e+r]=n},i.write=function(r){r.writestring("gif87a"),r.writeshort(e),r.writeshort(n),r.writebyte(128),r.writebyte(0),r.writebyte(0),r.writebyte(0),r.writebyte(0),r.writebyte(0),r.writebyte(255),r.writebyte(255),r.writebyte(255),r.writestring(","),r.writeshort(0),r.writeshort(0),r.writeshort(e),r.writeshort(n),r.writebyte(0);var t=2,o=u(t);r.writebyte(t);for(var i=0;o.length-i>255;)r.writebyte(255),r.writebytes(o,i,255),i+=255;r.writebyte(o.length-i),r.writebytes(o,i,o.length-i),r.writebyte(0),r.writestring(";")};var a=function(r){var t=r,e=0,n=0,o={};return o.write=function(r,o){if(r>>>o!=0)throw new error("length over");for(;e+o>=8;)t.writebyte(255&(r<>>=8-e,n=0,e=0;n|=r<0&&t.writebyte(n)},o},u=function(r){for(var t=1<u;u+=1)i.add(string.fromcharcode(u));i.add(string.fromcharcode(t)),i.add(string.fromcharcode(e));var c=s(),l=a(c);l.write(t,n);var h=0,d=string.fromcharcode(o[h]);for(h+=1;hi;i+=1)for(var a=0;r>a;a+=1)o.setpixel(a,i,e(a,i));var u=s();o.write(u);for(var f=l(),c=u.tobytearray(),h=0;hn?t.push(n):2048>n?t.push(192|n>>6,128|63&n):55296>n||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(e++,n=65536+((1023&n)<<10|1023&r.charcodeat(e)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}return t(r)}}(r),r}()),function(r){r.fn.share=function(t){function e(t,e){var n=o(e);"prepend"==e.mode?n.reverse():n,n.length&&r.each(n,function(n,o){var a=i(o,e),u=e.initialized?t.find(".icon-"+o):r('');return!u.length||(u.prop("aria-label","分享到 "+h[o]),u.prop("href",a),"wechat"===o?u.prop("tabindex",-1):u.prop("target","_blank"),void(e.initialized||("prepend"==e.mode?t.prepend(u):t.append(u))))})}function n(r,t){var e=r.find("a.icon-wechat");e.length&&(e.append('

'+t.wechatqrcodetitle+'

'+t.wechatqrcodehelper+"
"),e.find(".qrcode").qrcode({render:"image",size:t.wechatqrcodesize,text:t.url}),e.offset().top<100&&e.find(".wechat-qrcode").addclass("bottom"))}function o(t){0===t.mobilesites.length&&t.sites.length&&(t.mobilesites=t.sites);var e=(u()?t.mobilesites:t.sites.length?t.sites:[]).slice(0),n=t.disabled;return"string"==typeof e&&(e=e.split(/\s*,\s*/)),"string"==typeof n&&(n=n.split(/\s*,\s*/)),a()&&n.push("wechat"),n.length&&r.each(n,function(t,n){var o=r.inarray(n,e);o!==-1&&e.splice(o,1)}),e}function i(r,t){var e=l[r];t.summary=t.description;for(var n in t)if(t.hasownproperty(n)){var o=r+n.replace(/^[a-z]/,function(r){return r.touppercase()}),i=encodeuricomponent(void 0===t[o]?t[n]:t[o]);e=e.replace(new regexp("{{"+n.touppercase()+"}}","g"),i)}return e}function a(){return/micromessenger/i.test(navigator.useragent)}function u(){return r(window).width()<=768}var f=r(document.head),c={url:location.href,site_url:location.origin,source:f.find("[name=site], [name=site]").attr("content")||document.title,title:f.find("[name=title], [name=title]").attr("content")||document.title,description:f.find("[name=description], [name=description]").attr("content")||"",image:r("img:first").prop("src")||"",imageselector:void 0,weibokey:"",wechatqrcodetitle:"微信扫一扫:分享",wechatqrcodehelper:"

微信里点“发现”,扫一下

二维码便可将本文分享至朋友圈。

",wechatqrcodesize:100,mobilesites:[],sites:["weibo","qq","wechat","tencent","douban","qzone","linkedin","diandian","facebook","twitter","google"],disabled:[],initialized:!1},s=r.extend({},c,t),l={qzone:"http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url={{url}}&title={{title}}&desc={{description}}&summary={{summary}}&site={{source}}",qq:"http://connect.qq.com/widget/shareqq/index.html?url={{url}}&title={{title}}&source={{source}}&desc={{description}}&pics={{image}}",tencent:"http://share.v.t.qq.com/index.php?c=share&a=index&title={{title}}&url={{url}}&pic={{image}}",weibo:"http://service.weibo.com/share/share.php?url={{url}}&title={{title}}&pic={{image}}&appkey={{weibokey}}",wechat:"javascript:;",douban:"http://shuo.douban.com/!service/share?href={{url}}&name={{title}}&text={{description}}&image={{image}}&starid=0&aid=0&style=11",diandian:"http://www.diandian.com/share?lo={{url}}&ti={{title}}&type=link",linkedin:"http://www.linkedin.com/sharearticle?mini=true&ro=true&title={{title}}&url={{url}}&summary={{summary}}&source={{source}}&armin=armin",facebook:"https://www.facebook.com/sharer/sharer.php?u={{url}}&title={{title}}&description={{description}}&caption={{subhead}}&link={{url}}&picture={{image}}",twitter:"https://twitter.com/intent/tweet?text={{title}}&url={{url}}&via={{site_url}}",google:"https://plus.google.com/share?url={{url}}"},h={qzone:"qq空间",qq:"qq",tencent:"腾讯微博",weibo:"微博",wechat:"微信",douban:"豆瓣",diandian:"点点",linkedin:"linkedin",facebook:"facebook",twitter:"twitter",google:"google"};this.each(function(){if(r(this).data("initialized"))return!0;var t=r.extend({},s,r(this).data());t.imageselector&&(t.image=r(t.imageselector).map(function(){return r(this).prop("src")}).get().join("||"));var o=r(this).addclass("share-component social-share");e(o,t),n(o,t),r(this).data("initialized",!0)})},r(function(){r(".share-component,.social-share").share()})}(jquery); /*! iscroll v5.2.0-snapshot ~ (c) 2008-2017 matteo spinelli ~ http://cubiq.org/license */ (function (window, document, math) { var raf = window.requestanimationframe || window.webkitrequestanimationframe || window.mozrequestanimationframe || window.orequestanimationframe || window.msrequestanimationframe || function (callback) { window.settimeout(callback, 1000 / 60); }; var utils = (function () { var me = {}; var _elementstyle = document.createelement('div').style; var _vendor = (function () { var vendors = ['t', 'webkitt', 'mozt', 'mst', 'ot'], transform, i = 0, l = vendors.length; for ( ; i < l; i++ ) { transform = vendors[i] + 'ransform'; if ( transform in _elementstyle ) return vendors[i].substr(0, vendors[i].length-1); } return false; })(); function _prefixstyle (style) { if ( _vendor === false ) return false; if ( _vendor === '' ) return style; return _vendor + style.charat(0).touppercase() + style.substr(1); } me.gettime = date.now || function gettime () { return new date().gettime(); }; me.extend = function (target, obj) { for ( var i in obj ) { target[i] = obj[i]; } }; me.addevent = function (el, type, fn, capture) { el.addeventlistener(type, fn, !!capture); }; me.removeevent = function (el, type, fn, capture) { el.removeeventlistener(type, fn, !!capture); }; me.prefixpointerevent = function (pointerevent) { return window.mspointerevent ? 'mspointer' + pointerevent.charat(7).touppercase() + pointerevent.substr(8): pointerevent; }; me.momentum = function (current, start, time, lowermargin, wrappersize, deceleration) { var distance = current - start, speed = math.abs(distance) / time, destination, duration; deceleration = deceleration === undefined ? 0.0006 : deceleration; destination = current + ( speed * speed ) / ( 2 * deceleration ) * ( distance < 0 ? -1 : 1 ); duration = speed / deceleration; if ( destination < lowermargin ) { destination = wrappersize ? lowermargin - ( wrappersize / 2.5 * ( speed / 8 ) ) : lowermargin; distance = math.abs(destination - current); duration = distance / speed; } else if ( destination > 0 ) { destination = wrappersize ? wrappersize / 2.5 * ( speed / 8 ) : 0; distance = math.abs(current) + destination; duration = distance / speed; } return { destination: math.round(destination), duration: duration }; }; var _transform = _prefixstyle('transform'); me.extend(me, { hastransform: _transform !== false, hasperspective: _prefixstyle('perspective') in _elementstyle, hastouch: 'ontouchstart' in window, haspointer: !!(window.pointerevent || window.mspointerevent), // ie10 is prefixed hastransition: _prefixstyle('transition') in _elementstyle }); /* this should find all android browsers lower than build 535.19 (both stock browser and webview) - galaxy s2 is ok - 2.3.6 : `applewebkit/533.1 (khtml, like gecko) version/4.0 mobile safari/533.1` - 4.0.4 : `applewebkit/534.30 (khtml, like gecko) version/4.0 mobile safari/534.30` - galaxy s3 is badandroid (stock brower, webview) `applewebkit/534.30 (khtml, like gecko) version/4.0 mobile safari/534.30` - galaxy s4 is badandroid (stock brower, webview) `applewebkit/534.30 (khtml, like gecko) version/4.0 mobile safari/534.30` - galaxy s5 is ok `applewebkit/537.36 (khtml, like gecko) version/4.0 mobile safari/537.36 (chrome/)` - galaxy s6 is ok `applewebkit/537.36 (khtml, like gecko) version/4.0 mobile safari/537.36 (chrome/)` */ me.isbadandroid = (function() { var appversion = window.navigator.appversion; // android browser is not a chrome browser. if (/android/.test(appversion) && !(/chrome\/\d/.test(appversion))) { var safariversion = appversion.match(/safari\/(\d+.\d)/); if(safariversion && typeof safariversion === "object" && safariversion.length >= 2) { return parsefloat(safariversion[1]) < 535.19; } else { return true; } } else { return false; } })(); me.extend(me.style = {}, { transform: _transform, transitiontimingfunction: _prefixstyle('transitiontimingfunction'), transitionduration: _prefixstyle('transitionduration'), transitiondelay: _prefixstyle('transitiondelay'), transformorigin: _prefixstyle('transformorigin'), touchaction: _prefixstyle('touchaction') }); me.hasclass = function (e, c) { var re = new regexp("(^|\\s)" + c + "(\\s|$)"); return re.test(e.classname); }; me.addclass = function (e, c) { if ( me.hasclass(e, c) ) { return; } var newclass = e.classname.split(' '); newclass.push(c); e.classname = newclass.join(' '); }; me.removeclass = function (e, c) { if ( !me.hasclass(e, c) ) { return; } var re = new regexp("(^|\\s)" + c + "(\\s|$)", 'g'); e.classname = e.classname.replace(re, ' '); }; me.offset = function (el) { var left = -el.offsetleft, top = -el.offsettop; // jshint -w084 while (el = el.offsetparent) { left -= el.offsetleft; top -= el.offsettop; } // jshint +w084 return { left: left, top: top }; }; me.preventdefaultexception = function (el, exceptions) { for ( var i in exceptions ) { if ( exceptions[i].test(el[i]) ) { return true; } } return false; }; me.extend(me.eventtype = {}, { touchstart: 1, touchmove: 1, touchend: 1, mousedown: 2, mousemove: 2, mouseup: 2, pointerdown: 3, pointermove: 3, pointerup: 3, mspointerdown: 3, mspointermove: 3, mspointerup: 3 }); me.extend(me.ease = {}, { quadratic: { style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)', fn: function (k) { return k * ( 2 - k ); } }, circular: { style: 'cubic-bezier(0.1, 0.57, 0.1, 1)', // not properly "circular" but this looks better, it should be (0.075, 0.82, 0.165, 1) fn: function (k) { return math.sqrt( 1 - ( --k * k ) ); } }, back: { style: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)', fn: function (k) { var b = 4; return ( k = k - 1 ) * k * ( ( b + 1 ) * k + b ) + 1; } }, bounce: { style: '', fn: function (k) { if ( ( k /= 1 ) < ( 1 / 2.75 ) ) { return 7.5625 * k * k; } else if ( k < ( 2 / 2.75 ) ) { return 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75; } else if ( k < ( 2.5 / 2.75 ) ) { return 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375; } else { return 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375; } } }, elastic: { style: '', fn: function (k) { var f = 0.22, e = 0.4; if ( k === 0 ) { return 0; } if ( k == 1 ) { return 1; } return ( e * math.pow( 2, - 10 * k ) * math.sin( ( k - f / 4 ) * ( 2 * math.pi ) / f ) + 1 ); } } }); me.tap = function (e, eventname) { var ev = document.createevent('event'); ev.initevent(eventname, true, true); ev.pagex = e.pagex; ev.pagey = e.pagey; e.target.dispatchevent(ev); }; me.click = function (e) { var target = e.target, ev; if ( !(/(select|input|textarea)/i).test(target.tagname) ) { // https://developer.mozilla.org/en-us/docs/web/api/mouseevent/initmouseevent // initmouseevent is deprecated. ev = document.createevent(window.mouseevent ? 'mouseevents' : 'event'); ev.initevent('click', true, true); ev.view = e.view || window; ev.detail = 1; ev.screenx = target.screenx || 0; ev.screeny = target.screeny || 0; ev.clientx = target.clientx || 0; ev.clienty = target.clienty || 0; ev.ctrlkey = !!e.ctrlkey; ev.altkey = !!e.altkey; ev.shiftkey = !!e.shiftkey; ev.metakey = !!e.metakey; ev.button = 0; ev.relatedtarget = null; ev._constructed = true; target.dispatchevent(ev); } }; me.gettouchaction = function(eventpassthrough, addpinch) { var touchaction = 'none'; if ( eventpassthrough === 'vertical' ) { touchaction = 'pan-y'; } else if (eventpassthrough === 'horizontal' ) { touchaction = 'pan-x'; } if (addpinch && touchaction != 'none') { // add pinch-zoom support if the browser supports it, but if not (eg. chrome <55) do nothing touchaction += ' pinch-zoom'; } return touchaction; }; me.getrect = function(el) { if (el instanceof svgelement) { var rect = el.getboundingclientrect(); return { top : rect.top, left : rect.left, width : rect.width, height : rect.height }; } else { return { top : el.offsettop, left : el.offsetleft, width : el.offsetwidth, height : el.offsetheight }; } }; return me; })(); function iscroll (el, options) { this.wrapper = typeof el == 'string' ? document.queryselector(el) : el; this.scroller = this.wrapper.children[0]; this.scrollerstyle = this.scroller.style; // cache style for better performance this.options = { resizescrollbars: true, mousewheelspeed: 20, snapthreshold: 0.334, // insert point: options disablepointer : !utils.haspointer, disabletouch : utils.haspointer || !utils.hastouch, disablemouse : utils.haspointer || utils.hastouch, startx: 0, starty: 0, scrolly: true, directionlockthreshold: 5, momentum: true, bounce: true, bouncetime: 600, bounceeasing: '', preventdefault: true, preventdefaultexception: { tagname: /^(input|textarea|button|select)$/ }, hwcompositing: true, usetransition: true, usetransform: true, bindtowrapper: typeof window.onmousedown === "undefined" }; for ( var i in options ) { this.options[i] = options[i]; } // normalize options this.translatez = this.options.hwcompositing && utils.hasperspective ? ' translatez(0)' : ''; this.options.usetransition = utils.hastransition && this.options.usetransition; this.options.usetransform = utils.hastransform && this.options.usetransform; this.options.eventpassthrough = this.options.eventpassthrough === true ? 'vertical' : this.options.eventpassthrough; this.options.preventdefault = !this.options.eventpassthrough && this.options.preventdefault; // if you want eventpassthrough i have to lock one of the axes this.options.scrolly = this.options.eventpassthrough == 'vertical' ? false : this.options.scrolly; this.options.scrollx = this.options.eventpassthrough == 'horizontal' ? false : this.options.scrollx; // with eventpassthrough we also need lockdirection mechanism this.options.freescroll = this.options.freescroll && !this.options.eventpassthrough; this.options.directionlockthreshold = this.options.eventpassthrough ? 0 : this.options.directionlockthreshold; this.options.bounceeasing = typeof this.options.bounceeasing == 'string' ? utils.ease[this.options.bounceeasing] || utils.ease.circular : this.options.bounceeasing; this.options.resizepolling = this.options.resizepolling === undefined ? 60 : this.options.resizepolling; if ( this.options.tap === true ) { this.options.tap = 'tap'; } // https://github.com/cubiq/iscroll/issues/1029 if (!this.options.usetransition && !this.options.usetransform) { if(!(/relative|absolute/i).test(this.scrollerstyle.position)) { this.scrollerstyle.position = "relative"; } } if ( this.options.shrinkscrollbars == 'scale' ) { this.options.usetransition = false; } this.options.invertwheeldirection = this.options.invertwheeldirection ? -1 : 1; if ( this.options.probetype == 3 ) { this.options.usetransition = false; } // insert point: normalization // some defaults this.x = 0; this.y = 0; this.directionx = 0; this.directiony = 0; this._events = {}; // insert point: defaults this._init(); this.refresh(); this.scrollto(this.options.startx, this.options.starty); this.enable(); } iscroll.prototype = { version: '5.2.0-snapshot', _init: function () { this._initevents(); if ( this.options.scrollbars || this.options.indicators ) { this._initindicators(); } if ( this.options.mousewheel ) { this._initwheel(); } if ( this.options.snap ) { this._initsnap(); } if ( this.options.keybindings ) { this._initkeys(); } // insert point: _init }, destroy: function () { this._initevents(true); cleartimeout(this.resizetimeout); this.resizetimeout = null; this._execevent('destroy'); }, _transitionend: function (e) { if ( e.target != this.scroller || !this.isintransition ) { return; } this._transitiontime(); if ( !this.resetposition(this.options.bouncetime) ) { this.isintransition = false; this._execevent('scrollend'); } }, _start: function (e) { // react to left mouse button only if ( utils.eventtype[e.type] != 1 ) { // for button property // http://unixpapa.com/js/mouse.html var button; if (!e.which) { /* ie case */ button = (e.button < 2) ? 0 : ((e.button == 4) ? 1 : 2); } else { /* all others */ button = e.button; } if ( button !== 0 ) { return; } } if ( !this.enabled || (this.initiated && utils.eventtype[e.type] !== this.initiated) ) { return; } if ( this.options.preventdefault && !utils.isbadandroid && !utils.preventdefaultexception(e.target, this.options.preventdefaultexception) ) { e.preventdefault(); } var point = e.touches ? e.touches[0] : e, pos; this.initiated = utils.eventtype[e.type]; this.moved = false; this.distx = 0; this.disty = 0; this.directionx = 0; this.directiony = 0; this.directionlocked = 0; this.starttime = utils.gettime(); if ( this.options.usetransition && this.isintransition ) { this._transitiontime(); this.isintransition = false; pos = this.getcomputedposition(); this._translate(math.round(pos.x), math.round(pos.y)); this._execevent('scrollend'); } else if ( !this.options.usetransition && this.isanimating ) { this.isanimating = false; this._execevent('scrollend'); } this.startx = this.x; this.starty = this.y; this.absstartx = this.x; this.absstarty = this.y; this.pointx = point.pagex; this.pointy = point.pagey; this._execevent('beforescrollstart'); }, _move: function (e) { if ( !this.enabled || utils.eventtype[e.type] !== this.initiated ) { return; } if ( this.options.preventdefault ) { // increases performance on android? todo: check! e.preventdefault(); } var point = e.touches ? e.touches[0] : e, deltax = point.pagex - this.pointx, deltay = point.pagey - this.pointy, timestamp = utils.gettime(), newx, newy, absdistx, absdisty; this.pointx = point.pagex; this.pointy = point.pagey; this.distx += deltax; this.disty += deltay; absdistx = math.abs(this.distx); absdisty = math.abs(this.disty); // we need to move at least 10 pixels for the scrolling to initiate if ( timestamp - this.endtime > 300 && (absdistx < 10 && absdisty < 10) ) { return; } // if you are scrolling in one direction lock the other if ( !this.directionlocked && !this.options.freescroll ) { if ( absdistx > absdisty + this.options.directionlockthreshold ) { this.directionlocked = 'h'; // lock horizontally } else if ( absdisty >= absdistx + this.options.directionlockthreshold ) { this.directionlocked = 'v'; // lock vertically } else { this.directionlocked = 'n'; // no lock } } if ( this.directionlocked == 'h' ) { if ( this.options.eventpassthrough == 'vertical' ) { e.preventdefault(); } else if ( this.options.eventpassthrough == 'horizontal' ) { this.initiated = false; return; } deltay = 0; } else if ( this.directionlocked == 'v' ) { if ( this.options.eventpassthrough == 'horizontal' ) { e.preventdefault(); } else if ( this.options.eventpassthrough == 'vertical' ) { this.initiated = false; return; } deltax = 0; } deltax = this.hashorizontalscroll ? deltax : 0; deltay = this.hasverticalscroll ? deltay : 0; newx = this.x + deltax; newy = this.y + deltay; // slow down if outside of the boundaries if ( newx > 0 || newx < this.maxscrollx ) { newx = this.options.bounce ? this.x + deltax / 3 : newx > 0 ? 0 : this.maxscrollx; } if ( newy > 0 || newy < this.maxscrolly ) { newy = this.options.bounce ? this.y + deltay / 3 : newy > 0 ? 0 : this.maxscrolly; } this.directionx = deltax > 0 ? -1 : deltax < 0 ? 1 : 0; this.directiony = deltay > 0 ? -1 : deltay < 0 ? 1 : 0; if ( !this.moved ) { this._execevent('scrollstart'); } this.moved = true; this._translate(newx, newy); /* replace start: _move */ if ( timestamp - this.starttime > 300 ) { this.starttime = timestamp; this.startx = this.x; this.starty = this.y; if ( this.options.probetype == 1 ) { this._execevent('scroll'); } } if ( this.options.probetype > 1 ) { this._execevent('scroll'); } /* replace end: _move */ }, _end: function (e) { if ( !this.enabled || utils.eventtype[e.type] !== this.initiated ) { return; } if ( this.options.preventdefault && !utils.preventdefaultexception(e.target, this.options.preventdefaultexception) ) { e.preventdefault(); } var point = e.changedtouches ? e.changedtouches[0] : e, momentumx, momentumy, duration = utils.gettime() - this.starttime, newx = math.round(this.x), newy = math.round(this.y), distancex = math.abs(newx - this.startx), distancey = math.abs(newy - this.starty), time = 0, easing = ''; this.isintransition = 0; this.initiated = 0; this.endtime = utils.gettime(); // reset if we are outside of the boundaries if ( this.resetposition(this.options.bouncetime) ) { return; } this.scrollto(newx, newy); // ensures that the last position is rounded // we scrolled less than 10 pixels if ( !this.moved ) { if ( this.options.tap ) { utils.tap(e, this.options.tap); } if ( this.options.click ) { utils.click(e); } this._execevent('scrollcancel'); return; } if ( this._events.flick && duration < 200 && distancex < 100 && distancey < 100 ) { this._execevent('flick'); return; } // start momentum animation if needed if ( this.options.momentum && duration < 300 ) { momentumx = this.hashorizontalscroll ? utils.momentum(this.x, this.startx, duration, this.maxscrollx, this.options.bounce ? this.wrapperwidth : 0, this.options.deceleration) : { destination: newx, duration: 0 }; momentumy = this.hasverticalscroll ? utils.momentum(this.y, this.starty, duration, this.maxscrolly, this.options.bounce ? this.wrapperheight : 0, this.options.deceleration) : { destination: newy, duration: 0 }; newx = momentumx.destination; newy = momentumy.destination; time = math.max(momentumx.duration, momentumy.duration); this.isintransition = 1; } if ( this.options.snap ) { var snap = this._nearestsnap(newx, newy); this.currentpage = snap; time = this.options.snapspeed || math.max( math.max( math.min(math.abs(newx - snap.x), 1000), math.min(math.abs(newy - snap.y), 1000) ), 300); newx = snap.x; newy = snap.y; this.directionx = 0; this.directiony = 0; easing = this.options.bounceeasing; } // insert point: _end if ( newx != this.x || newy != this.y ) { // change easing function when scroller goes out of the boundaries if ( newx > 0 || newx < this.maxscrollx || newy > 0 || newy < this.maxscrolly ) { easing = utils.ease.quadratic; } this.scrollto(newx, newy, time, easing); return; } this._execevent('scrollend'); }, _resize: function () { var that = this; cleartimeout(this.resizetimeout); this.resizetimeout = settimeout(function () { that.refresh(); }, this.options.resizepolling); }, resetposition: function (time) { var x = this.x, y = this.y; time = time || 0; if ( !this.hashorizontalscroll || this.x > 0 ) { x = 0; } else if ( this.x < this.maxscrollx ) { x = this.maxscrollx; } if ( !this.hasverticalscroll || this.y > 0 ) { y = 0; } else if ( this.y < this.maxscrolly ) { y = this.maxscrolly; } if ( x == this.x && y == this.y ) { return false; } this.scrollto(x, y, time, this.options.bounceeasing); return true; }, disable: function () { this.enabled = false; }, enable: function () { this.enabled = true; }, refresh: function () { utils.getrect(this.wrapper); // force reflow this.wrapperwidth = this.wrapper.clientwidth; this.wrapperheight = this.wrapper.clientheight; var rect = utils.getrect(this.scroller); /* replace start: refresh */ this.scrollerwidth = rect.width; this.scrollerheight = rect.height; this.maxscrollx = this.wrapperwidth - this.scrollerwidth; this.maxscrolly = this.wrapperheight - this.scrollerheight; /* replace end: refresh */ this.hashorizontalscroll = this.options.scrollx && this.maxscrollx < 0; this.hasverticalscroll = this.options.scrolly && this.maxscrolly < 0; if ( !this.hashorizontalscroll ) { this.maxscrollx = 0; this.scrollerwidth = this.wrapperwidth; } if ( !this.hasverticalscroll ) { this.maxscrolly = 0; this.scrollerheight = this.wrapperheight; } this.endtime = 0; this.directionx = 0; this.directiony = 0; if(utils.haspointer && !this.options.disablepointer) { // the wrapper should have `touchaction` property for using pointerevent. this.wrapper.style[utils.style.touchaction] = utils.gettouchaction(this.options.eventpassthrough, true); // case. not support 'pinch-zoom' // https://github.com/cubiq/iscroll/issues/1118#issuecomment-270057583 if (!this.wrapper.style[utils.style.touchaction]) { this.wrapper.style[utils.style.touchaction] = utils.gettouchaction(this.options.eventpassthrough, false); } } this.wrapperoffset = utils.offset(this.wrapper); this._execevent('refresh'); this.resetposition(); // insert point: _refresh }, on: function (type, fn) { if ( !this._events[type] ) { this._events[type] = []; } this._events[type].push(fn); }, off: function (type, fn) { if ( !this._events[type] ) { return; } var index = this._events[type].indexof(fn); if ( index > -1 ) { this._events[type].splice(index, 1); } }, _execevent: function (type) { if ( !this._events[type] ) { return; } var i = 0, l = this._events[type].length; if ( !l ) { return; } for ( ; i < l; i++ ) { this._events[type][i].apply(this, [].slice.call(arguments, 1)); } }, scrollby: function (x, y, time, easing) { x = this.x + x; y = this.y + y; time = time || 0; this.scrollto(x, y, time, easing); }, scrollto: function (x, y, time, easing) { easing = easing || utils.ease.circular; this.isintransition = this.options.usetransition && time > 0; var transitiontype = this.options.usetransition && easing.style; if ( !time || transitiontype ) { if(transitiontype) { this._transitiontimingfunction(easing.style); this._transitiontime(time); } this._translate(x, y); } else { this._animate(x, y, time, easing.fn); } }, scrolltoelement: function (el, time, offsetx, offsety, easing) { el = el.nodetype ? el : this.scroller.queryselector(el); if ( !el ) { return; } var pos = utils.offset(el); pos.left -= this.wrapperoffset.left; pos.top -= this.wrapperoffset.top; // if offsetx/y are true we center the element to the screen var elrect = utils.getrect(el); var wrapperrect = utils.getrect(this.wrapper); if ( offsetx === true ) { offsetx = math.round(elrect.width / 2 - wrapperrect.width / 2); } if ( offsety === true ) { offsety = math.round(elrect.height / 2 - wrapperrect.height / 2); } pos.left -= offsetx || 0; pos.top -= offsety || 0; pos.left = pos.left > 0 ? 0 : pos.left < this.maxscrollx ? this.maxscrollx : pos.left; pos.top = pos.top > 0 ? 0 : pos.top < this.maxscrolly ? this.maxscrolly : pos.top; time = time === undefined || time === null || time === 'auto' ? math.max(math.abs(this.x-pos.left), math.abs(this.y-pos.top)) : time; this.scrollto(pos.left, pos.top, time, easing); }, _transitiontime: function (time) { if (!this.options.usetransition) { return; } time = time || 0; var durationprop = utils.style.transitionduration; if(!durationprop) { return; } this.scrollerstyle[durationprop] = time + 'ms'; if ( !time && utils.isbadandroid ) { this.scrollerstyle[durationprop] = '0.0001ms'; // remove 0.0001ms var self = this; raf(function() { if(self.scrollerstyle[durationprop] === '0.0001ms') { self.scrollerstyle[durationprop] = '0s'; } }); } if ( this.indicators ) { for ( var i = this.indicators.length; i--; ) { this.indicators[i].transitiontime(time); } } // insert point: _transitiontime }, _transitiontimingfunction: function (easing) { this.scrollerstyle[utils.style.transitiontimingfunction] = easing; if ( this.indicators ) { for ( var i = this.indicators.length; i--; ) { this.indicators[i].transitiontimingfunction(easing); } } // insert point: _transitiontimingfunction }, _translate: function (x, y) { if ( this.options.usetransform ) { /* replace start: _translate */ this.scrollerstyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translatez; /* replace end: _translate */ } else { x = math.round(x); y = math.round(y); this.scrollerstyle.left = x + 'px'; this.scrollerstyle.top = y + 'px'; } this.x = x; this.y = y; if ( this.indicators ) { for ( var i = this.indicators.length; i--; ) { this.indicators[i].updateposition(); } } // insert point: _translate }, _initevents: function (remove) { var eventtype = remove ? utils.removeevent : utils.addevent, target = this.options.bindtowrapper ? this.wrapper : window; eventtype(window, 'orientationchange', this); eventtype(window, 'resize', this); if ( this.options.click ) { eventtype(this.wrapper, 'click', this, true); } if ( !this.options.disablemouse ) { eventtype(this.wrapper, 'mousedown', this); eventtype(target, 'mousemove', this); eventtype(target, 'mousecancel', this); eventtype(target, 'mouseup', this); } if ( utils.haspointer && !this.options.disablepointer ) { eventtype(this.wrapper, utils.prefixpointerevent('pointerdown'), this); eventtype(target, utils.prefixpointerevent('pointermove'), this); eventtype(target, utils.prefixpointerevent('pointercancel'), this); eventtype(target, utils.prefixpointerevent('pointerup'), this); } if ( utils.hastouch && !this.options.disabletouch ) { eventtype(this.wrapper, 'touchstart', this); eventtype(target, 'touchmove', this); eventtype(target, 'touchcancel', this); eventtype(target, 'touchend', this); } eventtype(this.scroller, 'transitionend', this); eventtype(this.scroller, 'webkittransitionend', this); eventtype(this.scroller, 'otransitionend', this); eventtype(this.scroller, 'mstransitionend', this); }, getcomputedposition: function () { var matrix = window.getcomputedstyle(this.scroller, null), x, y; if ( this.options.usetransform ) { matrix = matrix[utils.style.transform].split(')')[0].split(', '); x = +(matrix[12] || matrix[4]); y = +(matrix[13] || matrix[5]); } else { x = +matrix.left.replace(/[^-\d.]/g, ''); y = +matrix.top.replace(/[^-\d.]/g, ''); } return { x: x, y: y }; }, _initindicators: function () { var interactive = this.options.interactivescrollbars, customstyle = typeof this.options.scrollbars != 'string', indicators = [], indicator; var that = this; this.indicators = []; if ( this.options.scrollbars ) { // vertical scrollbar if ( this.options.scrolly ) { indicator = { el: createdefaultscrollbar('v', interactive, this.options.scrollbars), interactive: interactive, defaultscrollbars: true, customstyle: customstyle, resize: this.options.resizescrollbars, shrink: this.options.shrinkscrollbars, fade: this.options.fadescrollbars, listenx: false }; this.wrapper.appendchild(indicator.el); indicators.push(indicator); } // horizontal scrollbar if ( this.options.scrollx ) { indicator = { el: createdefaultscrollbar('h', interactive, this.options.scrollbars), interactive: interactive, defaultscrollbars: true, customstyle: customstyle, resize: this.options.resizescrollbars, shrink: this.options.shrinkscrollbars, fade: this.options.fadescrollbars, listeny: false }; this.wrapper.appendchild(indicator.el); indicators.push(indicator); } } if ( this.options.indicators ) { // todo: check concat compatibility indicators = indicators.concat(this.options.indicators); } for ( var i = indicators.length; i--; ) { this.indicators.push( new indicator(this, indicators[i]) ); } // todo: check if we can use array.map (wide compatibility and performance issues) function _indicatorsmap (fn) { if (that.indicators) { for ( var i = that.indicators.length; i--; ) { fn.call(that.indicators[i]); } } } if ( this.options.fadescrollbars ) { this.on('scrollend', function () { _indicatorsmap(function () { this.fade(); }); }); this.on('scrollcancel', function () { _indicatorsmap(function () { this.fade(); }); }); this.on('scrollstart', function () { _indicatorsmap(function () { this.fade(1); }); }); this.on('beforescrollstart', function () { _indicatorsmap(function () { this.fade(1, true); }); }); } this.on('refresh', function () { _indicatorsmap(function () { this.refresh(); }); }); this.on('destroy', function () { _indicatorsmap(function () { this.destroy(); }); delete this.indicators; }); }, _initwheel: function () { utils.addevent(this.wrapper, 'wheel', this); utils.addevent(this.wrapper, 'mousewheel', this); utils.addevent(this.wrapper, 'dommousescroll', this); this.on('destroy', function () { cleartimeout(this.wheeltimeout); this.wheeltimeout = null; utils.removeevent(this.wrapper, 'wheel', this); utils.removeevent(this.wrapper, 'mousewheel', this); utils.removeevent(this.wrapper, 'dommousescroll', this); }); }, _wheel: function (e) { if ( !this.enabled ) { return; } e.preventdefault(); var wheeldeltax, wheeldeltay, newx, newy, that = this; if ( this.wheeltimeout === undefined ) { that._execevent('scrollstart'); } // execute the scrollend event after 400ms the wheel stopped scrolling cleartimeout(this.wheeltimeout); this.wheeltimeout = settimeout(function () { if(!that.options.snap) { that._execevent('scrollend'); } that.wheeltimeout = undefined; }, 400); if ( 'deltax' in e ) { if (e.deltamode === 1) { wheeldeltax = -e.deltax * this.options.mousewheelspeed; wheeldeltay = -e.deltay * this.options.mousewheelspeed; } else { wheeldeltax = -e.deltax; wheeldeltay = -e.deltay; } } else if ( 'wheeldeltax' in e ) { wheeldeltax = e.wheeldeltax / 120 * this.options.mousewheelspeed; wheeldeltay = e.wheeldeltay / 120 * this.options.mousewheelspeed; } else if ( 'wheeldelta' in e ) { wheeldeltax = wheeldeltay = e.wheeldelta / 120 * this.options.mousewheelspeed; } else if ( 'detail' in e ) { wheeldeltax = wheeldeltay = -e.detail / 3 * this.options.mousewheelspeed; } else { return; } wheeldeltax *= this.options.invertwheeldirection; wheeldeltay *= this.options.invertwheeldirection; if ( !this.hasverticalscroll ) { wheeldeltax = wheeldeltay; wheeldeltay = 0; } if ( this.options.snap ) { newx = this.currentpage.pagex; newy = this.currentpage.pagey; if ( wheeldeltax > 0 ) { newx--; } else if ( wheeldeltax < 0 ) { newx++; } if ( wheeldeltay > 0 ) { newy--; } else if ( wheeldeltay < 0 ) { newy++; } this.gotopage(newx, newy); return; } newx = this.x + math.round(this.hashorizontalscroll ? wheeldeltax : 0); newy = this.y + math.round(this.hasverticalscroll ? wheeldeltay : 0); this.directionx = wheeldeltax > 0 ? -1 : wheeldeltax < 0 ? 1 : 0; this.directiony = wheeldeltay > 0 ? -1 : wheeldeltay < 0 ? 1 : 0; if ( newx > 0 ) { newx = 0; } else if ( newx < this.maxscrollx ) { newx = this.maxscrollx; } if ( newy > 0 ) { newy = 0; } else if ( newy < this.maxscrolly ) { newy = this.maxscrolly; } this.scrollto(newx, newy, 0); if ( this.options.probetype > 1 ) { this._execevent('scroll'); } // insert point: _wheel }, _initsnap: function () { this.currentpage = {}; if ( typeof this.options.snap == 'string' ) { this.options.snap = this.scroller.queryselectorall(this.options.snap); } this.on('refresh', function () { var i = 0, l, m = 0, n, cx, cy, x = 0, y, stepx = this.options.snapstepx || this.wrapperwidth, stepy = this.options.snapstepy || this.wrapperheight, el, rect; this.pages = []; if ( !this.wrapperwidth || !this.wrapperheight || !this.scrollerwidth || !this.scrollerheight ) { return; } if ( this.options.snap === true ) { cx = math.round( stepx / 2 ); cy = math.round( stepy / 2 ); while ( x > -this.scrollerwidth ) { this.pages[i] = []; l = 0; y = 0; while ( y > -this.scrollerheight ) { this.pages[i][l] = { x: math.max(x, this.maxscrollx), y: math.max(y, this.maxscrolly), width: stepx, height: stepy, cx: x - cx, cy: y - cy }; y -= stepy; l++; } x -= stepx; i++; } } else { el = this.options.snap; l = el.length; n = -1; for ( ; i < l; i++ ) { rect = utils.getrect(el[i]); if ( i === 0 || rect.left <= utils.getrect(el[i-1]).left ) { m = 0; n++; } if ( !this.pages[m] ) { this.pages[m] = []; } x = math.max(-rect.left, this.maxscrollx); y = math.max(-rect.top, this.maxscrolly); cx = x - math.round(rect.width / 2); cy = y - math.round(rect.height / 2); this.pages[m][n] = { x: x, y: y, width: rect.width, height: rect.height, cx: cx, cy: cy }; if ( x > this.maxscrollx ) { m++; } } } this.gotopage(this.currentpage.pagex || 0, this.currentpage.pagey || 0, 0); // update snap threshold if needed if ( this.options.snapthreshold % 1 === 0 ) { this.snapthresholdx = this.options.snapthreshold; this.snapthresholdy = this.options.snapthreshold; } else { this.snapthresholdx = math.round(this.pages[this.currentpage.pagex][this.currentpage.pagey].width * this.options.snapthreshold); this.snapthresholdy = math.round(this.pages[this.currentpage.pagex][this.currentpage.pagey].height * this.options.snapthreshold); } }); this.on('flick', function () { var time = this.options.snapspeed || math.max( math.max( math.min(math.abs(this.x - this.startx), 1000), math.min(math.abs(this.y - this.starty), 1000) ), 300); this.gotopage( this.currentpage.pagex + this.directionx, this.currentpage.pagey + this.directiony, time ); }); }, _nearestsnap: function (x, y) { if ( !this.pages.length ) { return { x: 0, y: 0, pagex: 0, pagey: 0 }; } var i = 0, l = this.pages.length, m = 0; // check if we exceeded the snap threshold if ( math.abs(x - this.absstartx) < this.snapthresholdx && math.abs(y - this.absstarty) < this.snapthresholdy ) { return this.currentpage; } if ( x > 0 ) { x = 0; } else if ( x < this.maxscrollx ) { x = this.maxscrollx; } if ( y > 0 ) { y = 0; } else if ( y < this.maxscrolly ) { y = this.maxscrolly; } for ( ; i < l; i++ ) { if ( x >= this.pages[i][0].cx ) { x = this.pages[i][0].x; break; } } l = this.pages[i].length; for ( ; m < l; m++ ) { if ( y >= this.pages[0][m].cy ) { y = this.pages[0][m].y; break; } } if ( i == this.currentpage.pagex ) { i += this.directionx; if ( i < 0 ) { i = 0; } else if ( i >= this.pages.length ) { i = this.pages.length - 1; } x = this.pages[i][0].x; } if ( m == this.currentpage.pagey ) { m += this.directiony; if ( m < 0 ) { m = 0; } else if ( m >= this.pages[0].length ) { m = this.pages[0].length - 1; } y = this.pages[0][m].y; } return { x: x, y: y, pagex: i, pagey: m }; }, gotopage: function (x, y, time, easing) { easing = easing || this.options.bounceeasing; if ( x >= this.pages.length ) { x = this.pages.length - 1; } else if ( x < 0 ) { x = 0; } if ( y >= this.pages[x].length ) { y = this.pages[x].length - 1; } else if ( y < 0 ) { y = 0; } var posx = this.pages[x][y].x, posy = this.pages[x][y].y; time = time === undefined ? this.options.snapspeed || math.max( math.max( math.min(math.abs(posx - this.x), 1000), math.min(math.abs(posy - this.y), 1000) ), 300) : time; this.currentpage = { x: posx, y: posy, pagex: x, pagey: y }; this.scrollto(posx, posy, time, easing); }, next: function (time, easing) { var x = this.currentpage.pagex, y = this.currentpage.pagey; x++; if ( x >= this.pages.length && this.hasverticalscroll ) { x = 0; y++; } this.gotopage(x, y, time, easing); }, prev: function (time, easing) { var x = this.currentpage.pagex, y = this.currentpage.pagey; x--; if ( x < 0 && this.hasverticalscroll ) { x = 0; y--; } this.gotopage(x, y, time, easing); }, _initkeys: function (e) { // default key bindings var keys = { pageup: 33, pagedown: 34, end: 35, home: 36, left: 37, up: 38, right: 39, down: 40 }; var i; // if you give me characters i give you keycode if ( typeof this.options.keybindings == 'object' ) { for ( i in this.options.keybindings ) { if ( typeof this.options.keybindings[i] == 'string' ) { this.options.keybindings[i] = this.options.keybindings[i].touppercase().charcodeat(0); } } } else { this.options.keybindings = {}; } for ( i in keys ) { this.options.keybindings[i] = this.options.keybindings[i] || keys[i]; } utils.addevent(window, 'keydown', this); this.on('destroy', function () { utils.removeevent(window, 'keydown', this); }); }, _key: function (e) { if ( !this.enabled ) { return; } var snap = this.options.snap, // we are using this alot, better to cache it newx = snap ? this.currentpage.pagex : this.x, newy = snap ? this.currentpage.pagey : this.y, now = utils.gettime(), prevtime = this.keytime || 0, acceleration = 0.250, pos; if ( this.options.usetransition && this.isintransition ) { pos = this.getcomputedposition(); this._translate(math.round(pos.x), math.round(pos.y)); this.isintransition = false; } this.keyacceleration = now - prevtime < 200 ? math.min(this.keyacceleration + acceleration, 50) : 0; switch ( e.keycode ) { case this.options.keybindings.pageup: if ( this.hashorizontalscroll && !this.hasverticalscroll ) { newx += snap ? 1 : this.wrapperwidth; } else { newy += snap ? 1 : this.wrapperheight; } break; case this.options.keybindings.pagedown: if ( this.hashorizontalscroll && !this.hasverticalscroll ) { newx -= snap ? 1 : this.wrapperwidth; } else { newy -= snap ? 1 : this.wrapperheight; } break; case this.options.keybindings.end: newx = snap ? this.pages.length-1 : this.maxscrollx; newy = snap ? this.pages[0].length-1 : this.maxscrolly; break; case this.options.keybindings.home: newx = 0; newy = 0; break; case this.options.keybindings.left: newx += snap ? -1 : 5 + this.keyacceleration>>0; break; case this.options.keybindings.up: newy += snap ? 1 : 5 + this.keyacceleration>>0; break; case this.options.keybindings.right: newx -= snap ? -1 : 5 + this.keyacceleration>>0; break; case this.options.keybindings.down: newy -= snap ? 1 : 5 + this.keyacceleration>>0; break; default: return; } if ( snap ) { this.gotopage(newx, newy); return; } if ( newx > 0 ) { newx = 0; this.keyacceleration = 0; } else if ( newx < this.maxscrollx ) { newx = this.maxscrollx; this.keyacceleration = 0; } if ( newy > 0 ) { newy = 0; this.keyacceleration = 0; } else if ( newy < this.maxscrolly ) { newy = this.maxscrolly; this.keyacceleration = 0; } this.scrollto(newx, newy, 0); this.keytime = now; }, _animate: function (destx, desty, duration, easingfn) { var that = this, startx = this.x, starty = this.y, starttime = utils.gettime(), desttime = starttime + duration; function step () { var now = utils.gettime(), newx, newy, easing; if ( now >= desttime ) { that.isanimating = false; that._translate(destx, desty); if ( !that.resetposition(that.options.bouncetime) ) { that._execevent('scrollend'); } return; } now = ( now - starttime ) / duration; easing = easingfn(now); newx = ( destx - startx ) * easing + startx; newy = ( desty - starty ) * easing + starty; that._translate(newx, newy); if ( that.isanimating ) { raf(step); } if ( that.options.probetype == 3 ) { that._execevent('scroll'); } } this.isanimating = true; step(); }, handleevent: function (e) { switch ( e.type ) { case 'touchstart': case 'pointerdown': case 'mspointerdown': case 'mousedown': this._start(e); break; case 'touchmove': case 'pointermove': case 'mspointermove': case 'mousemove': this._move(e); break; case 'touchend': case 'pointerup': case 'mspointerup': case 'mouseup': case 'touchcancel': case 'pointercancel': case 'mspointercancel': case 'mousecancel': this._end(e); break; case 'orientationchange': case 'resize': this._resize(); break; case 'transitionend': case 'webkittransitionend': case 'otransitionend': case 'mstransitionend': this._transitionend(e); break; case 'wheel': case 'dommousescroll': case 'mousewheel': this._wheel(e); break; case 'keydown': this._key(e); break; case 'click': if ( this.enabled && !e._constructed ) { e.preventdefault(); e.stoppropagation(); } break; } } }; function createdefaultscrollbar (direction, interactive, type) { var scrollbar = document.createelement('div'), indicator = document.createelement('div'); if ( type === true ) { scrollbar.style.csstext = 'position:absolute;z-index:9999'; indicator.style.csstext = '-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px'; } indicator.classname = 'iscrollindicator'; if ( direction == 'h' ) { if ( type === true ) { scrollbar.style.csstext += ';height:7px;left:2px;right:2px;bottom:0'; indicator.style.height = '100%'; } scrollbar.classname = 'iscrollhorizontalscrollbar'; } else { if ( type === true ) { scrollbar.style.csstext += ';width:7px;bottom:2px;top:2px;right:1px'; indicator.style.width = '100%'; } scrollbar.classname = 'iscrollverticalscrollbar'; } scrollbar.style.csstext += ';overflow:hidden'; if ( !interactive ) { scrollbar.style.pointerevents = 'none'; } scrollbar.appendchild(indicator); return scrollbar; } function indicator (scroller, options) { this.wrapper = typeof options.el == 'string' ? document.queryselector(options.el) : options.el; this.wrapperstyle = this.wrapper.style; this.indicator = this.wrapper.children[0]; this.indicatorstyle = this.indicator.style; this.scroller = scroller; this.options = { listenx: true, listeny: true, interactive: false, resize: true, defaultscrollbars: false, shrink: false, fade: false, speedratiox: 0, speedratioy: 0 }; for ( var i in options ) { this.options[i] = options[i]; } this.sizeratiox = 1; this.sizeratioy = 1; this.maxposx = 0; this.maxposy = 0; if ( this.options.interactive ) { if ( !this.options.disabletouch ) { utils.addevent(this.indicator, 'touchstart', this); utils.addevent(window, 'touchend', this); } if ( !this.options.disablepointer ) { utils.addevent(this.indicator, utils.prefixpointerevent('pointerdown'), this); utils.addevent(window, utils.prefixpointerevent('pointerup'), this); } if ( !this.options.disablemouse ) { utils.addevent(this.indicator, 'mousedown', this); utils.addevent(window, 'mouseup', this); } } if ( this.options.fade ) { this.wrapperstyle[utils.style.transform] = this.scroller.translatez; var durationprop = utils.style.transitionduration; if(!durationprop) { return; } this.wrapperstyle[durationprop] = utils.isbadandroid ? '0.0001ms' : '0ms'; // remove 0.0001ms var self = this; if(utils.isbadandroid) { raf(function() { if(self.wrapperstyle[durationprop] === '0.0001ms') { self.wrapperstyle[durationprop] = '0s'; } }); } this.wrapperstyle.opacity = '0'; } } indicator.prototype = { handleevent: function (e) { switch ( e.type ) { case 'touchstart': case 'pointerdown': case 'mspointerdown': case 'mousedown': this._start(e); break; case 'touchmove': case 'pointermove': case 'mspointermove': case 'mousemove': this._move(e); break; case 'touchend': case 'pointerup': case 'mspointerup': case 'mouseup': case 'touchcancel': case 'pointercancel': case 'mspointercancel': case 'mousecancel': this._end(e); break; } }, destroy: function () { if ( this.options.fadescrollbars ) { cleartimeout(this.fadetimeout); this.fadetimeout = null; } if ( this.options.interactive ) { utils.removeevent(this.indicator, 'touchstart', this); utils.removeevent(this.indicator, utils.prefixpointerevent('pointerdown'), this); utils.removeevent(this.indicator, 'mousedown', this); utils.removeevent(window, 'touchmove', this); utils.removeevent(window, utils.prefixpointerevent('pointermove'), this); utils.removeevent(window, 'mousemove', this); utils.removeevent(window, 'touchend', this); utils.removeevent(window, utils.prefixpointerevent('pointerup'), this); utils.removeevent(window, 'mouseup', this); } if ( this.options.defaultscrollbars && this.wrapper.parentnode ) { this.wrapper.parentnode.removechild(this.wrapper); } }, _start: function (e) { var point = e.touches ? e.touches[0] : e; e.preventdefault(); e.stoppropagation(); this.transitiontime(); this.initiated = true; this.moved = false; this.lastpointx = point.pagex; this.lastpointy = point.pagey; this.starttime = utils.gettime(); if ( !this.options.disabletouch ) { utils.addevent(window, 'touchmove', this); } if ( !this.options.disablepointer ) { utils.addevent(window, utils.prefixpointerevent('pointermove'), this); } if ( !this.options.disablemouse ) { utils.addevent(window, 'mousemove', this); } this.scroller._execevent('beforescrollstart'); }, _move: function (e) { var point = e.touches ? e.touches[0] : e, deltax, deltay, newx, newy, timestamp = utils.gettime(); if ( !this.moved ) { this.scroller._execevent('scrollstart'); } this.moved = true; deltax = point.pagex - this.lastpointx; this.lastpointx = point.pagex; deltay = point.pagey - this.lastpointy; this.lastpointy = point.pagey; newx = this.x + deltax; newy = this.y + deltay; this._pos(newx, newy); if ( this.scroller.options.probetype == 1 && timestamp - this.starttime > 300 ) { this.starttime = timestamp; this.scroller._execevent('scroll'); } else if ( this.scroller.options.probetype > 1 ) { this.scroller._execevent('scroll'); } // insert point: indicator._move e.preventdefault(); e.stoppropagation(); }, _end: function (e) { if ( !this.initiated ) { return; } this.initiated = false; e.preventdefault(); e.stoppropagation(); utils.removeevent(window, 'touchmove', this); utils.removeevent(window, utils.prefixpointerevent('pointermove'), this); utils.removeevent(window, 'mousemove', this); if ( this.scroller.options.snap ) { var snap = this.scroller._nearestsnap(this.scroller.x, this.scroller.y); var time = this.options.snapspeed || math.max( math.max( math.min(math.abs(this.scroller.x - snap.x), 1000), math.min(math.abs(this.scroller.y - snap.y), 1000) ), 300); if ( this.scroller.x != snap.x || this.scroller.y != snap.y ) { this.scroller.directionx = 0; this.scroller.directiony = 0; this.scroller.currentpage = snap; this.scroller.scrollto(snap.x, snap.y, time, this.scroller.options.bounceeasing); } } if ( this.moved ) { this.scroller._execevent('scrollend'); } }, transitiontime: function (time) { time = time || 0; var durationprop = utils.style.transitionduration; if(!durationprop) { return; } this.indicatorstyle[durationprop] = time + 'ms'; if ( !time && utils.isbadandroid ) { this.indicatorstyle[durationprop] = '0.0001ms'; // remove 0.0001ms var self = this; raf(function() { if(self.indicatorstyle[durationprop] === '0.0001ms') { self.indicatorstyle[durationprop] = '0s'; } }); } }, transitiontimingfunction: function (easing) { this.indicatorstyle[utils.style.transitiontimingfunction] = easing; }, refresh: function () { this.transitiontime(); if ( this.options.listenx && !this.options.listeny ) { this.indicatorstyle.display = this.scroller.hashorizontalscroll ? 'block' : 'none'; } else if ( this.options.listeny && !this.options.listenx ) { this.indicatorstyle.display = this.scroller.hasverticalscroll ? 'block' : 'none'; } else { this.indicatorstyle.display = this.scroller.hashorizontalscroll || this.scroller.hasverticalscroll ? 'block' : 'none'; } if ( this.scroller.hashorizontalscroll && this.scroller.hasverticalscroll ) { utils.addclass(this.wrapper, 'iscrollbothscrollbars'); utils.removeclass(this.wrapper, 'iscrolllonescrollbar'); if ( this.options.defaultscrollbars && this.options.customstyle ) { if ( this.options.listenx ) { this.wrapper.style.right = '8px'; } else { this.wrapper.style.bottom = '8px'; } } } else { utils.removeclass(this.wrapper, 'iscrollbothscrollbars'); utils.addclass(this.wrapper, 'iscrolllonescrollbar'); if ( this.options.defaultscrollbars && this.options.customstyle ) { if ( this.options.listenx ) { this.wrapper.style.right = '2px'; } else { this.wrapper.style.bottom = '2px'; } } } utils.getrect(this.wrapper); // force refresh if ( this.options.listenx ) { this.wrapperwidth = this.wrapper.clientwidth; if ( this.options.resize ) { this.indicatorwidth = math.max(math.round(this.wrapperwidth * this.wrapperwidth / (this.scroller.scrollerwidth || this.wrapperwidth || 1)), 8); this.indicatorstyle.width = this.indicatorwidth + 'px'; } else { this.indicatorwidth = this.indicator.clientwidth; } this.maxposx = this.wrapperwidth - this.indicatorwidth; if ( this.options.shrink == 'clip' ) { this.minboundaryx = -this.indicatorwidth + 8; this.maxboundaryx = this.wrapperwidth - 8; } else { this.minboundaryx = 0; this.maxboundaryx = this.maxposx; } this.sizeratiox = this.options.speedratiox || (this.scroller.maxscrollx && (this.maxposx / this.scroller.maxscrollx)); } if ( this.options.listeny ) { this.wrapperheight = this.wrapper.clientheight; if ( this.options.resize ) { this.indicatorheight = math.max(math.round(this.wrapperheight * this.wrapperheight / (this.scroller.scrollerheight || this.wrapperheight || 1)), 8); this.indicatorstyle.height = this.indicatorheight + 'px'; } else { this.indicatorheight = this.indicator.clientheight; } this.maxposy = this.wrapperheight - this.indicatorheight; if ( this.options.shrink == 'clip' ) { this.minboundaryy = -this.indicatorheight + 8; this.maxboundaryy = this.wrapperheight - 8; } else { this.minboundaryy = 0; this.maxboundaryy = this.maxposy; } this.maxposy = this.wrapperheight - this.indicatorheight; this.sizeratioy = this.options.speedratioy || (this.scroller.maxscrolly && (this.maxposy / this.scroller.maxscrolly)); } this.updateposition(); }, updateposition: function () { var x = this.options.listenx && math.round(this.sizeratiox * this.scroller.x) || 0, y = this.options.listeny && math.round(this.sizeratioy * this.scroller.y) || 0; if ( !this.options.ignoreboundaries ) { if ( x < this.minboundaryx ) { if ( this.options.shrink == 'scale' ) { this.width = math.max(this.indicatorwidth + x, 8); this.indicatorstyle.width = this.width + 'px'; } x = this.minboundaryx; } else if ( x > this.maxboundaryx ) { if ( this.options.shrink == 'scale' ) { this.width = math.max(this.indicatorwidth - (x - this.maxposx), 8); this.indicatorstyle.width = this.width + 'px'; x = this.maxposx + this.indicatorwidth - this.width; } else { x = this.maxboundaryx; } } else if ( this.options.shrink == 'scale' && this.width != this.indicatorwidth ) { this.width = this.indicatorwidth; this.indicatorstyle.width = this.width + 'px'; } if ( y < this.minboundaryy ) { if ( this.options.shrink == 'scale' ) { this.height = math.max(this.indicatorheight + y * 3, 8); this.indicatorstyle.height = this.height + 'px'; } y = this.minboundaryy; } else if ( y > this.maxboundaryy ) { if ( this.options.shrink == 'scale' ) { this.height = math.max(this.indicatorheight - (y - this.maxposy) * 3, 8); this.indicatorstyle.height = this.height + 'px'; y = this.maxposy + this.indicatorheight - this.height; } else { y = this.maxboundaryy; } } else if ( this.options.shrink == 'scale' && this.height != this.indicatorheight ) { this.height = this.indicatorheight; this.indicatorstyle.height = this.height + 'px'; } } this.x = x; this.y = y; if ( this.scroller.options.usetransform ) { this.indicatorstyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.scroller.translatez; } else { this.indicatorstyle.left = x + 'px'; this.indicatorstyle.top = y + 'px'; } }, _pos: function (x, y) { if ( x < 0 ) { x = 0; } else if ( x > this.maxposx ) { x = this.maxposx; } if ( y < 0 ) { y = 0; } else if ( y > this.maxposy ) { y = this.maxposy; } x = this.options.listenx ? math.round(x / this.sizeratiox) : this.scroller.x; y = this.options.listeny ? math.round(y / this.sizeratioy) : this.scroller.y; this.scroller.scrollto(x, y); }, fade: function (val, hold) { if ( hold && !this.visible ) { return; } cleartimeout(this.fadetimeout); this.fadetimeout = null; var time = val ? 250 : 500, delay = val ? 0 : 300; val = val ? '1' : '0'; this.wrapperstyle[utils.style.transitionduration] = time + 'ms'; this.fadetimeout = settimeout((function (val) { this.wrapperstyle.opacity = val; this.visible = +val; }).bind(this, val), delay); } }; iscroll.utils = utils; if ( typeof module != 'undefined' && module.exports ) { module.exports = iscroll; } else if ( typeof define == 'function' && define.amd ) { define( function () { return iscroll; } ); } else { window.iscroll = iscroll; } })(window, document, math); /**大图、相册查看器 * spotlight.js v0.7.8 (bundle) * copyright 2019-2021 nextapps gmbh * author: thomas wilkerling * licence: apache-2.0 * https://github.com/nextapps-de/spotlight */ (function(){'use strict';var aa=document.createelement("style");aa.innerhtml="@keyframes pulsate{0%,to{opacity:1}50%{opacity:.2}}#spotlight{position:fixed;top:-1px;bottom:-1px;width:100%;z-index:99999;color:#fff;background-color:rgba(0,0,0,.8);opacity:0;overflow:hidden;-webkit-user-select:none;-ms-user-select:none;user-select:none;transition:opacity .2s ease-out;font-family:arial,sans-serif;font-size:16px;font-weight:400;contain:strict;touch-action:none;pointer-events:none}#spotlight.show{opacity:1;transition:none;pointer-events:auto}#spotlight.white{color:#212529;background-color:#fff}#spotlight.white .spl-next,#spotlight.white .spl-page~*,#spotlight.white .spl-prev,#spotlight.white .spl-spinner{filter:invert(1)}#spotlight.white .spl-progress{background-color:rgba(0,0,0,.35)}#spotlight.white .spl-footer,#spotlight.white .spl-header{background-color:rgba(255,255,255,.65)}#spotlight.white .spl-button{background:#212529;color:#fff}.spl-footer,.spl-header{background-color:rgba(0,0,0,.45)}#spotlight .contain,#spotlight .cover{object-fit:cover;height:100%;width:100%}#spotlight .contain{object-fit:contain}#spotlight .autofit{object-fit:none;width:auto;height:auto;max-height:none;max-width:none;transition:none}.spl-scene,.spl-spinner,.spl-track{width:100%;height:100%;position:absolute}.spl-track{contain:strict}.spl-spinner{background-position:center;background-repeat:no-repeat;background-size:42px;opacity:0}.spl-spinner.spin{background-image:url(data:image/svg+xml;base64,phn2zyb3awr0ad0imzgiighlawdodd0imzgiihzpzxdcb3g9ijagmcazocazocigeg1sbnm9imh0dha6ly93d3cudzmub3jnlziwmdavc3zniibzdhjva2u9iinmzmyipjxnigzpbgw9im5vbmuiigzpbgwtcnvszt0izxzlbm9kzci+pgcgdhjhbnnmb3jtpsj0cmfuc2xhdguomsaxksigc3ryb2tllxdpzhropsiyiibzdhjva2utb3bhy2l0et0iljy1ij48y2lyy2xlihn0cm9rzs1vcgfjaxr5psiumtuiign4psixocigy3k9ije4iibypsixocivpjxwyxroigq9ik0zniaxogmwltkuotqtoc4wni0xoc0xoc0xoci+pgfuaw1hdgvucmfuc2zvcm0gyxr0cmlidxrltmftzt0idhjhbnnmb3jtiib0exblpsjyb3rhdguiigzyb209ijagmtggmtgiihrvpsiznjagmtggmtgiigr1cj0imxmiihjlcgvhdenvdw50psjpbmrlzmluaxrlii8+pc9wyxropjwvzz48l2c+pc9zdmc+);transition:opacity .2s linear .25s;opacity:1}.spl-spinner.error{background-image:url(data:image/svg+xml;base64,phn2zybozwlnahq9ijmyiib3awr0ad0imziiihzpzxdcb3g9ijagmcazmiazmiigeg1sbnm9imh0dha6ly93d3cudzmub3jnlziwmdavc3znij48cgf0acbmawxspsijzmzmiibkpsjnmtysmuexnswxnswwldesmcwzmswxniwxnswxnswwldasmcwxniwxwm0wldjhmtmsmtmsmcwwldesoc40nswzlje0tdyumtqsmjqundvbmtmsmtmsmcwwldesmtysm1ptmcwynmexmywxmywwldasms04ljq1ltmumtrmmjuuodysny41nuexmywxmywwldasmswxniwyovoiiglkpsjiyw5fc2lnbl9jcm9zc2vkx2npcmnszsivpjwvc3znpg==);background-size:128px;transition:none;opacity:.5}.spl-scene{transition:transform .65s cubic-bezier(.1,1,.1,1);contain:layout size;will-change:transform}.spl-pane>*{position:absolute;width:auto;height:auto;max-width:100%;max-height:100%;left:50%;top:50%;margin:0;padding:0;border:0;transform:translate(-50%,-50%) scale(1);transition:transform .65s cubic-bezier(.3,1,.3,1),opacity .65s ease;contain:layout style;will-change:transform,opacity;visibility:hidden}.spl-header,.spl-pane,.spl-progress{position:absolute;top:0}.spl-pane{width:100%;height:100%;transition:transform .65s cubic-bezier(.3,1,.3,1);contain:layout size;will-change:transform,contents}.spl-header{width:100%;height:50px;text-align:right;transform:translatey(-100px);transition:transform .35s ease;overflow:hidden;will-change:transform}#spotlight.menu .spl-footer,#spotlight.menu .spl-header,.spl-footer:hover,.spl-header:hover{transform:translatey(0)}.spl-header div{display:inline-block;vertical-align:middle;white-space:nowrap;width:50px;height:50px;opacity:.5}.spl-progress{width:100%;height:3px;background-color:rgba(255,255,255,.45);transform:translatex(-100%);transition:transform linear}.spl-footer,.spl-next,.spl-prev{position:absolute;transition:transform .35s ease;will-change:transform}.spl-footer{left:0;right:0;bottom:0;line-height:20px;padding:20px 20px 0;padding-bottom:env(safe-area-inset-bottom,0);text-align:left;font-size:15px;font-weight:400;transform:translatey(100%)}.spl-title{font-size:22px}.spl-button,.spl-description,.spl-title{margin-bottom:20px}.spl-button{display:inline-block;background:#fff;color:#000;border-radius:5px;padding:10px 20px;cursor:pointer}.spl-next,.spl-page~*,.spl-prev{background-position:center;background-repeat:no-repeat}.spl-page{float:left;width:auto;line-height:50px}.spl-page~*{background-size:21px;float:right}.spl-fullscreen{background-image:url(data:image/svg+xml;base64,pd94bwwgdmvyc2lvbj0ims4wij8+phn2zybmawxspsjub25liibozwlnahq9iji0iibzdhjva2u9iinmzmyiihn0cm9rzs1saw5ly2fwpsjyb3vuzcigc3ryb2tllwxpbmvqb2lupsjyb3vuzcigc3ryb2tllxdpzhropsiyljuiihzpzxdcb3g9ii0xic0xidi2idi2iib3awr0ad0imjqiihhtbg5zpsjodhrwoi8vd3d3lnczlm9yzy8ymdawl3n2zyi+phbhdgggzd0ittggm0g1ytigmiawidagmc0yidj2m20xocawvjvhmiayidagmcawltitmmgtm20wide4adnhmiayidagmcawiditmnytm00zide2djnhmiayidagmcawidigmmgzii8+pc9zdmc+)}.spl-fullscreen.on{background-image:url(data:image/svg+xml;base64,pd94bwwgdmvyc2lvbj0ims4wij8+phn2zybmawxspsjub25liibozwlnahq9iji0iibzdhjva2u9iinmzmyiihn0cm9rzs1saw5ly2fwpsjyb3vuzcigc3ryb2tllwxpbmvqb2lupsjyb3vuzcigc3ryb2tllxdpzhropsiyljuiihzpzxdcb3g9ijagmcayncayncigd2lkdgg9iji0iib4bwxucz0iahr0cdovl3d3dy53my5vcmcvmjawmc9zdmcipjxwyxroigq9ik04idn2m2eyidigmcawidetmiaysdntmtggmggtm2eyidigmcawidetmi0yvjntmcaxohytm2eyidigmcawidegmi0yadnnmyaxnmgzytigmiawidagmsayidj2myivpjwvc3znpg==)}.spl-autofit{background-image:url(data:image/svg+xml;base64,pd94bwwgdmvyc2lvbj0ims4wij8+phn2zybozwlnahq9ijk2chgiihzpzxdcb3g9ijagmca5nia5niigd2lkdgg9ijk2chgiihhtbg5zpsjodhrwoi8vd3d3lnczlm9yzy8ymdawl3n2zyi+phbhdgggdhjhbnnmb3jtpsjyb3rhdguootagntagntapiibmawxspsijzmzmiibkpsjnnzeumzexldgwqzy5ljy3ldg0ljy2ldy1ljizldg4ldywldg4sdiwyy02ljyzldatmtitns4zny0xmi0xmlyznmmwltuumjmsmy4znc05ljy3ldgtmteumzexvjc2yzasmi4ymswxljc5ldqsncw0sdcxljmxmsageiivpjxwyxroihryyw5zzm9ybt0icm90yxrlkdkwiduwiduwksigzmlsbd0ii2zmziigzd0ittc2ldhimzzjltyunjmsmc0xmiw1ljm3lteyldeydjqwyzasni42myw1ljm3ldeyldeyldeyadqwyzyunjmsmcwxmi01ljm3ldeylteyvjiwqzg4ldezljm3ldgyljyzldgsnzysohogttgwldywicbjmcwyljixlteunzksnc00ldrimzzjltiumjesmc00lteunzktnc00vjiwyzatmi4ymswxljc5ltqsnc00adqwyziumjesmcw0ldeunzksncw0vjyweiivpjwvc3znpg==)}.spl-zoom-in,.spl-zoom-out{background-image:url(data:image/svg+xml;base64,pd94bwwgdmvyc2lvbj0ims4wij8+phn2zybmawxspsjub25liibozwlnahq9iji0iibzdhjva2u9iinmzmyiihn0cm9rzs1saw5ly2fwpsjyb3vuzcigc3ryb2tllwxpbmvqb2lupsjyb3vuzcigc3ryb2tllxdpzhropsiyiib2awv3qm94psiwidagmjqgmjqiihdpzhropsiyncigeg1sbnm9imh0dha6ly93d3cudzmub3jnlziwmdavc3znij48y2lyy2xlign4psixmsigy3k9ijexiibypsi4ii8+pgxpbmugede9ijixiib4mj0imtyunjuiihkxpsiymsigeti9ije2ljy1ii8+pgxpbmugede9ijgiihgypsixncigete9ijexiib5mj0imteilz48l3n2zz4=);background-size:22px}.spl-zoom-in{background-image:url(data:image/svg+xml;base64,pd94bwwgdmvyc2lvbj0ims4wij8+phn2zybmawxspsjub25liibozwlnahq9iji0iibzdhjva2u9iinmzmyiihn0cm9rzs1saw5ly2fwpsjyb3vuzcigc3ryb2tllwxpbmvqb2lupsjyb3vuzcigc3ryb2tllxdpzhropsiyiib2awv3qm94psiwidagmjqgmjqiihdpzhropsiyncigeg1sbnm9imh0dha6ly93d3cudzmub3jnlziwmdavc3znij48y2lyy2xlign4psixmsigy3k9ijexiibypsi4ii8+pgxpbmugede9ijixiib4mj0imtyunjuiihkxpsiymsigeti9ije2ljy1ii8+pgxpbmugede9ijexiib4mj0imteiihkxpsi4iib5mj0imtqilz48bgluzsb4mt0iocigedi9ije0iib5mt0imteiihkypsixmsivpjwvc3znpg==)}.spl-download{background-image:url(data:image/svg+xml;base64,pd94bwwgdmvyc2lvbj0ims4wiia/pjxzdmcgagvpz2h0psixndeunzmychgiihzlcnnpb249ijeumsigdmlld0jved0imcawide0ms43mzigmtqxljczmiigd2lkdgg9ije0ms43mzjwecigeg1sbnm9imh0dha6ly93d3cudzmub3jnlziwmdavc3znij48zybmawxspsijzmzmij48cgf0acbkpsjnmtiwljy3ncwxmjuumtm4sdiwljc5m3yxni41otrootkuodgxvjeyns4xmzh6ie0xmtkumde5ldu4ljc3nmmtmi41njetmi41njitni43mtytmi41njitos4ynzusmew3ny4ymsw5ms4zmtjwni41njigicbdnzcumjesmi45mzysnzqumjy5ldasnzaunjq4ldbjltmunji0ldatni41niwyljkzny02lju2ldyuntyzdjg0ljc1tdmxljk5miw1os4ymthjltiuntyyltiunty0ltyunze1ltiunty0ltkumjc3ldagicbjltiunty1ldiuntyyltiunty1ldyunze2ldasos4ynzlsndmumjk0ldqzlji5m2mwlje1ldaumtu0ldaumze0ldaumjk5ldaundgxldaundm4yzaumdc2ldaumdyyldaumtu1ldaumtezldaumjm0ldaumtc2icagyzaumdk0ldaumdy1ldaumtg2ldaumtqyldaumjc5ldaumja2yzaumdk3ldaumdyzldaumtkyldaumte0ldaumjg2ldaumtc0yzaumdg4ldaumdu0ldaumtc0ldaumta1ldaumjy1ldaumtuzicagyzaumswwlja1niwwlje5oswwljesmc4yotgsmc4xnddjmc4wotcsmc4wndusmc4xoswwlja5mswwlji4mywwljezmmmwlja5ocwwlja0ldaumtk2ldaumdcyldaumjk1ldaumta1icagyzaumta0ldaumdm4ldaumja3ldaumdc4ldaumzeyldaumta5yzaumtaxldaumdmsmc4xotcsmc4wntismc4yotcsmc4wnzdjmc4xmdgsmc4wmjmsmc4ymtqsmc4wntgsmc4zmjqsmc4wnzggicbjmc4xmtusmc4wmjesmc4ymzesmc4wmzmsmc4zndysmc4wntrjmc4wotcsmc4wmtusmc4xotismc4wmzismc4yodksmc4wndjjmc40mywwlja0miwwljg2nswwlja0miwxlji5nswwicagyzaums0wljaxldaumtkxltaumdi3ldaumjg5ltaumdqyyzaumte0ltaumdixldaumjmzltaumdi5ldaumzq0ltaumdu0yzaumta5ltaumdixldaumje3ltaumdu1ldaumzi0ltaumdc4icagyzaumtayltaumdi1ldaumtk5ltaumdq3ldaumjk5ltaumdc3yzaumta1ltaumdmxldaumja3ltaumdcxldaumzeyltaumta5yzaumtayltaumdmsmc4xotutmc4wnjismc4yotutmc4xmdugicbjmc4wotytmc4wndesmc4xotetmc4wodcsmc4yodmtmc4xmzjjmc4xltaumdq4ldaumtk5ltaumdkyldaumjk3ltaumtq3yzaumdkxltaumdq4ldaumtc3ltaumta0ldaumjy0ltaumtuzicagyzaumdk4ltaumdysmc4xotmtmc4xmswwlji4ny0wlje3ngmwlja5ni0wlja2ncwwlje4os0wlje0mswwlji4ms0wljiwnmmwlja3ni0wlja2miwwlje1ni0wljexmywwljizmy0wlje3niagigmwlji0os0wljiwncwwljq3os0wljqznywwljy5nc0wljy3yzaumdc2ltaumdy3ldaumtu0ltaumtmxldaumji5ltaumjazbdqzlji5nc00my4yotygicbdmtixlju4msw2ns40otesmtixlju4msw2ms4zmzcsmte5ljaxosw1oc43nzyilz48l2c+pc9zdmc+);background-size:20px}.spl-theme{background-image:url(data:image/svg+xml;base64,pd94bwwgdmvyc2lvbj0ims4wij8+phn2zybozwlnahq9iji0chgiihzlcnnpb249ijeumiigdmlld0jved0imiayidiwidiwiib3awr0ad0imjrwecigeg1sbnm9imh0dha6ly93d3cudzmub3jnlziwmdavc3znij48zybmawxspsijzmzmij48cgf0acbkpsjnmtisngmtnc40mtgsmc04ldmuntgyltgsohmzlju4miw4ldgsohm4ltmuntgyldgtofmxni40mtgsncwxmiw0eibnmtismthjltmumze0ldatni0yljy4ni02ltzzmi42odytniw2ltzzniwyljy4niw2ldyguze1ljmxncwxocwxmiwxohoilz48cgf0acbkpsjnmtisn3yxmgmyljc1nywwldutmi4yndmsns01uze0ljc1nyw3ldeyldd6ii8+pc9npjwvc3znpg==)}.spl-play{background-image:url(data:image/svg+xml;base64,pd94bwwgdmvyc2lvbj0ims4wij8+phn2zybmawxspsjub25liibozwlnahq9iji0iibzdhjva2u9iinmzmyiihn0cm9rzs1saw5ly2fwpsjyb3vuzcigc3ryb2tllwxpbmvqb2lupsjyb3vuzcigc3ryb2tllxdpzhropsiyiib2awv3qm94psitmc41ic0wljugmjugmjuiihdpzhropsiyncigeg1sbnm9imh0dha6ly93d3cudzmub3jnlziwmdavc3znij48y2lyy2xlign4psixmiigy3k9ijeyiibypsixmcivpjxwb2x5z29uigzpbgw9iinmzmyiihbvaw50cz0imtagocaxniaxmiaxmcaxniaxmca4ii8+pc9zdmc+)}.spl-play.on{background-image:url(data:image/svg+xml;base64,pd94bwwgdmvyc2lvbj0ims4wij8+phn2zybmawxspsjub25liibozwlnahq9iji0iibzdhjva2u9iinmzmyiihn0cm9rzs1saw5ly2fwpsjyb3vuzcigc3ryb2tllwxpbmvqb2lupsjyb3vuzcigc3ryb2tllxdpzhropsiyiib2awv3qm94psitmc41ic0wljugmjugmjuiihdpzhropsiyncigeg1sbnm9imh0dha6ly93d3cudzmub3jnlziwmdavc3znij48y2lyy2xlign4psixmiigy3k9ijeyiibypsixmcivpjxsaw5lihgxpsixmcigedi9ijewiib5mt0imtuiihkypsi5ii8+pgxpbmugede9ije0iib4mj0imtqiihkxpsixnsigeti9ijkilz48l3n2zz4=);animation:pulsate 1s ease infinite}.spl-close{background-image:url(data:image/svg+xml;base64,pd94bwwgdmvyc2lvbj0ims4wij8+phn2zybmawxspsjub25liibozwlnahq9iji0iibzdhjva2u9iinmzmyiihn0cm9rzs1saw5ly2fwpsjyb3vuzcigc3ryb2tllwxpbmvqb2lupsjyb3vuzcigc3ryb2tllxdpzhropsiyiib2awv3qm94psiyidigmjagmjaiihdpzhropsiyncigeg1sbnm9imh0dha6ly93d3cudzmub3jnlziwmdavc3znij48bgluzsb4mt0imtgiihgypsi2iib5mt0iniigeti9ije4ii8+pgxpbmugede9ijyiihgypsixocigete9ijyiihkypsixocivpjwvc3znpg==)}.spl-next,.spl-prev{top:50%;width:50px;height:50px;opacity:.65;background-color:rgba(0,0,0,.45);border-radius:100%;cursor:pointer;margin-top:-25px;transform:translatex(-100px);background-image:url(data:image/svg+xml;base64,pd94bwwgdmvyc2lvbj0ims4wij8+phn2zybmawxspsjub25liibozwlnahq9iji0iibzdhjva2u9iinmzmyiihn0cm9rzs1saw5ly2fwpsjyb3vuzcigc3ryb2tllwxpbmvqb2lupsjyb3vuzcigc3ryb2tllxdpzhropsiyiib2awv3qm94psiwidagmjqgmjqiihdpzhropsiyncigeg1sbnm9imh0dha6ly93d3cudzmub3jnlziwmdavc3znij48cg9sewxpbmugcg9pbnrzpsixnsaxoca5ideyide1idyilz48l3n2zz4=);background-size:30px}.spl-prev{left:20px}.spl-next{left:auto;right:20px;transform:translatex(100px) scalex(-1)}#spotlight.menu .spl-prev{transform:translatex(0)}#spotlight.menu .spl-next{transform:translatex(0) scalex(-1)}@media (hover:hover){.spl-page~div{cursor:pointer;transition:opacity .2s ease}.spl-next:hover,.spl-page~div:hover,.spl-prev:hover{opacity:1}}@media (max-width:500px){.spl-header div{width:44px}.spl-footer .spl-title{font-size:20px}.spl-footer{font-size:14px}.spl-next,.spl-prev{width:35px;height:35px;margin-top:-17.5px;background-size:15px 15px}.spl-spinner{background-size:30px 30px}}.hide-scrollbars{overflow:hidden!important}"; var ba=document.getelementsbytagname("head")[0];ba.firstchild?ba.insertbefore(aa,ba.firstchild):ba.appendchild(aa);object.assign||(object.assign=function(a,b){for(var c=object.keys(b),e=0,f;e
";var ia={},ja=document.createelement("video");function ka(a,b,c,e){if("node"!==e)for(var f=object.keys(c),a=0,w;a.5*(0>a?1:a?-1:0)?eb():db())}function w(a,b){("boolean"===typeof a?a:!r)===!r&&(r=r?cleartimeout(r):1,d(wa,"on",r),b||ub(r))}function ub(a){wa&&(da(o,function(){g(o,"transition-duration","");g(o,"transform","")}),a&&(g(o,"transition-duration",ha+"s"),g(o,"transform","translatex(0)")));a&&(r=settimeout(ib,1e3*ha))}function x(){ba&&(ya=date.now()+2950,s||(d(p,"menu",!0),eb(3e3)))} function eb(a){s=settimeout(function(){var b=date.now();b>=ya?(d(p,"menu"),s=0):eb(ya-b)},a)}function fb(a){"boolean"===typeof a&&(s=a?s:0);s?(s=cleartimeout(s),d(p,"menu")):x()}function kb(a){ea(a,!0);sa=!0;ta=!1;var b=a.touches;b&&(b=b[0])&&(a=b);ua=qa*v<=u;na=a.pagex;oa=a.pagey;m(l)}function mb(a){ea(a);if(sa){if(ta){if(ua&&ta){var b=(a=r<-(u/7)&&(zu/7&&(1b?r=b:r<-b&&(r=-b),ra*v>pa&&(b=(ra*v-pa)/2,t-=oa-(oa=a.pagey),t>b?t=b:t<-b&&(t=-b)));ta=!0;z(r,t)}else x()}function cb(a){var b=yb();if("boolean"!==typeof a||a!==!!b)if(b)document[za]();else p[t]()}function fb(a){"string"!==typeof a&&(a=y?"":ca||"white");y!==a&&(y&&d(p,y),a&&d(p,a,!0),y=a)} function v(a){"boolean"===typeof a&&(x=!a);x=1===v&&!x;d(n,"autofit",x);g(n,"transform","");v=1;t=r=0;wb();m(l);z()}function db(){var a=v/.65;50>=a&&(x&&v(),r/=.65,t/=.65,z(r,t),gb(a))}function eb(){var a=.65*v;x&&v();1<=a&&(1===a?r=t=0:(r*=.65,t*=.65),z(r,t),gb(a))}function gb(a){v=a||1;sb()}function gb(){var a=k,b=document.createelement("a"),c=n.src;b.href=c;b.download=c.substring(c.lastindexof("/")+1);a.appendchild(b);b.click();a.removechild(b)} function bb(a){settimeout(function(){k.removechild(p);l=n=p=d=e=c=xa=ya=za=fa=null},200);d(k,"hide-scrollbars");d(p,"show");cb(!1);qb();history.go(!0===a?-1:-2);q&&(la.src="");r&&w();n&&xb(n);s&&(s=cleartimeout(s));y&&fb();i&&d(p,i);za&&za()}function xb(a){if(a.g)a.g.appendchild(a),a.g=null;else{var b=a.parentnode;b&&b.removechild(a);a.src=a.onerror=""}}function hb(a){a&&x();if(1z;z=a;pb(b);return!0}} function ib(a){var b=c[z-1],c=b;d={};e&&object.assign(d,e);object.assign(d,c.dataset||c);va=d.media;fa=d.onclick;ca=d.theme;i=d["class"];ba=y("autohide",!0);g=y("infinite");wa=y("progress",!0);h=y("autoslide");da=y("preload",!0);ea=d.buttonhref;ha=h&&parsefloat(h)||7;y||ca&&fb(ca);i&&d(p,i,!0);i&&da(p);if(c=d.control){c="string"===typeof c?c.split(","):c;for(var e=0;e